no_std_compat::arch::x86_64

Function _mm_extract_ps

1.27.0 · Source
pub unsafe fn _mm_extract_ps<const IMM8: i32>(a: __m128) -> i32
Available on x86-64 only.
Expand description

Extracts a single-precision (32-bit) floating-point element from a, selected with IMM8. The returned i32 stores the float’s bit-pattern, and may be converted back to a floating point number via casting.

§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]);

Intel’s documentation