Function _mm_extract_ps

#[target_feature(enable = "sse4.1")]
pub const fn _mm_extract_ps(a: __m128, IMM8: i32) -> i32

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

# #[cfg(target_arch = "x86")]
# use std::arch::x86::*;
# #[cfg(target_arch = "x86_64")]
# use std::arch::x86_64::*;
# fn main() {
#    if is_x86_feature_detected!("sse4.1") {
#       #[target_feature(enable = "sse4.1")]
#       #[allow(unused_unsafe)] // FIXME remove after stdarch bump in rustc
#       unsafe fn worker() { unsafe {
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]);
#       }}
#       unsafe { worker() }
#   }
# }

Intel's documentation