core::arch::x86_64::_mm_shuffle_epi8 - Rust
Description: API documentation for the Rust `_mm_shuffle_epi8` fn in crate `core`.
Keywords: rust, rustlang, rust-lang, _mm_shuffle_epi8

# 1.27.0[−][src]Function core::arch::x86_64::_mm_shuffle_epi8

    pub unsafe fn _mm_shuffle_epi8(a: __m128i, b: __m128i) -> __m128i

This is supported on x86-64 and target feature `ssse3` only.

Shuffle bytes from `a` according to the content of `b`.

The last 4 bits of each byte of `b` are used as addresses into the 16 bytes of `a`.

In addition, if the highest significant bit of a byte of `b` is set, the respective destination byte is set to 0.

Picturing `a` and `b` as `[u8; 16]`, `_mm_shuffle_epi8` is logically equivalent to:

    fn mm_shuffle_epi8(a: [u8; 16], b: [u8; 16]) -> [u8; 16] {
        let mut r = [0u8; 16];
        for i in 0..16 {
            // if the most significant bit of b is set,
            // then the destination byte is set to 0.
            if b[i] & 0x80 == 0u8 {
                r[i] = a[(b[i] % 16) as usize];
            }
        }
        r
    }Run

Intel's documentation

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g. `str,u8` or `String,struct:Vec,test`)