[][src]Macro safe_arch::shuffle_abi_f32_all_m128

macro_rules! shuffle_abi_f32_all_m128 {
    ($a:expr, $b:expr, [a:$z:expr, a:$o:expr, b:$t:expr, b:$e:expr]) => { ... };
}
This is supported with target feature sse only.

Shuffle the f32 lanes from $a and $b together using an immediate control value.

The a: and b: prefixes on the index selection values are literal tokens that you type. It helps keep clear what value comes from where. The first two output lanes come from $a, the second two output lanes come from $b.

You can pass the same value as both arguments, but if you want to swizzle within only a single register and you have avx available consider using shuffle_ai_f32_all_m128 instead. You'll get much better performance.

let a = m128::from_array([1.0, 2.0, 3.0, 4.0]);
let b = m128::from_array([5.0, 6.0, 7.0, 8.0]);
//
let c = shuffle_abi_f32_all_m128!(a, b, [a:0, a:0, b:0, b:0]).to_array();
assert_eq!(c, [1.0, 1.0, 5.0, 5.0]);
//
let c = shuffle_abi_f32_all_m128!(a, b, [a:0, a:1, b:2, b:3]).to_array();
assert_eq!(c, [1.0, 2.0, 7.0, 8.0]);
//
let c = shuffle_abi_f32_all_m128!(a, b, [a:0, a:2, b:2, b:1]).to_array();
assert_eq!(c, [1.0, 3.0, 7.0, 6.0]);