Skip to main content

## permlane32_swap

# Function permlane32_swap

Source

    pub unsafe fn permlane32_swap<const FI: bool, const BOUND_CONTROL: bool>(
        vdst_old: u32,
        vsrc_src0: u32,
    ) -> (u32, u32)

🔬This is a nightly-only experimental API. (`stdarch_amdgpu` #149988)
Available on AMD GPU only.
Expand description

Provide direct access to `v_permlane32_swap_b32` instruction on supported targets.

Swaps the values across lanes of first 2 operands. Rows 2 and 3 of the first operand are swapped with rows 0 and 1 of the second operand (one row is 16 lanes). Returns a pair for the swapped registers. The first element of the return corresponds to the swapped element of the first argument.

This intrinsic does not behave like a normal function call; it is a “convergent” operation and as such has non-standard control-flow effects which need special treatment by the language. Rust currently does not properly support convergent operations. This operation is hence provided on a best-effort basis. Using it may result in incorrect code under some circumstances.