Skip to main content

## permute2

# Function permute2

Source

    fn permute2<'tcx>(
        ecx: &mut MiriInterpCx<'tcx>,
        left: &OpTy<'tcx>,
        indices: &OpTy<'tcx>,
        right: &OpTy<'tcx>,
        dest: &MPlaceTy<'tcx>,
    ) -> InterpResult<'tcx, ()>

Expand description

Shuffle elements from two source registers (`left` and `right`) using the corresponding index in `indices`, and store the results in `dest`.

For a vector with `N` lanes, the low `log2(N)` bits of each index select a lane within a source vector. Bit `log2(N)` selects the source vector (`0` => `left`, `1` => `right`), and all higher bits are ignored. Equivalently, lane `i` of the result is copied from `src[indices[i] & (N - 1)]` where `src = if indices[i] & N == 0 { left } else { right }`.

https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_permutex2var_epi64 https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_permutex2var_epi8