[][src]Macro safe_arch::extract_i8_as_i32_m256i

macro_rules! extract_i8_as_i32_m256i {
    ($a:expr, $imm:expr) => { ... };
}
This is supported with target feature avx2 only.

Gets an i8 value out of an m256i, returns as i32.

The lane to get must be a constant. If you select outside the range 0..32 then the selection is wrapped to be in range (only the lowest 5 bits of the input are used).

let a = m256i::from([
  0xA_i8, 0xB, 0xC, 0xD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
]);
//
assert_eq!(extract_i8_as_i32_m256i!(a, 0), 0xA);
assert_eq!(extract_i8_as_i32_m256i!(a, 1), 0xB);
// the lane requested is "wrapped" to be a valid index.
assert_eq!(0b10_0010 & 0b1_1111, 2);
assert_eq!(extract_i8_as_i32_m256i!(a, 0b10_0010), 0xC);