pub struct I64x2(/* private fields */);Expand description
[i64; 2] as a vector.
Implementations§
Source§impl I64x2
impl I64x2
Sourcepub const fn from_array(arr: [i64; 2]) -> Self
pub const fn from_array(arr: [i64; 2]) -> Self
Create a vector from an array.
Unlike the From trait function, the from_array function is const.
§Example
const MY_EXTREMELY_FUN_VALUE: I64x2 = I64x2::from_array([0, 1]);
for (i, value) in MY_EXTREMELY_FUN_VALUE.as_array().iter().copied().enumerate() {
assert_eq!(i as i64, value);
}Trait Implementations§
Source§impl Add for I64x2
impl Add for I64x2
Source§fn add(self, rhs: I64x2) -> I64x2
fn add(self, rhs: I64x2) -> I64x2
Perform a pairwise wrapping_add
§Scalar Equivalent
ⓘ
I64x2::from([
self.as_array()[0].wrapping_add(rhs.as_array()[0]),
self.as_array()[1].wrapping_add(rhs.as_array()[1]),
])§AVX2 Intrinsics Used
_mm_add_epi64PADDQ xmm, xmm
§Neon Intrinsics Used
vaddq_s64- This intrinsic compiles to the following instructions:
Source§impl AddAssign for I64x2
impl AddAssign for I64x2
Source§fn add_assign(&mut self, other: I64x2)
fn add_assign(&mut self, other: I64x2)
Performs the
+= operation. Read moreSource§impl BitAnd for I64x2
impl BitAnd for I64x2
Source§fn bitand(self, rhs: I64x2) -> I64x2
fn bitand(self, rhs: I64x2) -> I64x2
Source§impl BitAndAssign for I64x2
impl BitAndAssign for I64x2
Source§fn bitand_assign(&mut self, other: I64x2)
fn bitand_assign(&mut self, other: I64x2)
Performs the
&= operation. Read moreSource§impl BitOr for I64x2
impl BitOr for I64x2
Source§fn bitor(self, rhs: I64x2) -> I64x2
fn bitor(self, rhs: I64x2) -> I64x2
Source§impl BitOrAssign for I64x2
impl BitOrAssign for I64x2
Source§fn bitor_assign(&mut self, other: I64x2)
fn bitor_assign(&mut self, other: I64x2)
Performs the
|= operation. Read moreSource§impl BitXor for I64x2
impl BitXor for I64x2
Source§fn bitxor(self, rhs: I64x2) -> I64x2
fn bitxor(self, rhs: I64x2) -> I64x2
Source§impl BitXorAssign for I64x2
impl BitXorAssign for I64x2
Source§fn bitxor_assign(&mut self, other: I64x2)
fn bitxor_assign(&mut self, other: I64x2)
Performs the
^= operation. Read moreSource§impl ConditionallySelectable for I64x2
impl ConditionallySelectable for I64x2
Source§fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
Source§fn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
Source§fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
Conditionally swap
self and other if choice == 1; otherwise,
reassign both unto themselves. Read moreSource§impl ConstantTimeEq for I64x2
impl ConstantTimeEq for I64x2
Source§impl<'de> Deserialize<'de> for I64x2
impl<'de> Deserialize<'de> for I64x2
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Distribution<I64x2> for Standard
impl Distribution<I64x2> for Standard
Source§impl ExtendingCast<I16x8> for I64x2
impl ExtendingCast<I16x8> for I64x2
Source§impl ExtendingCast<I32x4> for I64x2
impl ExtendingCast<I32x4> for I64x2
Source§impl ExtendingCast<I8x16> for I64x2
impl ExtendingCast<I8x16> for I64x2
Source§impl From<I64x2> for I64x4
impl From<I64x2> for I64x4
Source§fn from(vector: I64x2) -> I64x4
fn from(vector: I64x2) -> I64x4
Source§impl ShlAssign<u64> for I64x2
impl ShlAssign<u64> for I64x2
Source§fn shl_assign(&mut self, amount: u64)
fn shl_assign(&mut self, amount: u64)
Performs the
<<= operation. Read moreSource§impl ShlAssign for I64x2
impl ShlAssign for I64x2
Source§fn shl_assign(&mut self, amount: I64x2)
fn shl_assign(&mut self, amount: I64x2)
Performs the
<<= operation. Read moreSource§impl Shr<u64> for I64x2
impl Shr<u64> for I64x2
Source§fn shr(self, amount: u64) -> I64x2
fn shr(self, amount: u64) -> I64x2
§Scalar Equivalent:
if amount >= 64 {
let mut out = self.as_array();
for x in out.iter_mut() {
*x = if *x < 0 { -1 } else { 0 };
}
I64x2::from(out)
} else {
I64x2::from([
self.as_array()[0] >> amount,
self.as_array()[1] >> amount,
])
}§Avx2
WARNING: this implementation is a polyfill which executes the scalar implemenation.
Source§impl Shr for I64x2
impl Shr for I64x2
Source§fn shr(self, amount: I64x2) -> I64x2
fn shr(self, amount: I64x2) -> I64x2
§Scalar Equivalent:
let mut out = self.as_array();
for (x, amm) in out.iter_mut().zip(amount.as_array().iter().copied()) {
*x = if (0..64).contains(&amm) {
*x >> amm
} else if *x < 0 {
-1
} else {
0
};
}
I64x2::from(out)§Avx2
WARNING: this implementation is a polyfill which executes the scalar implemenation.
Source§impl ShrAssign<u64> for I64x2
impl ShrAssign<u64> for I64x2
Source§fn shr_assign(&mut self, amount: u64)
fn shr_assign(&mut self, amount: u64)
Performs the
>>= operation. Read moreSource§impl ShrAssign for I64x2
impl ShrAssign for I64x2
Source§fn shr_assign(&mut self, amount: I64x2)
fn shr_assign(&mut self, amount: I64x2)
Performs the
>>= operation. Read moreSource§impl SimdBase for I64x2
impl SimdBase for I64x2
Source§fn set_lo(scalar: i64) -> I64x2
fn set_lo(scalar: i64) -> I64x2
Source§fn broadcast_lo(vector: I64x2) -> I64x2
fn broadcast_lo(vector: I64x2) -> I64x2
Source§fn cmp_eq(&self, other: I64x2) -> I64x2
fn cmp_eq(&self, other: I64x2) -> I64x2
Source§fn and_not(&self, other: I64x2) -> I64x2
fn and_not(&self, other: I64x2) -> I64x2
Source§fn cmp_gt(&self, other: I64x2) -> I64x2
fn cmp_gt(&self, other: I64x2) -> I64x2
Source§fn shift_left<const BITS: usize>(&self) -> I64x2
fn shift_left<const BITS: usize>(&self) -> I64x2
Source§fn shift_right<const BITS: usize>(&self) -> I64x2
fn shift_right<const BITS: usize>(&self) -> I64x2
Source§fn unpack_lo(&self, other: I64x2) -> I64x2
fn unpack_lo(&self, other: I64x2) -> I64x2
Source§fn unpack_hi(&self, other: I64x2) -> I64x2
fn unpack_hi(&self, other: I64x2) -> I64x2
Source§type BroadcastLoInput = I64x2
type BroadcastLoInput = I64x2
A vector of
[Self::Scalar; 128 / (8 * std::mem::size_of::<Self::Scalar>())]Source§impl SimdBase64 for I64x2
impl SimdBase64 for I64x2
Source§impl SimdBaseGatherable<I64x2> for I64x2
§Safety
base does not need to be aligned. Forall i, base + indices[i] must meet
the safety requirements of std::ptr::read_unaligned
impl SimdBaseGatherable<I64x2> for I64x2
§Safety
base does not need to be aligned. Forall i, base + indices[i] must meet
the safety requirements of std::ptr::read_unaligned
Source§unsafe fn gather(base: *const i64, indices: I64x2) -> I64x2
unsafe fn gather(base: *const i64, indices: I64x2) -> I64x2
Source§unsafe fn gather_masked(
base: *const i64,
indices: I64x2,
mask: I64x2,
src: I64x2,
) -> I64x2
unsafe fn gather_masked( base: *const i64, indices: I64x2, mask: I64x2, src: I64x2, ) -> I64x2
§Scalar Equivalent:
I64x2::from([
if ((mask.as_array()[0] as u64) >> 63) == 1 {
base.offset(indices.as_array()[0] as isize).read_unaligned()
} else {
src.as_array()[0]
},
if ((mask.as_array()[1] as u64) >> 63) == 1 {
base.offset(indices.as_array()[1] as isize).read_unaligned()
} else {
src.as_array()[1]
},
])§Avx2
-
VPGATHERQQ xmm, vm64x, xmm
Source§impl SimdBaseGatherable<I64x2> for U64x2
§Safety
base does not need to be aligned. Forall i, base + indices[i] must meet
the safety requirements of std::ptr::read_unaligned
impl SimdBaseGatherable<I64x2> for U64x2
§Safety
base does not need to be aligned. Forall i, base + indices[i] must meet
the safety requirements of std::ptr::read_unaligned
Source§unsafe fn gather(base: *const u64, indices: I64x2) -> U64x2
unsafe fn gather(base: *const u64, indices: I64x2) -> U64x2
Source§unsafe fn gather_masked(
base: *const u64,
indices: I64x2,
mask: U64x2,
src: U64x2,
) -> U64x2
unsafe fn gather_masked( base: *const u64, indices: I64x2, mask: U64x2, src: U64x2, ) -> U64x2
§Scalar Equivalent:
U64x2::from([
if (mask.as_array()[0] >> 63) == 1 {
base.offset(indices.as_array()[0] as isize).read_unaligned()
} else {
src.as_array()[0]
},
if (mask.as_array()[1] >> 63) == 1 {
base.offset(indices.as_array()[1] as isize).read_unaligned()
} else {
src.as_array()[1]
},
])§Avx2
-
VPGATHERQQ xmm, vm64x, xmm
Source§impl SimdBaseGatherable<U64x2> for I64x2
§Safety
base does not need to be aligned. Forall i, base + indices[i] must meet
the safety requirements of std::ptr::read_unaligned
impl SimdBaseGatherable<U64x2> for I64x2
§Safety
base does not need to be aligned. Forall i, base + indices[i] must meet
the safety requirements of std::ptr::read_unaligned
Source§unsafe fn gather(base: *const i64, indices: U64x2) -> I64x2
unsafe fn gather(base: *const i64, indices: U64x2) -> I64x2
Source§unsafe fn gather_masked(
base: *const i64,
indices: U64x2,
mask: I64x2,
src: I64x2,
) -> I64x2
unsafe fn gather_masked( base: *const i64, indices: U64x2, mask: I64x2, src: I64x2, ) -> I64x2
§Scalar Equivalent:
I64x2::from([
if ((mask.as_array()[0] as u64) >> 63) == 1 {
base.offset(indices.as_array()[0] as isize).read_unaligned()
} else {
src.as_array()[0]
},
if ((mask.as_array()[1] as u64) >> 63) == 1 {
base.offset(indices.as_array()[1] as isize).read_unaligned()
} else {
src.as_array()[1]
},
])§Avx2
-
VPGATHERQQ xmm, vm64x, xmm
Source§impl Sub for I64x2
impl Sub for I64x2
Source§fn sub(self, rhs: I64x2) -> I64x2
fn sub(self, rhs: I64x2) -> I64x2
Perform a pairwise wrapping_sub
§Scalar Equivalent
ⓘ
I64x2::from([
self.as_array()[0].wrapping_sub(rhs.as_array()[0]),
self.as_array()[1].wrapping_sub(rhs.as_array()[1]),
])§AVX2 Intrinsics Used
_mm_sub_epi64PSUBQ xmm, xmm
§Neon Intrinsics Used
vsubq_s64- This intrinsic compiles to the following instructions:
Source§impl SubAssign for I64x2
impl SubAssign for I64x2
Source§fn sub_assign(&mut self, other: I64x2)
fn sub_assign(&mut self, other: I64x2)
Performs the
-= operation. Read moreimpl Copy for I64x2
impl Eq for I64x2
impl Pod for I64x2
Auto Trait Implementations§
impl Freeze for I64x2
impl RefUnwindSafe for I64x2
impl Send for I64x2
impl Sync for I64x2
impl Unpin for I64x2
impl UnwindSafe for I64x2
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.