Function core::arch::x86_64::_mm_extract_ps

1.27.0 · source ·
pub unsafe fn _mm_extract_ps(a: __m128, const IMM8: i32) -> i32
Available on (x86 or x86-64) and target feature sse4.1 and x86-64 only.
Expand description

从用 IMM8 选择的 a 中提取单精度 (32-bit) 浮点元素。 返回的 i32 存储浮点数的位模式,并且可以通过转换将其转换回浮点数。

Example

let mut float_store = vec![1.0, 1.0, 2.0, 3.0];
let simd_floats = _mm_set_ps(2.5, 5.0, 7.5, 10.0);
let x: i32 = _mm_extract_ps::<2>(simd_floats);
float_store.push(f32::from_bits(x as u32));
assert_eq!(float_store, vec![1.0, 1.0, 2.0, 3.0, 5.0]);
Run

Intel’s documentation