Macro safe_arch::extract_i16_as_i32_m256i
source · macro_rules! extract_i16_as_i32_m256i { ($a:expr, $imm:expr) => { ... }; }
Expand description
Gets an i16
value out of an m256i
, returns as i32
.
The lane to get must be a constant. If you select outside the range 0..16
then the selection is wrapped to be in range (only the lowest 4 bits of the
input are used).
let a =
m256i::from([0xA_i16, 0xB, 0xC, 0xD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
//
assert_eq!(extract_i16_as_i32_m256i!(a, 0), 0xA);
assert_eq!(extract_i16_as_i32_m256i!(a, 1), 0xB);
// the lane requested is "wrapped" to be a valid index.
assert_eq!(0b1_0010 & 0b1111, 2);
assert_eq!(extract_i16_as_i32_m256i!(a, 0b1_0010), 0xC);
- Intrinsic:
_mm256_extract_epi16