#![cfg(target_feature="sse2")]
use super::*;
use core::ops::*;
impl m128 {
#[inline(always)]
pub fn round_i32x4(self) -> m128i {
m128i(unsafe { _mm_cvtps_epi32(self.0) })
}
#[inline(always)]
pub fn truncate_i32x4(self) -> m128i {
m128i(unsafe { _mm_cvttps_epi32(self.0) })
}
#[inline(always)]
pub fn round_f64x2(self) -> m128d {
m128d(unsafe { _mm_cvtps_pd(self.0) })
}
#[inline(always)]
pub fn f64_round_copy0(self, rhs: m128d) -> Self {
Self(unsafe { _mm_cvtsd_ss(self.0, rhs.0) })
}
#[inline(always)]
pub fn cast_m128i(self) -> m128i {
m128i(unsafe { _mm_castps_si128(self.0) })
}
}
#[derive(Clone, Copy)]
#[allow(bad_style)]
#[repr(transparent)]
pub struct m128i(pub __m128i);
unsafe impl Zeroable for m128i {}
unsafe impl Pod for m128i {}
impl core::fmt::Debug for m128i {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
match f.width() {
Some(2) => {
if f.alternate() {
let a: [u64; 2] = cast(self.0);
write!(f, "m128i({:?}, {:?})", a[0], a[1])
} else {
let a: [i64; 2] = cast(self.0);
write!(f, "m128i({:?}, {:?})", a[0], a[1])
}
}
Some(4) => {
if f.alternate() {
let a: [u32; 4] = cast(self.0);
write!(f, "m128i({:?}, {:?}, {:?}, {:?})", a[0], a[1], a[2], a[3])
} else {
let a: [i32; 4] = cast(self.0);
write!(f, "m128i({:?}, {:?}, {:?}, {:?})", a[0], a[1], a[2], a[3])
}
}
Some(8) => {
if f.alternate() {
let a: [u16; 8] = cast(self.0);
write!(
f,
"m128i({:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?})",
a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]
)
} else {
let a: [i16; 8] = cast(self.0);
write!(
f,
"m128i({:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?})",
a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]
)
}
}
Some(16) => {
if f.alternate() {
let a: [u8; 16] = cast(self.0);
write!(f, "m128i({:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?})", a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15])
} else {
let a: [i8; 16] = cast(self.0);
write!(f, "m128i({:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?})", a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15])
}
}
_ => {
if f.alternate() {
let a: u128 = cast(self.0);
write!(f, "m128i({:?})", a)
} else {
let a: i128 = cast(self.0);
write!(f, "m128i({:?})", a)
}
}
}
}
}
impl core::fmt::Display for m128i {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
match f.width() {
Some(2) => {
if f.alternate() {
let a: [u64; 2] = cast(self.0);
write!(f, "m128i({}, {})", a[0], a[1])
} else {
let a: [i64; 2] = cast(self.0);
write!(f, "m128i({}, {})", a[0], a[1])
}
}
Some(4) => {
if f.alternate() {
let a: [u32; 4] = cast(self.0);
write!(f, "m128i({}, {}, {}, {})", a[0], a[1], a[2], a[3])
} else {
let a: [i32; 4] = cast(self.0);
write!(f, "m128i({}, {}, {}, {})", a[0], a[1], a[2], a[3])
}
}
Some(8) => {
if f.alternate() {
let a: [u16; 8] = cast(self.0);
write!(
f,
"m128i({}, {}, {}, {}, {}, {}, {}, {})",
a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]
)
} else {
let a: [i16; 8] = cast(self.0);
write!(
f,
"m128i({}, {}, {}, {}, {}, {}, {}, {})",
a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]
)
}
}
Some(16) => {
if f.alternate() {
let a: [u8; 16] = cast(self.0);
write!(
f,
"m128i({}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {})",
a[0],
a[1],
a[2],
a[3],
a[4],
a[5],
a[6],
a[7],
a[8],
a[9],
a[10],
a[11],
a[12],
a[13],
a[14],
a[15]
)
} else {
let a: [i8; 16] = cast(self.0);
write!(
f,
"m128i({}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {})",
a[0],
a[1],
a[2],
a[3],
a[4],
a[5],
a[6],
a[7],
a[8],
a[9],
a[10],
a[11],
a[12],
a[13],
a[14],
a[15]
)
}
}
_ => {
if f.alternate() {
let a: u128 = cast(self.0);
write!(f, "m128i({})", a)
} else {
let a: i128 = cast(self.0);
write!(f, "m128i({})", a)
}
}
}
}
}
impl core::fmt::Binary for m128i {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
match f.width() {
Some(2) => {
let a: [u64; 2] = cast(self.0);
if f.alternate() {
write!(f, "m128i({:#b}, {:#b})", a[0], a[1])
} else {
write!(f, "m128i({:b}, {:b})", a[0], a[1])
}
}
Some(4) => {
let a: [u32; 4] = cast(self.0);
if f.alternate() {
write!(
f,
"m128i({:#b}, {:#b}, {:#b}, {:#b})",
a[0], a[1], a[2], a[3]
)
} else {
write!(f, "m128i({:b}, {:b}, {:b}, {:b})", a[0], a[1], a[2], a[3])
}
}
Some(8) => {
let a: [u16; 8] = cast(self.0);
if f.alternate() {
write!(
f,
"m128i({:#b}, {:#b}, {:#b}, {:#b}, {:#b}, {:#b}, {:#b}, {:#b})",
a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]
)
} else {
write!(
f,
"m128i({:b}, {:b}, {:b}, {:b}, {:b}, {:b}, {:b}, {:b})",
a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]
)
}
}
Some(16) => {
let a: [u8; 16] = cast(self.0);
if f.alternate() {
write!(f, "m128i({:#b}, {:#b}, {:#b}, {:#b}, {:#b}, {:#b}, {:#b}, {:#b}, {:#b}, {:#b}, {:#b}, {:#b}, {:#b}, {:#b}, {:#b}, {:#b})", a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15])
} else {
write!(f, "m128i({:b}, {:b}, {:b}, {:b}, {:b}, {:b}, {:b}, {:b}, {:b}, {:b}, {:b}, {:b}, {:b}, {:b}, {:b}, {:b})", a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15])
}
}
_ => {
let a: u128 = cast(self.0);
if f.alternate() {
write!(f, "m128i({:#b})", a)
} else {
write!(f, "m128i({:b})", a)
}
}
}
}
}
impl core::fmt::LowerHex for m128i {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
match f.width() {
Some(2) => {
let a: [u64; 2] = cast(self.0);
if f.alternate() {
write!(f, "m128i({:#x}, {:#x})", a[0], a[1])
} else {
write!(f, "m128i({:x}, {:x})", a[0], a[1])
}
}
Some(4) => {
let a: [u32; 4] = cast(self.0);
if f.alternate() {
write!(
f,
"m128i({:#x}, {:#x}, {:#x}, {:#x})",
a[0], a[1], a[2], a[3]
)
} else {
write!(f, "m128i({:x}, {:x}, {:x}, {:x})", a[0], a[1], a[2], a[3])
}
}
Some(8) => {
let a: [u16; 8] = cast(self.0);
if f.alternate() {
write!(
f,
"m128i({:#x}, {:#x}, {:#x}, {:#x}, {:#x}, {:#x}, {:#x}, {:#x})",
a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]
)
} else {
write!(
f,
"m128i({:x}, {:x}, {:x}, {:x}, {:x}, {:x}, {:x}, {:x})",
a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]
)
}
}
Some(16) => {
let a: [u8; 16] = cast(self.0);
if f.alternate() {
write!(f, "m128i({:#x}, {:#x}, {:#x}, {:#x}, {:#x}, {:#x}, {:#x}, {:#x}, {:#x}, {:#x}, {:#x}, {:#x}, {:#x}, {:#x}, {:#x}, {:#x})", a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15])
} else {
write!(f, "m128i({:x}, {:x}, {:x}, {:x}, {:x}, {:x}, {:x}, {:x}, {:x}, {:x}, {:x}, {:x}, {:x}, {:x}, {:x}, {:x})", a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15])
}
}
_ => {
let a: u128 = cast(self.0);
if f.alternate() {
write!(f, "m128i({:#x})", a)
} else {
write!(f, "m128i({:x})", a)
}
}
}
}
}
impl core::fmt::Octal for m128i {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
match f.width() {
Some(2) => {
let a: [u64; 2] = cast(self.0);
if f.alternate() {
write!(f, "m128i({:#o}, {:#o})", a[0], a[1])
} else {
write!(f, "m128i({:o}, {:o})", a[0], a[1])
}
}
Some(4) => {
let a: [u32; 4] = cast(self.0);
if f.alternate() {
write!(
f,
"m128i({:#o}, {:#o}, {:#o}, {:#o})",
a[0], a[1], a[2], a[3]
)
} else {
write!(f, "m128i({:o}, {:o}, {:o}, {:o})", a[0], a[1], a[2], a[3])
}
}
Some(8) => {
let a: [u16; 8] = cast(self.0);
if f.alternate() {
write!(
f,
"m128i({:#o}, {:#o}, {:#o}, {:#o}, {:#o}, {:#o}, {:#o}, {:#o})",
a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]
)
} else {
write!(
f,
"m128i({:o}, {:o}, {:o}, {:o}, {:o}, {:o}, {:o}, {:o})",
a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]
)
}
}
Some(16) => {
let a: [u8; 16] = cast(self.0);
if f.alternate() {
write!(f, "m128i({:#o}, {:#o}, {:#o}, {:#o}, {:#o}, {:#o}, {:#o}, {:#o}, {:#o}, {:#o}, {:#o}, {:#o}, {:#o}, {:#o}, {:#o}, {:#o})", a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15])
} else {
write!(f, "m128i({:o}, {:o}, {:o}, {:o}, {:o}, {:o}, {:o}, {:o}, {:o}, {:o}, {:o}, {:o}, {:o}, {:o}, {:o}, {:o})", a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15])
}
}
_ => {
let a: u128 = cast(self.0);
if f.alternate() {
write!(f, "m128i({:#o})", a)
} else {
write!(f, "m128i({:o})", a)
}
}
}
}
}
impl core::fmt::UpperHex for m128i {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
match f.width() {
Some(2) => {
let a: [u64; 2] = cast(self.0);
if f.alternate() {
write!(f, "m128i({:#X}, {:#X})", a[0], a[1])
} else {
write!(f, "m128i({:X}, {:X})", a[0], a[1])
}
}
Some(4) => {
let a: [u32; 4] = cast(self.0);
if f.alternate() {
write!(
f,
"m128i({:#X}, {:#X}, {:#X}, {:#X})",
a[0], a[1], a[2], a[3]
)
} else {
write!(f, "m128i({:X}, {:X}, {:X}, {:X})", a[0], a[1], a[2], a[3])
}
}
Some(8) => {
let a: [u16; 8] = cast(self.0);
if f.alternate() {
write!(
f,
"m128i({:#X}, {:#X}, {:#X}, {:#X}, {:#X}, {:#X}, {:#X}, {:#X})",
a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]
)
} else {
write!(
f,
"m128i({:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X})",
a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]
)
}
}
Some(16) => {
let a: [u8; 16] = cast(self.0);
if f.alternate() {
write!(f, "m128i({:#X}, {:#X}, {:#X}, {:#X}, {:#X}, {:#X}, {:#X}, {:#X}, {:#X}, {:#X}, {:#X}, {:#X}, {:#X}, {:#X}, {:#X}, {:#X})", a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15])
} else {
write!(f, "m128i({:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X})", a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15])
}
}
_ => {
let a: u128 = cast(self.0);
if f.alternate() {
write!(f, "m128i({:#X})", a)
} else {
write!(f, "m128i({:X})", a)
}
}
}
}
}
impl BitAnd for m128i {
type Output = Self;
#[inline(always)]
fn bitand(self, rhs: Self) -> Self {
Self(unsafe { _mm_and_si128(self.0, rhs.0) })
}
}
impl BitAndAssign for m128i {
#[inline(always)]
fn bitand_assign(&mut self, rhs: Self) {
self.0 = unsafe { _mm_and_si128(self.0, rhs.0) };
}
}
impl BitOr for m128i {
type Output = Self;
#[inline(always)]
fn bitor(self, rhs: Self) -> Self {
Self(unsafe { _mm_or_si128(self.0, rhs.0) })
}
}
impl BitOrAssign for m128i {
#[inline(always)]
fn bitor_assign(&mut self, rhs: Self) {
self.0 = unsafe { _mm_or_si128(self.0, rhs.0) };
}
}
impl BitXor for m128i {
type Output = Self;
#[inline(always)]
fn bitxor(self, rhs: Self) -> Self {
Self(unsafe { _mm_xor_si128(self.0, rhs.0) })
}
}
impl BitXorAssign for m128i {
#[inline(always)]
fn bitxor_assign(&mut self, rhs: Self) {
self.0 = unsafe { _mm_xor_si128(self.0, rhs.0) };
}
}
impl Not for m128i {
type Output = Self;
fn not(self) -> Self {
let i: i64 = -1;
let b = Self::splat_i64(i);
self ^ b
}
}
impl m128i {
#[inline(always)]
pub fn add_i8(self, rhs: Self) -> Self {
Self(unsafe { _mm_add_epi8(self.0, rhs.0) })
}
#[inline(always)]
pub fn add_i16(self, rhs: Self) -> Self {
Self(unsafe { _mm_add_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn add_i32(self, rhs: Self) -> Self {
Self(unsafe { _mm_add_epi32(self.0, rhs.0) })
}
#[inline(always)]
pub fn add_i64(self, rhs: Self) -> Self {
Self(unsafe { _mm_add_epi64(self.0, rhs.0) })
}
#[inline(always)]
pub fn saturating_add_i8(self, rhs: Self) -> Self {
Self(unsafe { _mm_adds_epi8(self.0, rhs.0) })
}
#[inline(always)]
pub fn saturating_add_i16(self, rhs: Self) -> Self {
Self(unsafe { _mm_adds_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn saturating_add_u8(self, rhs: Self) -> Self {
Self(unsafe { _mm_adds_epu8(self.0, rhs.0) })
}
#[inline(always)]
pub fn saturating_add_u16(self, rhs: Self) -> Self {
Self(unsafe { _mm_adds_epu16(self.0, rhs.0) })
}
#[inline(always)]
pub fn andnot(self, rhs: Self) -> Self {
Self(unsafe { _mm_andnot_si128(self.0, rhs.0) })
}
#[inline(always)]
pub fn average_u8(self, rhs: Self) -> Self {
Self(unsafe { _mm_avg_epu8(self.0, rhs.0) })
}
#[inline(always)]
pub fn average_u16(self, rhs: Self) -> Self {
Self(unsafe { _mm_avg_epu16(self.0, rhs.0) })
}
#[inline(always)]
pub fn cast_m128(self) -> m128 {
m128(unsafe { _mm_castsi128_ps(self.0) })
}
#[inline(always)]
pub fn cmp_eq_i8(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpeq_epi8(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_eq_i16(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpeq_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_eq_i32(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpeq_epi32(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_gt_i8(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpgt_epi8(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_gt_i16(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpgt_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_gt_i32(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpgt_epi32(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_lt_i8(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmplt_epi8(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_lt_i16(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmplt_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_lt_i32(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmplt_epi32(self.0, rhs.0) })
}
#[inline(always)]
pub fn round_low_f64(self) -> m128d {
m128d(unsafe { _mm_cvtepi32_pd(self.0) })
}
#[inline(always)]
pub fn round_f32(self) -> m128 {
m128(unsafe { _mm_cvtepi32_ps(self.0) })
}
#[inline(always)]
pub fn extract0_i32(self) -> i32 {
unsafe { _mm_cvtsi128_si32(self.0) }
}
#[cfg(target_arch = "x86_64")]
#[inline(always)]
pub fn extract0_i64(self) -> i64 {
unsafe { _mm_cvtsi128_si64(self.0) }
}
#[inline(always)]
pub fn set0_i32(val: i32) -> Self {
Self(unsafe { _mm_cvtsi32_si128(val) })
}
#[cfg(target_arch = "x86_64")]
#[inline(always)]
pub fn set0_i64(val: i64) -> Self {
Self(unsafe { _mm_cvtsi64_si128(val) })
}
#[inline(always)]
pub fn load(addr: &Align16<i128>) -> Self {
let ptr: *const __m128i = addr as *const Align16<i128> as *const __m128i;
Self(unsafe { _mm_load_si128(ptr) })
}
#[inline(always)]
pub fn load0_i64(addr: &Align16<i64>) -> Self {
let ptr: *const __m128i = addr as *const Align16<i64> as *const __m128i;
Self(unsafe { _mm_loadl_epi64(ptr) })
}
#[inline(always)]
#[allow(clippy::cast_ptr_alignment)]
pub fn load_unaligned(addr: &[u8; 16]) -> Self {
let ptr: *const __m128i = addr as *const [u8; 16] as *const __m128i;
Self(unsafe { _mm_loadu_si128(ptr) })
}
#[inline(always)]
pub fn mul_i16_hadd(self, rhs: Self) -> Self {
Self(unsafe { _mm_madd_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn max_u8(self, rhs: Self) -> Self {
Self(unsafe { _mm_max_epu8(self.0, rhs.0) })
}
#[inline(always)]
pub fn min_u8(self, rhs: Self) -> Self {
Self(unsafe { _mm_min_epu8(self.0, rhs.0) })
}
#[inline(always)]
pub fn max_i16(self, rhs: Self) -> Self {
Self(unsafe { _mm_max_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn min_i16(self, rhs: Self) -> Self {
Self(unsafe { _mm_min_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn copy0_i64(self) -> Self {
Self(unsafe { _mm_move_epi64(self.0) })
}
#[inline(always)]
pub fn move_mask_i8(self) -> i32 {
unsafe { _mm_movemask_epi8(self.0) }
}
#[inline(always)]
pub fn mul_high_i16(self, rhs: Self) -> Self {
Self(unsafe { _mm_mulhi_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn mul_low_i16(self, rhs: Self) -> Self {
Self(unsafe { _mm_mullo_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn mul_high_u16(self, rhs: Self) -> Self {
Self(unsafe { _mm_mulhi_epu16(self.0, rhs.0) })
}
#[inline(always)]
pub fn half_mul_u32(self, rhs: Self) -> Self {
Self(unsafe { _mm_mul_epu32(self.0, rhs.0) })
}
#[inline(always)]
pub fn pack_i16_saturating_i8(self, rhs: Self) -> Self {
Self(unsafe { _mm_packs_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn pack_i32_saturating_i16(self, rhs: Self) -> Self {
Self(unsafe { _mm_packs_epi32(self.0, rhs.0) })
}
#[inline(always)]
pub fn pack_i16_saturating_u8(self, rhs: Self) -> Self {
Self(unsafe { _mm_packus_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn signed_abs_diff_i8(self, rhs: Self) -> Self {
Self(unsafe { _mm_sad_epu8(self.0, rhs.0) })
}
#[allow(clippy::too_many_arguments)]
#[allow(clippy::many_single_char_names)]
#[inline(always)]
pub fn set_i8(
a: i8,
b: i8,
c: i8,
d: i8,
e: i8,
f: i8,
g: i8,
h: i8,
i: i8,
j: i8,
k: i8,
l: i8,
m: i8,
n: i8,
o: i8,
p: i8,
) -> Self {
Self(unsafe { _mm_set_epi8(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) })
}
#[allow(clippy::too_many_arguments)]
#[allow(clippy::many_single_char_names)]
#[inline(always)]
pub fn set_reverse_i8(
a: i8,
b: i8,
c: i8,
d: i8,
e: i8,
f: i8,
g: i8,
h: i8,
i: i8,
j: i8,
k: i8,
l: i8,
m: i8,
n: i8,
o: i8,
p: i8,
) -> Self {
Self(unsafe { _mm_setr_epi8(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) })
}
#[allow(clippy::too_many_arguments)]
#[allow(clippy::many_single_char_names)]
#[inline(always)]
pub fn set_i16(a: i16, b: i16, c: i16, d: i16, e: i16, f: i16, g: i16, h: i16) -> Self {
Self(unsafe { _mm_set_epi16(a, b, c, d, e, f, g, h) })
}
#[allow(clippy::too_many_arguments)]
#[allow(clippy::many_single_char_names)]
#[inline(always)]
pub fn set_reverse_i16(a: i16, b: i16, c: i16, d: i16, e: i16, f: i16, g: i16, h: i16) -> Self {
Self(unsafe { _mm_setr_epi16(a, b, c, d, e, f, g, h) })
}
#[inline(always)]
pub fn set_i32(a: i32, b: i32, c: i32, d: i32) -> Self {
Self(unsafe { _mm_set_epi32(a, b, c, d) })
}
#[inline(always)]
pub fn set_reverse_i32(a: i32, b: i32, c: i32, d: i32) -> Self {
Self(unsafe { _mm_setr_epi32(a, b, c, d) })
}
#[inline(always)]
pub fn set_i64(a: i64, b: i64) -> Self {
Self(unsafe { _mm_set_epi64x(a, b) })
}
#[inline(always)]
pub fn splat_i8(a: i8) -> Self {
Self(unsafe { _mm_set1_epi8(a) })
}
#[inline(always)]
pub fn splat_i16(a: i16) -> Self {
Self(unsafe { _mm_set1_epi16(a) })
}
#[inline(always)]
pub fn splat_i32(a: i32) -> Self {
Self(unsafe { _mm_set1_epi32(a) })
}
#[inline(always)]
pub fn splat_i64(a: i64) -> Self {
Self(unsafe { _mm_set1_epi64x(a) })
}
#[inline(always)]
pub fn shift_left_i16(self, rhs: Self) -> Self {
Self(unsafe { _mm_sll_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn shift_left_i32(self, rhs: Self) -> Self {
Self(unsafe { _mm_sll_epi32(self.0, rhs.0) })
}
#[inline(always)]
pub fn shift_left_i64(self, rhs: Self) -> Self {
Self(unsafe { _mm_sll_epi64(self.0, rhs.0) })
}
#[inline(always)]
pub fn shift_right_sign_i16(self, rhs: Self) -> Self {
Self(unsafe { _mm_sra_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn shift_right_sign_i32(self, rhs: Self) -> Self {
Self(unsafe { _mm_sra_epi32(self.0, rhs.0) })
}
#[inline(always)]
pub fn shift_right_zero_i16(self, rhs: Self) -> Self {
Self(unsafe { _mm_srl_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn shift_right_zero_i32(self, rhs: Self) -> Self {
Self(unsafe { _mm_srl_epi32(self.0, rhs.0) })
}
#[inline(always)]
pub fn shift_right_zero_i64(self, rhs: Self) -> Self {
Self(unsafe { _mm_srl_epi64(self.0, rhs.0) })
}
#[inline(always)]
pub fn store(self, addr: &mut Align16<i128>) {
let ptr: *mut __m128i = addr as *mut Align16<i128> as *mut __m128i;
unsafe { _mm_store_si128(ptr, self.0) }
}
#[inline(always)]
pub fn store0_i64(self, addr: &mut Align16<i64>) {
let ptr: *mut __m128i = addr as *mut Align16<i64> as *mut __m128i;
unsafe { _mm_storel_epi64(ptr, self.0) }
}
#[inline(always)]
#[allow(clippy::cast_ptr_alignment)]
pub fn store_unaligned(self, addr: &mut [u8; 16]) {
let ptr: *mut __m128i = addr as *mut [u8; 16] as *mut __m128i;
unsafe { _mm_storeu_si128(ptr, self.0) }
}
#[inline(always)]
pub fn sub_i8(self, rhs: Self) -> Self {
Self(unsafe { _mm_sub_epi8(self.0, rhs.0) })
}
#[inline(always)]
pub fn sub_i16(self, rhs: Self) -> Self {
Self(unsafe { _mm_sub_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn sub_i32(self, rhs: Self) -> Self {
Self(unsafe { _mm_sub_epi32(self.0, rhs.0) })
}
#[inline(always)]
pub fn sub_i64(self, rhs: Self) -> Self {
Self(unsafe { _mm_sub_epi64(self.0, rhs.0) })
}
#[inline(always)]
pub fn saturating_sub_i8(self, rhs: Self) -> Self {
Self(unsafe { _mm_subs_epi8(self.0, rhs.0) })
}
#[inline(always)]
pub fn saturating_sub_i16(self, rhs: Self) -> Self {
Self(unsafe { _mm_subs_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn saturating_sub_u8(self, rhs: Self) -> Self {
Self(unsafe { _mm_subs_epu8(self.0, rhs.0) })
}
#[inline(always)]
pub fn saturating_sub_u16(self, rhs: Self) -> Self {
Self(unsafe { _mm_subs_epu16(self.0, rhs.0) })
}
#[inline(always)]
pub fn unpack_high_i8(self, rhs: Self) -> Self {
Self(unsafe { _mm_unpackhi_epi8(self.0, rhs.0) })
}
#[inline(always)]
pub fn unpack_high_i16(self, rhs: Self) -> Self {
Self(unsafe { _mm_unpackhi_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn unpack_high_i32(self, rhs: Self) -> Self {
Self(unsafe { _mm_unpackhi_epi32(self.0, rhs.0) })
}
#[inline(always)]
pub fn unpack_high_i64(self, rhs: Self) -> Self {
Self(unsafe { _mm_unpackhi_epi64(self.0, rhs.0) })
}
#[inline(always)]
pub fn unpack_low_i8(self, rhs: Self) -> Self {
Self(unsafe { _mm_unpacklo_epi8(self.0, rhs.0) })
}
#[inline(always)]
pub fn unpack_low_i16(self, rhs: Self) -> Self {
Self(unsafe { _mm_unpacklo_epi16(self.0, rhs.0) })
}
#[inline(always)]
pub fn unpack_low_i32(self, rhs: Self) -> Self {
Self(unsafe { _mm_unpacklo_epi32(self.0, rhs.0) })
}
#[inline(always)]
pub fn unpack_low_i64(self, rhs: Self) -> Self {
Self(unsafe { _mm_unpacklo_epi64(self.0, rhs.0) })
}
}
#[derive(Clone, Copy)]
#[allow(bad_style)]
#[repr(transparent)]
pub struct m128d(pub __m128d);
unsafe impl Zeroable for m128d {}
unsafe impl Pod for m128d {}
impl core::fmt::Debug for m128d {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
let a: [f64; 2] = cast(self.0);
f.write_str("m128d(")?;
core::fmt::Debug::fmt(&a[0], f)?;
f.write_str(", ")?;
core::fmt::Debug::fmt(&a[1], f)?;
f.write_str(")")
}
}
impl core::fmt::Display for m128d {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
let a: [f64; 2] = cast(self.0);
f.write_str("m128d(")?;
core::fmt::Display::fmt(&a[0], f)?;
f.write_str(", ")?;
core::fmt::Display::fmt(&a[1], f)?;
f.write_str(")")
}
}
impl core::fmt::LowerExp for m128d {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
let a: [f64; 2] = cast(self.0);
f.write_str("m128d(")?;
core::fmt::LowerExp::fmt(&a[0], f)?;
f.write_str(", ")?;
core::fmt::LowerExp::fmt(&a[1], f)?;
f.write_str(")")
}
}
impl core::fmt::UpperExp for m128d {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
let a: [f64; 2] = cast(self.0);
f.write_str("m128d(")?;
core::fmt::UpperExp::fmt(&a[0], f)?;
f.write_str(", ")?;
core::fmt::UpperExp::fmt(&a[1], f)?;
f.write_str(")")
}
}
impl Add for m128d {
type Output = Self;
#[inline(always)]
fn add(self, rhs: Self) -> Self {
Self(unsafe { _mm_add_pd(self.0, rhs.0) })
}
}
impl AddAssign for m128d {
#[inline(always)]
fn add_assign(&mut self, rhs: Self) {
self.0 = unsafe { _mm_add_pd(self.0, rhs.0) };
}
}
impl BitAnd for m128d {
type Output = Self;
#[inline(always)]
fn bitand(self, rhs: Self) -> Self {
Self(unsafe { _mm_and_pd(self.0, rhs.0) })
}
}
impl BitAndAssign for m128d {
#[inline(always)]
fn bitand_assign(&mut self, rhs: Self) {
self.0 = unsafe { _mm_and_pd(self.0, rhs.0) };
}
}
impl Div for m128d {
type Output = Self;
#[inline(always)]
fn div(self, rhs: Self) -> Self {
Self(unsafe { _mm_div_pd(self.0, rhs.0) })
}
}
impl DivAssign for m128d {
#[inline(always)]
fn div_assign(&mut self, rhs: Self) {
self.0 = unsafe { _mm_div_pd(self.0, rhs.0) };
}
}
impl Mul for m128d {
type Output = Self;
#[inline(always)]
fn mul(self, rhs: Self) -> Self {
Self(unsafe { _mm_mul_pd(self.0, rhs.0) })
}
}
impl MulAssign for m128d {
#[inline(always)]
fn mul_assign(&mut self, rhs: Self) {
self.0 = unsafe { _mm_mul_pd(self.0, rhs.0) };
}
}
impl BitOr for m128d {
type Output = Self;
#[inline(always)]
fn bitor(self, rhs: Self) -> Self {
Self(unsafe { _mm_or_pd(self.0, rhs.0) })
}
}
impl BitOrAssign for m128d {
#[inline(always)]
fn bitor_assign(&mut self, rhs: Self) {
self.0 = unsafe { _mm_or_pd(self.0, rhs.0) };
}
}
impl Sub for m128d {
type Output = Self;
#[inline(always)]
fn sub(self, rhs: Self) -> Self {
Self(unsafe { _mm_sub_pd(self.0, rhs.0) })
}
}
impl SubAssign for m128d {
#[inline(always)]
fn sub_assign(&mut self, rhs: Self) {
self.0 = unsafe { _mm_sub_pd(self.0, rhs.0) };
}
}
impl BitXor for m128d {
type Output = Self;
#[inline(always)]
fn bitxor(self, rhs: Self) -> Self {
Self(unsafe { _mm_xor_pd(self.0, rhs.0) })
}
}
impl BitXorAssign for m128d {
#[inline(always)]
fn bitxor_assign(&mut self, rhs: Self) {
self.0 = unsafe { _mm_xor_pd(self.0, rhs.0) };
}
}
impl Neg for m128d {
type Output = Self;
fn neg(self) -> Self {
Self(unsafe { _mm_sub_pd(_mm_setzero_pd(), self.0) })
}
}
impl Not for m128d {
type Output = Self;
fn not(self) -> Self {
let f: f64 = cast(-1_i64);
let b = Self::splat(f);
self ^ b
}
}
impl m128d {
#[inline(always)]
pub fn add0(self, rhs: Self) -> Self {
Self(unsafe { _mm_add_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn andnot(self, rhs: Self) -> Self {
Self(unsafe { _mm_andnot_pd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cast_m128i(self) -> m128i {
m128i(unsafe { _mm_castpd_si128(self.0) })
}
#[inline(always)]
pub fn cmp_eq(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpeq_pd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_eq0(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpeq_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_ge(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpge_pd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_ge0(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpge_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_gt(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpgt_pd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_gt0(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpgt_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_le(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmple_pd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_le0(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmple_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_lt(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmplt_pd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_lt0(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmplt_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_ne(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpneq_pd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_ne0(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpneq_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_nge(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpnge_pd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_nge0(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpnge_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_ngt(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpngt_pd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_ngt0(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpngt_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_nle(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpnle_pd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_nle0(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpnle_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_nlt(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpnlt_pd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_nlt0(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpnlt_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_ordinary(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpord_pd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_ordinary0(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpord_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_nan(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpunord_pd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmp_nan0(self, rhs: Self) -> Self {
Self(unsafe { _mm_cmpunord_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn cmpi_eq0(self, rhs: Self) -> i32 {
unsafe { _mm_comieq_sd(self.0, rhs.0) }
}
#[inline(always)]
pub fn cmpi_ge0(self, rhs: Self) -> i32 {
unsafe { _mm_comige_sd(self.0, rhs.0) }
}
#[inline(always)]
pub fn cmpi_gt0(self, rhs: Self) -> i32 {
unsafe { _mm_comigt_sd(self.0, rhs.0) }
}
#[inline(always)]
pub fn cmpi_le0(self, rhs: Self) -> i32 {
unsafe { _mm_comile_sd(self.0, rhs.0) }
}
#[inline(always)]
pub fn cmpi_lt0(self, rhs: Self) -> i32 {
unsafe { _mm_comilt_sd(self.0, rhs.0) }
}
#[inline(always)]
pub fn cmpi_ne0(self, rhs: Self) -> i32 {
unsafe { _mm_comineq_sd(self.0, rhs.0) }
}
#[inline(always)]
pub fn round_i32x4(self) -> m128i {
m128i(unsafe { _mm_cvtpd_epi32(self.0) })
}
#[inline(always)]
pub fn round_f32x4(self) -> m128 {
m128(unsafe { _mm_cvtpd_ps(self.0) })
}
#[inline(always)]
pub fn extract0(self) -> f64 {
unsafe { _mm_cvtsd_f64(self.0) }
}
#[inline(always)]
pub fn round_i32_extract0(self) -> i32 {
unsafe { _mm_cvtsd_si32(self.0) }
}
#[cfg(target_arch = "x86_64")]
#[inline(always)]
pub fn round_i64_extract0(self) -> i64 {
unsafe { _mm_cvtsd_si64(self.0) }
}
#[inline(always)]
pub fn replace0_with_i32(self, rhs: i32) -> Self {
Self(unsafe { _mm_cvtsi32_sd(self.0, rhs) })
}
#[cfg(target_arch = "x86_64")]
#[inline(always)]
pub fn replace0_with_i64(self, rhs: i64) -> Self {
Self(unsafe { _mm_cvtsi64_sd(self.0, rhs) })
}
#[inline(always)]
pub fn replace0_with_f32(self, rhs: m128) -> Self {
Self(unsafe { _mm_cvtss_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn truncate_i32x4(self) -> m128i {
m128i(unsafe { _mm_cvttpd_epi32(self.0) })
}
#[inline(always)]
pub fn truncate0_i32(self) -> i32 {
unsafe { _mm_cvttsd_si32(self.0) }
}
#[cfg(target_arch = "x86_64")]
#[inline(always)]
pub fn truncate0_i64(self) -> i64 {
unsafe { _mm_cvttsd_si64(self.0) }
}
#[inline(always)]
pub fn div0(self, rhs: Self) -> Self {
Self(unsafe { _mm_div_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn load(addr: &Align16<[f64; 2]>) -> Self {
let ptr: *const f64 = addr as *const Align16<[f64; 2]> as *const f64;
Self(unsafe { _mm_load_pd(ptr) })
}
#[inline(always)]
pub fn load_aligned_splat(addr: &Align16<f64>) -> Self {
let ptr: *const f64 = addr as *const Align16<f64> as *const f64;
Self(unsafe { _mm_load_pd1(ptr) })
}
#[allow(clippy::trivially_copy_pass_by_ref)]
#[inline(always)]
pub fn load0(addr: &f64) -> Self {
Self(unsafe { _mm_load_sd(addr) })
}
#[allow(clippy::trivially_copy_pass_by_ref)]
#[inline(always)]
pub fn replace_high(self, addr: &f64) -> Self {
Self(unsafe { _mm_loadh_pd(self.0, addr) })
}
#[allow(clippy::trivially_copy_pass_by_ref)]
#[inline(always)]
pub fn replace_low(self, addr: &f64) -> Self {
Self(unsafe { _mm_loadl_pd(self.0, addr) })
}
#[inline(always)]
pub fn load_reverse(addr: &Align16<[f64; 2]>) -> Self {
let ptr: *const f64 = addr as *const Align16<[f64; 2]> as *const f64;
Self(unsafe { _mm_loadr_pd(ptr) })
}
#[inline(always)]
pub fn load_unaligned(addr: &[f64; 2]) -> Self {
let ptr: *const f64 = addr as *const [f64; 2] as *const f64;
Self(unsafe { _mm_loadu_pd(ptr) })
}
#[inline(always)]
pub fn max(self, rhs: Self) -> Self {
Self(unsafe { _mm_max_pd(self.0, rhs.0) })
}
#[inline(always)]
pub fn max0(self, rhs: Self) -> Self {
Self(unsafe { _mm_max_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn min(self, rhs: Self) -> Self {
Self(unsafe { _mm_min_pd(self.0, rhs.0) })
}
#[inline(always)]
pub fn min0(self, rhs: Self) -> Self {
Self(unsafe { _mm_min_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn copy0(self, rhs: Self) -> Self {
Self(unsafe { _mm_move_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn move_mask(self) -> i32 {
unsafe { _mm_movemask_pd(self.0) }
}
#[inline(always)]
pub fn mul0(self, rhs: Self) -> Self {
Self(unsafe { _mm_mul_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn set(a: f64, b: f64) -> Self {
Self(unsafe { _mm_set_pd(a, b) })
}
#[inline(always)]
pub fn splat(a: f64) -> Self {
Self(unsafe { _mm_set_pd1(a) })
}
#[inline(always)]
pub fn set0(a: f64) -> Self {
Self(unsafe { _mm_set_sd(a) })
}
#[inline(always)]
pub fn set_reverse(a: f64, b: f64) -> Self {
Self(unsafe { _mm_setr_pd(a, b) })
}
#[inline(always)]
pub fn sqrt(self) -> Self {
Self(unsafe { _mm_sqrt_pd(self.0) })
}
#[inline(always)]
pub fn sqrt_other0(self, rhs: Self) -> Self {
Self(unsafe { _mm_sqrt_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn store(self, addr: &mut Align16<[f64; 2]>) {
let ptr: *mut f64 = addr as *mut Align16<[f64; 2]> as *mut f64;
unsafe { _mm_store_pd(ptr, self.0) }
}
#[inline(always)]
pub fn store0_all(self, addr: &mut Align16<[f64; 2]>) {
let ptr: *mut f64 = addr as *mut Align16<[f64; 2]> as *mut f64;
unsafe { _mm_store_pd1(ptr, self.0) }
}
#[inline(always)]
pub fn store_low(self, addr: &mut f64) {
unsafe { _mm_storel_pd(addr, self.0) }
}
#[inline(always)]
pub fn store_high(self, addr: &mut f64) {
unsafe { _mm_storeh_pd(addr, self.0) }
}
#[inline(always)]
pub fn store_reverse(self, addr: &mut Align16<[f64; 2]>) {
let ptr: *mut f64 = addr as *mut Align16<[f64; 2]> as *mut f64;
unsafe { _mm_storer_pd(ptr, self.0) }
}
#[inline(always)]
pub fn store_unaligned(self, addr: &mut [f64; 2]) {
let ptr: *mut f64 = addr as *mut [f64; 2] as *mut f64;
unsafe { _mm_storeu_pd(ptr, self.0) }
}
#[inline(always)]
pub fn sub0(self, rhs: Self) -> Self {
Self(unsafe { _mm_sub_sd(self.0, rhs.0) })
}
#[inline(always)]
pub fn unpack_high(self, rhs: Self) -> Self {
Self(unsafe { _mm_unpackhi_pd(self.0, rhs.0) })
}
#[inline(always)]
pub fn unpack_low(self, rhs: Self) -> Self {
Self(unsafe { _mm_unpacklo_pd(self.0, rhs.0) })
}
}
pub fn pause() {
unsafe { _mm_pause() }
}
pub fn cache_flush(ptr: *mut impl Sized) {
unsafe { _mm_clflush(ptr as *mut _) }
}
#[macro_export]
macro_rules! shuffle128d {
($a:expr, $b:expr, [$i0a:literal,$i1b:literal]) => {{
const I0A: u32 = $i0a & 0b1;
const I1B: u32 = $i1b & 0b1;
const IMM: i32 = (I0A | I1B << 1) as i32;
#[cfg(target_arch = "x86")]
use core::arch::x86::_mm_shuffle_pd;
#[cfg(target_arch = "x86")]
use $crate::arch::x86::m128d;
#[cfg(target_arch = "x86_64")]
use core::arch::x86_64::_mm_shuffle_pd;
#[cfg(target_arch = "x86_64")]
use $crate::arch::x86_64::m128d;
m128d(unsafe { _mm_shuffle_pd($a.0, $b.0, IMM) })
}};
}