Struct i64x2
#[repr(C, align(16))]
pub struct i64x2<S: Simd> { pub simd: S, /* private fields */ }
A SIMD vector of 2 i64 elements.
This type's memory layout is identical to that of [i64; 2], except that it is aligned to 16 bytes.
You may construct this vector type using the Self::splat, Self::from_slice, Self::simd_from, Self::from_fn, and Self::block_splat methods.
# use fearless_simd::{prelude::*, i64x2};
fn construct_simd<S: Simd>(simd: S) {
// From a single scalar value:
let a = i64x2::splat(simd, 1);
let b = i64x2::simd_from(simd, 1);
// From a slice:
let c = i64x2::from_slice(simd, &[1, 2]);
// From an array:
let d = i64x2::simd_from(simd, [1, 2]);
// From an element-wise function:
let e = i64x2::from_fn(simd, |i| i as i64);
}
Fields
simd: S
Trait Implementations
impl<S: Clone + Simd> Clone for i64x2<S>
where
S::i64x2: Clone,
fn clone(&self) -> Self
impl<S: Copy + Simd> Copy for i64x2<S>
where
S::i64x2: Copy,
impl<S: Simd + Debug> Debug for i64x2<S>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<S: Simd> Add for i64x2<S>
type Output = i64x2<S>;fn add(self, rhs: Self) -> Self::OutputAdd two vectors element-wise, wrapping on overflow.
impl<S: Simd> Add<i64> for i64x2<S>
type Output = i64x2<S>;fn add(self, rhs: i64) -> Self::Output
impl<S: Simd> AddAssign for i64x2<S>
fn add_assign(&mut self, rhs: Self)Add two vectors element-wise, wrapping on overflow.
impl<S: Simd> AddAssign<i64> for i64x2<S>
fn add_assign(&mut self, rhs: i64)
impl<S: Simd> BitAnd for i64x2<S>
type Output = i64x2<S>;fn bitand(self, rhs: Self) -> Self::OutputCompute the bitwise AND of two vectors.
impl<S: Simd> BitAnd<i64> for i64x2<S>
type Output = i64x2<S>;fn bitand(self, rhs: i64) -> Self::Output
impl<S: Simd> BitAndAssign for i64x2<S>
fn bitand_assign(&mut self, rhs: Self)Compute the bitwise AND of two vectors.
impl<S: Simd> BitAndAssign<i64> for i64x2<S>
fn bitand_assign(&mut self, rhs: i64)
impl<S: Simd> BitOr for i64x2<S>
type Output = i64x2<S>;fn bitor(self, rhs: Self) -> Self::OutputCompute the bitwise OR of two vectors.
impl<S: Simd> BitOr<i64> for i64x2<S>
type Output = i64x2<S>;fn bitor(self, rhs: i64) -> Self::Output
impl<S: Simd> BitOrAssign for i64x2<S>
fn bitor_assign(&mut self, rhs: Self)Compute the bitwise OR of two vectors.
impl<S: Simd> BitOrAssign<i64> for i64x2<S>
fn bitor_assign(&mut self, rhs: i64)
impl<S: Simd> BitXor for i64x2<S>
type Output = i64x2<S>;fn bitxor(self, rhs: Self) -> Self::OutputCompute the bitwise XOR of two vectors.
impl<S: Simd> BitXor<i64> for i64x2<S>
type Output = i64x2<S>;fn bitxor(self, rhs: i64) -> Self::Output
impl<S: Simd> BitXorAssign for i64x2<S>
fn bitxor_assign(&mut self, rhs: Self)Compute the bitwise XOR of two vectors.
impl<S: Simd> BitXorAssign<i64> for i64x2<S>
fn bitxor_assign(&mut self, rhs: i64)
impl<S: Simd> Bytes for i64x2<S>
type Bytes = u8x16<S>;fn to_bytes(self) -> Self::Bytesfn from_bytes(value: Self::Bytes) -> Self
impl<S: Simd> Deref for i64x2<S>
type Target = [i64; 2];fn deref(&self) -> &Self::Target
impl<S: Simd> DerefMut for i64x2<S>
fn deref_mut(&mut self) -> &mut Self::Target
impl<S: Simd> ExtractToken for i64x2<S>
type S = S;fn token(&self) -> S
impl<S: Simd> Index<usize> for i64x2<S>
type Output = i64;fn index(&self, i: usize) -> &Self::Output
impl<S: Simd> IndexMut<usize> for i64x2<S>
fn index_mut(&mut self, i: usize) -> &mut Self::Output
impl<S: Simd> Mul for i64x2<S>
type Output = i64x2<S>;fn mul(self, rhs: Self) -> Self::OutputMultiply two vectors element-wise, wrapping on overflow.
impl<S: Simd> Mul<i64> for i64x2<S>
type Output = i64x2<S>;fn mul(self, rhs: i64) -> Self::Output
impl<S: Simd> MulAssign for i64x2<S>
fn mul_assign(&mut self, rhs: Self)Multiply two vectors element-wise, wrapping on overflow.
impl<S: Simd> MulAssign<i64> for i64x2<S>
fn mul_assign(&mut self, rhs: i64)
impl<S: Simd> Neg for i64x2<S>
type Output = i64x2<S>;fn neg(self) -> Self::OutputNegate each element of the vector, wrapping on overflow.
impl<S: Simd> Not for i64x2<S>
type Output = i64x2<S>;fn not(self) -> Self::OutputCompute the bitwise NOT of the vector.
impl<S: Simd> Shl for i64x2<S>
type Output = i64x2<S>;fn shl(self, rhs: Self) -> Self::OutputShift each element left by the given number of bits.
Bits shifted out of the left side are discarded, and zeros are shifted in on the right.
When shifting out of bounds (e.g. shifting a 32-bit value by 32 or more), the result is implementation-defined and may vary by platform.
Performance
This per-lane shift is slower than shifting the entire vector by a scalar. It is not vectorized at all on WebAssembly, SSE4.2, and for
u8andi8elements on AVX2. Prefer shifting by a single scalar value instead of by a vector whenever possible.
impl<S: Simd> Shl<u32> for i64x2<S>
type Output = i64x2<S>;fn shl(self, rhs: u32) -> Self::OutputShift each element left by the given number of bits.
Bits shifted out of the left side are discarded, and zeros are shifted in on the right.
When shifting out of bounds (e.g. shifting a 32-bit value by 32 or more), the result is implementation-defined and may vary by platform.
impl<S: Simd> ShlAssign for i64x2<S>
fn shl_assign(&mut self, rhs: Self)Shift each element left by the given number of bits.
Bits shifted out of the left side are discarded, and zeros are shifted in on the right.
When shifting out of bounds (e.g. shifting a 32-bit value by 32 or more), the result is implementation-defined and may vary by platform.
Performance
This per-lane shift is slower than shifting the entire vector by a scalar. It is not vectorized at all on WebAssembly, SSE4.2, and for
u8andi8elements on AVX2. Prefer shifting by a single scalar value instead of by a vector whenever possible.
impl<S: Simd> ShlAssign<u32> for i64x2<S>
fn shl_assign(&mut self, rhs: u32)
impl<S: Simd> Shr for i64x2<S>
type Output = i64x2<S>;fn shr(self, rhs: Self) -> Self::OutputShift each element right by the corresponding element in another vector.
For unsigned integers, zeros are shifted in on the left. For signed integers, the sign bit is replicated.
When shifting out of bounds (e.g. shifting a 32-bit value by 32 or more), the result is implementation-defined and may vary by platform.
Performance
This per-lane shift is slower than shifting the entire vector by a scalar. It is not vectorized at all on WebAssembly, SSE4.2, and for
u8andi8elements on AVX2. Prefer shifting by a single scalar value instead of by a vector whenever possible.
impl<S: Simd> Shr<u32> for i64x2<S>
type Output = i64x2<S>;fn shr(self, rhs: u32) -> Self::OutputShift each element right by the given number of bits.
For unsigned integers, zeros are shifted in on the left. For signed integers, the sign bit is replicated.
When shifting out of bounds (e.g. shifting a 32-bit value by 32 or more), the result is implementation-defined and may vary by platform.
impl<S: Simd> ShrAssign for i64x2<S>
fn shr_assign(&mut self, rhs: Self)Shift each element right by the corresponding element in another vector.
For unsigned integers, zeros are shifted in on the left. For signed integers, the sign bit is replicated.
When shifting out of bounds (e.g. shifting a 32-bit value by 32 or more), the result is implementation-defined and may vary by platform.
Performance
This per-lane shift is slower than shifting the entire vector by a scalar. It is not vectorized at all on WebAssembly, SSE4.2, and for
u8andi8elements on AVX2. Prefer shifting by a single scalar value instead of by a vector whenever possible.
impl<S: Simd> ShrAssign<u32> for i64x2<S>
fn shr_assign(&mut self, rhs: u32)
impl<S: Simd> SimdBase<S> for i64x2<S>
type Element = i64;type ByteVector = u8x16<S>;const LEN: usize = 2;type Mask = mask64x2<S>;type Block = i64x2<S>;type Array = [i64; 2];fn as_slice(&self) -> &[i64]fn as_mut_slice(&mut self) -> &mut [i64]fn from_slice(simd: S, slice: &[i64]) -> Selffn store_slice(&self, slice: &mut [i64])fn splat(simd: S, val: i64) -> Selffn block_splat(block: Self::Block) -> Selffn from_fn(simd: S, f: impl FnMut(usize) -> i64) -> Selffn slide<const SHIFT: usize>(self, rhs: impl SimdInto<Self, S>) -> Selffn slide_within_blocks<const SHIFT: usize>(self, rhs: impl SimdInto<Self, S>) -> Selffn swizzle_dyn_within_blocks(self, indices: impl SimdInto<Self::Bytes, S>) -> Selffn swizzle_dyn(self, indices: impl SimdInto<Self::Bytes, S>) -> Selffn swizzle_dyn_precise(self, indices: impl SimdInto<Self::Bytes, S>) -> Selffn abs(self) -> Selffn reverse(self) -> Selffn concat_swizzle_dyn(self, rhs: impl SimdInto<Self, S>, indices: impl SimdInto<Self::Bytes, S>) -> Selffn concat_swizzle_dyn_precise(self, rhs: impl SimdInto<Self, S>, indices: impl SimdInto<Self::Bytes, S>) -> Selffn compress(self, mask: Self::Mask) -> Selffn compress_merge(self, mask: Self::Mask, merge: impl SimdInto<Self, S>) -> Selffn expand(self, mask: Self::Mask) -> Selffn expand_merge(self, mask: Self::Mask, merge: impl SimdInto<Self, S>) -> Selffn reduce_max(self) -> Self::Elementfn reduce_min(self) -> Self::Elementfn reduce_max_precise(self) -> Self::Elementfn reduce_min_precise(self) -> Self::Elementfn reduce_sum(self) -> Self::Elementfn reduce_product(self) -> Self::Elementfn max(self, rhs: impl SimdInto<Self, S>) -> Selffn min(self, rhs: impl SimdInto<Self, S>) -> Selffn max_precise(self, rhs: impl SimdInto<Self, S>) -> Selffn min_precise(self, rhs: impl SimdInto<Self, S>) -> Selffn clamp(self, min: impl SimdInto<Self, S>, max: impl SimdInto<Self, S>) -> Selffn simd_eq(self, rhs: impl SimdInto<Self, S>) -> Self::Maskfn simd_ne(self, rhs: impl SimdInto<Self, S>) -> Self::Maskfn simd_lt(self, rhs: impl SimdInto<Self, S>) -> Self::Maskfn simd_le(self, rhs: impl SimdInto<Self, S>) -> Self::Maskfn simd_ge(self, rhs: impl SimdInto<Self, S>) -> Self::Maskfn simd_gt(self, rhs: impl SimdInto<Self, S>) -> Self::Maskfn zip_low(self, rhs: impl SimdInto<Self, S>) -> Selffn zip_high(self, rhs: impl SimdInto<Self, S>) -> Selffn unzip_low(self, rhs: impl SimdInto<Self, S>) -> Selffn unzip_high(self, rhs: impl SimdInto<Self, S>) -> Selffn interleave(self, rhs: impl SimdInto<Self, S>) -> (Self, Self)fn deinterleave(self, rhs: impl SimdInto<Self, S>) -> (Self, Self)
impl<S: Simd> SimdCombine<S> for i64x2<S>
type Combined = i64x4<S>;fn combine(self, rhs: impl SimdInto<Self, S>) -> Self::Combined
impl<S: Simd> SimdCvtTruncate<f64x2<S>> for i64x2<S>
fn truncate_from(x: f64x2<S>) -> SelfConvert each floating-point element to a signed 64-bit integer, truncating towards zero.
Out-of-range values or NaN will produce implementation-defined results.
fn truncate_from_precise(x: f64x2<S>) -> SelfConvert each floating-point element to a signed 64-bit integer, truncating towards zero.
Out-of-range values are saturated to the closest in-range value. NaN becomes 0.
impl<S: Simd> SimdFrom<[i64; 2], S> for i64x2<S>
fn simd_from(simd: S, val: [i64; 2]) -> Self
impl<S: Simd> SimdFrom<__m128i, S> for i64x2<S>
fn simd_from(simd: S, arch: __m128i) -> Self
impl<S: Simd> SimdFrom<i64, S> for i64x2<S>
fn simd_from(simd: S, value: i64) -> Self
impl<S: Simd> SimdInt<S> for i64x2<S>
fn count_ones(self) -> Selffn count_zeros(self) -> Selffn saturating_add(self, rhs: impl SimdInto<Self, S>) -> Selffn saturating_sub(self, rhs: impl SimdInto<Self, S>) -> Self
impl<S: Simd> SimdInterleaved<S> for i64x2<S>
fn load_four_interleaved(simd: S, src: &[Self::Element]) -> [Self; 4]fn store_four_interleaved(vectors: [Self; 4], dest: &mut [Self::Element])
impl<S: Simd> SimdNarrow<S> for i64x2<S>
type Narrowed = i32x4<S>;fn narrow(self, high: Self) -> Self::Narrowedfn saturating_narrow(self, high: Self) -> Self::Narrowedfn relaxed_narrow(self, high: Self) -> Self::Narrowed
impl<S: Simd> Sub for i64x2<S>
type Output = i64x2<S>;fn sub(self, rhs: Self) -> Self::OutputSubtract two vectors element-wise, wrapping on overflow.
impl<S: Simd> Sub<i64> for i64x2<S>
type Output = i64x2<S>;fn sub(self, rhs: i64) -> Self::Output
impl<S: Simd> SubAssign for i64x2<S>
fn sub_assign(&mut self, rhs: Self)Subtract two vectors element-wise, wrapping on overflow.
impl<S: Simd> SubAssign<i64> for i64x2<S>
fn sub_assign(&mut self, rhs: i64)