From 2696da267f825740958cbb5463d926d44d97d5de Mon Sep 17 00:00:00 2001 From: BernardoGV <93843760+bernardogv@users.noreply.github.com> Date: Sat, 17 Oct 2026 11:30:41 -0500 Subject: [PATCH] amdgpu: document that ds_permute/ds_bpermute take a byte address --- crates/core_arch/src/amdgpu/mod.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/core_arch/src/amdgpu/mod.rs b/crates/core_arch/src/amdgpu/mod.rs index 53aa142f67..461a4ccda3 100644 --- a/crates/core_arch/src/amdgpu/mod.rs +++ b/crates/core_arch/src/amdgpu/mod.rs @@ -702,10 +702,12 @@ pub fn s_memrealtime() -> u64 { /// Scatter data across all lanes in a wavefront. /// -/// Writes `value` to the lane `lane`. +/// Writes `value` to the lane addressed by `lane`. +/// +/// `lane` is a byte address, not a lane index: pass `n * 4` to write to lane `n`. /// /// Reading from inactive lanes returns `0`. -/// In case multiple values get written to the same `lane`, the value from the source lane with the higher index is taken. +/// In case multiple values get written to the same lane, the value from the source lane with the higher index is taken. /// #[doc = include_str!("intrinsic_is_convergent.md")] #[inline] @@ -715,7 +717,9 @@ pub unsafe fn ds_permute(lane: u32, value: u32) -> u32 { } /// Gather data across all lanes in a wavefront. /// -/// Returns the `value` given to `ds_permute` by lane `lane`. +/// Returns the `value` given to `ds_bpermute` by the lane addressed by `lane`. +/// +/// `lane` is a byte address, not a lane index: pass `n * 4` to read from lane `n`. /// /// Reading from inactive lanes returns `0`. ///