Function safe_arch::shuffle_abi_f64_all_m128d
source · pub fn shuffle_abi_f64_all_m128d<const MASK: i32>(a: m128d, b: m128d) -> m128d
Available with target feature
sse2
only.Expand description
Shuffle the f64
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_f64_all_m128d
] instead. You’ll get much better performance.
let a = m128d::from_array([1.0, 2.0]);
let b = m128d::from_array([3.0, 4.0]);
//
let c = shuffle_abi_f64_all_m128d::<0b00>(a, b).to_array();
assert_eq!(c, [1.0, 3.0]);
//
let c = shuffle_abi_f64_all_m128d::<0b10>(a, b).to_array();
assert_eq!(c, [1.0, 4.0]);