Struct I32x8

Source
pub struct I32x8(/* private fields */);
Expand description

[i32; 8] as a vector.

Implementations§

Source§

impl I32x8

Source

pub const fn from_array(arr: [i32; 8]) -> Self

Create a vector from an array.

Unlike the From trait function, the from_array function is const.

§Example
const MY_EXTREMELY_FUN_VALUE: I32x8 = I32x8::from_array([0, 1, 2, 3, 4, 5, 6, 7]);
for (i, value) in MY_EXTREMELY_FUN_VALUE.as_array().iter().copied().enumerate() {
    assert_eq!(i as i32, value);
}

Trait Implementations§

Source§

impl Add for I32x8

Source§

fn add(self, rhs: I32x8) -> I32x8

Perform a pairwise wrapping_add

§Scalar Equivalent
I32x8::from([
    self.as_array()[0].wrapping_add(rhs.as_array()[0]),
    self.as_array()[1].wrapping_add(rhs.as_array()[1]),
    self.as_array()[2].wrapping_add(rhs.as_array()[2]),
    self.as_array()[3].wrapping_add(rhs.as_array()[3]),
    self.as_array()[4].wrapping_add(rhs.as_array()[4]),
    self.as_array()[5].wrapping_add(rhs.as_array()[5]),
    self.as_array()[6].wrapping_add(rhs.as_array()[6]),
    self.as_array()[7].wrapping_add(rhs.as_array()[7]),
])
§AVX2 Intrinsics Used
§Neon Intrinsics Used
Source§

type Output = I32x8

The resulting type after applying the + operator.
Source§

impl AddAssign for I32x8

Source§

fn add_assign(&mut self, other: I32x8)

Performs the += operation. Read more
Source§

impl AsMut<[i32]> for I32x8

Source§

fn as_mut(&mut self) -> &mut [i32]

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsRef<[i32]> for I32x8

Source§

fn as_ref(&self) -> &[i32]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl BitAnd for I32x8

Source§

fn bitand(self, rhs: I32x8) -> I32x8

Perform a pairwise bitwise and

§Scalar Equivalent
I32x8::from([
    self.as_array()[0] & rhs.as_array()[0],
    self.as_array()[1] & rhs.as_array()[1],
    self.as_array()[2] & rhs.as_array()[2],
    self.as_array()[3] & rhs.as_array()[3],
    self.as_array()[4] & rhs.as_array()[4],
    self.as_array()[5] & rhs.as_array()[5],
    self.as_array()[6] & rhs.as_array()[6],
    self.as_array()[7] & rhs.as_array()[7],
])
§AVX2 Intrinsics Used
§Neon Intrinsics Used
Source§

type Output = I32x8

The resulting type after applying the & operator.
Source§

impl BitAndAssign for I32x8

Source§

fn bitand_assign(&mut self, other: I32x8)

Performs the &= operation. Read more
Source§

impl BitOr for I32x8

Source§

fn bitor(self, rhs: I32x8) -> I32x8

Perform a pairwise bitwise or

§Scalar Equivalent
I32x8::from([
    self.as_array()[0] | rhs.as_array()[0],
    self.as_array()[1] | rhs.as_array()[1],
    self.as_array()[2] | rhs.as_array()[2],
    self.as_array()[3] | rhs.as_array()[3],
    self.as_array()[4] | rhs.as_array()[4],
    self.as_array()[5] | rhs.as_array()[5],
    self.as_array()[6] | rhs.as_array()[6],
    self.as_array()[7] | rhs.as_array()[7],
])
§AVX2 Intrinsics Used
§Neon Intrinsics Used
Source§

type Output = I32x8

The resulting type after applying the | operator.
Source§

impl BitOrAssign for I32x8

Source§

fn bitor_assign(&mut self, other: I32x8)

Performs the |= operation. Read more
Source§

impl BitXor for I32x8

Source§

fn bitxor(self, rhs: I32x8) -> I32x8

Perform a pairwise bitwise xor

§Scalar Equivalent
I32x8::from([
    self.as_array()[0] ^ rhs.as_array()[0],
    self.as_array()[1] ^ rhs.as_array()[1],
    self.as_array()[2] ^ rhs.as_array()[2],
    self.as_array()[3] ^ rhs.as_array()[3],
    self.as_array()[4] ^ rhs.as_array()[4],
    self.as_array()[5] ^ rhs.as_array()[5],
    self.as_array()[6] ^ rhs.as_array()[6],
    self.as_array()[7] ^ rhs.as_array()[7],
])
§AVX2 Intrinsics Used
§Neon Intrinsics Used
Source§

type Output = I32x8

The resulting type after applying the ^ operator.
Source§

impl BitXorAssign for I32x8

Source§

fn bitxor_assign(&mut self, other: I32x8)

Performs the ^= operation. Read more
Source§

impl Clone for I32x8

Source§

fn clone(&self) -> I32x8

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ConditionallySelectable for I32x8

Source§

fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self

Select a or b according to choice. Read more
Source§

fn conditional_assign(&mut self, other: &Self, choice: Choice)

Conditionally assign other to self, according to choice. Read more
Source§

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 more
Source§

impl ConstantTimeEq for I32x8

Source§

fn ct_eq(&self, other: &Self) -> Choice

Determine if two items are equal. Read more
Source§

fn ct_ne(&self, other: &Self) -> Choice

Determine if two items are NOT equal. Read more
Source§

impl Debug for I32x8

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for I32x8

Source§

fn default() -> Self

The zero vector.

Source§

impl<'de> Deserialize<'de> for I32x8

Source§

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<I32x8> for Standard

Source§

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> I32x8

Generate a random value of T, using rng as the source of randomness.
Source§

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
Source§

fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more
Source§

impl ExtendingCast<I16x8> for I32x8

Source§

fn extending_cast_from(vector: I16x8) -> I32x8

§Scalar Equivalent:
I32x8::from([
        i32::from(vector.as_array()[0]),
        i32::from(vector.as_array()[1]),
        i32::from(vector.as_array()[2]),
        i32::from(vector.as_array()[3]),
        i32::from(vector.as_array()[4]),
        i32::from(vector.as_array()[5]),
        i32::from(vector.as_array()[6]),
        i32::from(vector.as_array()[7]),
])
§Avx2
Source§

impl ExtendingCast<I8x16> for I32x8

Source§

fn extending_cast_from(vector: I8x16) -> I32x8

§Scalar Equivalent:
I32x8::from([
        i32::from(vector.as_array()[0]),
        i32::from(vector.as_array()[1]),
        i32::from(vector.as_array()[2]),
        i32::from(vector.as_array()[3]),
        i32::from(vector.as_array()[4]),
        i32::from(vector.as_array()[5]),
        i32::from(vector.as_array()[6]),
        i32::from(vector.as_array()[7]),
])
§Avx2
Source§

impl From<[I32x4; 2]> for I32x8

Source§

fn from(vectors: [I32x4; 2]) -> I32x8

§Scalar Equivalent:
let mut out = [0; 8];
out[0..4].copy_from_slice(&vectors[0].as_array());
out[4..].copy_from_slice(&vectors[1].as_array());
I32x8::from(out)
§Avx2
Source§

impl From<[i32; 8]> for I32x8

Source§

fn from(arr: [i32; 8]) -> I32x8

Converts to this type from the input type.
Source§

impl From<I16x16> for I32x8

Source§

fn from(x: I16x16) -> I32x8

This cast is 100% free. It reinterprets the little-endinan bits of I16x16 as little endian bits of I32x8.

Source§

impl From<I16x8> for I32x8

Source§

fn from(vector: I16x8) -> I32x8

§Scalar Equivalent:
I32x8::from([
        i32::from(vector.as_array()[0]),
        i32::from(vector.as_array()[1]),
        i32::from(vector.as_array()[2]),
        i32::from(vector.as_array()[3]),
        i32::from(vector.as_array()[4]),
        i32::from(vector.as_array()[5]),
        i32::from(vector.as_array()[6]),
        i32::from(vector.as_array()[7]),
])
§Avx2
Source§

impl From<I32x4> for I32x8

Source§

fn from(vector: I32x4) -> I32x8

NOTE: this will zero the upper bits of the destination. Other intrinsics are more effcient, but leave the upper bits undefined. At present, these more effcient intrinsics are not exposed.

§Scalar Equivalent:
let mut out = [0; 8];
out[0..4].copy_from_slice(&vector.as_array());
I32x8::from(out)
§Avx2
Source§

impl From<I32x8> for [I32x4; 2]

Source§

fn from(vector: I32x8) -> [I32x4; 2]

§Scalar Equivalent:
let mut lo = [0; 4];
let mut hi = [0; 4];
lo.copy_from_slice(&vector.as_array()[0..4]);
hi.copy_from_slice(&vector.as_array()[4..]);
[I32x4::from(lo), I32x4::from(hi)]
§Avx2
Source§

impl From<I32x8> for [i32; 8]

Source§

fn from(arr: I32x8) -> [i32; 8]

Converts to this type from the input type.
Source§

impl From<I32x8> for I16x16

Source§

fn from(x: I32x8) -> I16x16

This cast is 100% free. It reinterprets the little-endinan bits of I32x8 as little endian bits of I16x16.

Source§

impl From<I32x8> for I64x4

Source§

fn from(x: I32x8) -> I64x4

This cast is 100% free. It reinterprets the little-endinan bits of I32x8 as little endian bits of I64x4.

Source§

impl From<I32x8> for I8x32

Source§

fn from(x: I32x8) -> I8x32

This cast is 100% free. It reinterprets the little-endinan bits of I32x8 as little endian bits of I8x32.

Source§

impl From<I32x8> for U16x16

Source§

fn from(x: I32x8) -> U16x16

This cast is 100% free. It reinterprets the little-endinan bits of I32x8 as little endian bits of U16x16.

Source§

impl From<I32x8> for U32x8

Source§

fn from(x: I32x8) -> U32x8

This cast is 100% free. It reinterprets the little-endinan bits of I32x8 as little endian bits of U32x8.

Source§

impl From<I32x8> for U64x4

Source§

fn from(x: I32x8) -> U64x4

This cast is 100% free. It reinterprets the little-endinan bits of I32x8 as little endian bits of U64x4.

Source§

impl From<I32x8> for U8x32

Source§

fn from(x: I32x8) -> U8x32

This cast is 100% free. It reinterprets the little-endinan bits of I32x8 as little endian bits of U8x32.

Source§

impl From<I64x4> for I32x8

Source§

fn from(x: I64x4) -> I32x8

This cast is 100% free. It reinterprets the little-endinan bits of I64x4 as little endian bits of I32x8.

Source§

impl From<I8x32> for I32x8

Source§

fn from(x: I8x32) -> I32x8

This cast is 100% free. It reinterprets the little-endinan bits of I8x32 as little endian bits of I32x8.

Source§

impl From<U16x16> for I32x8

Source§

fn from(x: U16x16) -> I32x8

This cast is 100% free. It reinterprets the little-endinan bits of U16x16 as little endian bits of I32x8.

Source§

impl From<U32x8> for I32x8

Source§

fn from(x: U32x8) -> I32x8

This cast is 100% free. It reinterprets the little-endinan bits of U32x8 as little endian bits of I32x8.

Source§

impl From<U64x4> for I32x8

Source§

fn from(x: U64x4) -> I32x8

This cast is 100% free. It reinterprets the little-endinan bits of U64x4 as little endian bits of I32x8.

Source§

impl From<U8x32> for I32x8

Source§

fn from(x: U8x32) -> I32x8

This cast is 100% free. It reinterprets the little-endinan bits of U8x32 as little endian bits of I32x8.

Source§

impl Hash for I32x8

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for I32x8

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for I32x8

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Shl<u64> for I32x8

Source§

fn shl(self, amount: u64) -> I32x8

§Scalar Equivalent:
if amount >= 32 {
    I32x8::ZERO
} else {
    I32x8::from([
        self.as_array()[0] << amount,
        self.as_array()[1] << amount,
        self.as_array()[2] << amount,
        self.as_array()[3] << amount,
        self.as_array()[4] << amount,
        self.as_array()[5] << amount,
        self.as_array()[6] << amount,
        self.as_array()[7] << amount,
    ])
}
§Avx2
Source§

type Output = I32x8

The resulting type after applying the << operator.
Source§

impl Shl for I32x8

Source§

fn shl(self, amount: I32x8) -> I32x8

§Scalar Equivalent:
let mut out = self.as_array();
for (x, amm) in out.iter_mut().zip(amount.as_array().iter().copied()) {
    *x = if (0..32).contains(&amm) {
        *x << amm
    }  else {
        0
    };
}
I32x8::from(out)
§Avx2
Source§

type Output = I32x8

The resulting type after applying the << operator.
Source§

impl ShlAssign<u64> for I32x8

Source§

fn shl_assign(&mut self, amount: u64)

Performs the <<= operation. Read more
Source§

impl ShlAssign for I32x8

Source§

fn shl_assign(&mut self, amount: I32x8)

Performs the <<= operation. Read more
Source§

impl Shr<u64> for I32x8

Source§

fn shr(self, amount: u64) -> I32x8

§Scalar Equivalent:
if amount >= 32 {
    let mut out = self.as_array();
    for x in out.iter_mut() {
        *x = if *x < 0 { -1 } else { 0 };
    }
    I32x8::from(out)
} else {
    I32x8::from([
        self.as_array()[0] >> amount,
        self.as_array()[1] >> amount,
        self.as_array()[2] >> amount,
        self.as_array()[3] >> amount,
        self.as_array()[4] >> amount,
        self.as_array()[5] >> amount,
        self.as_array()[6] >> amount,
        self.as_array()[7] >> amount,
    ])
}
§Avx2
Source§

type Output = I32x8

The resulting type after applying the >> operator.
Source§

impl Shr for I32x8

Source§

fn shr(self, amount: I32x8) -> I32x8

§Scalar Equivalent:
let mut out = self.as_array();
for (x, amm) in out.iter_mut().zip(amount.as_array().iter().copied()) {
    *x = if (0..32).contains(&amm) {
        *x >> amm
    } else if *x < 0 {
        -1
    }  else {
        0
    };
}
I32x8::from(out)
§Avx2
Source§

type Output = I32x8

The resulting type after applying the >> operator.
Source§

impl ShrAssign<u64> for I32x8

Source§

fn shr_assign(&mut self, amount: u64)

Performs the >>= operation. Read more
Source§

impl ShrAssign for I32x8

Source§

fn shr_assign(&mut self, amount: I32x8)

Performs the >>= operation. Read more
Source§

impl SimdBase for I32x8

Source§

fn is_zero(&self) -> bool

§Scalar Equivalent:
self.as_array().iter().all(|x| *x == 0)
§Avx2
Source§

fn set_lo(scalar: i32) -> I32x8

§Scalar Equivalent:
let mut out = [0; 8];
out[0] = scalar;
I32x8::from(out)
§Avx2
Source§

fn extract<const I: usize>(&self) -> i32

§Scalar Equivalent:
self.as_array()[I]
§Avx2
Source§

fn broadcast(scalar: i32) -> I32x8

§Scalar Equivalent:
I32x8::from([scalar; 8])
§Avx2
Source§

fn broadcast_lo(vector: I32x4) -> I32x8

§Scalar Equivalent:
I32x8::from([vector.as_array()[0]; 8])
§Avx2
Source§

fn cmp_eq(&self, other: I32x8) -> I32x8

§Scalar Equivalent:
I32x8::from([
    if self.as_array()[0] == other.as_array()[0] {  -1  } else { 0 },
    if self.as_array()[1] == other.as_array()[1] {  -1  } else { 0 },
    if self.as_array()[2] == other.as_array()[2] {  -1  } else { 0 },
    if self.as_array()[3] == other.as_array()[3] {  -1  } else { 0 },
    if self.as_array()[4] == other.as_array()[4] {  -1  } else { 0 },
    if self.as_array()[5] == other.as_array()[5] {  -1  } else { 0 },
    if self.as_array()[6] == other.as_array()[6] {  -1  } else { 0 },
    if self.as_array()[7] == other.as_array()[7] {  -1  } else { 0 },
])
§Avx2
Source§

fn and_not(&self, other: I32x8) -> I32x8

§Scalar Equivalent:
I32x8::from([
    self.as_array()[0] & (!other.as_array()[0]),
    self.as_array()[1] & (!other.as_array()[1]),
    self.as_array()[2] & (!other.as_array()[2]),
    self.as_array()[3] & (!other.as_array()[3]),
    self.as_array()[4] & (!other.as_array()[4]),
    self.as_array()[5] & (!other.as_array()[5]),
    self.as_array()[6] & (!other.as_array()[6]),
    self.as_array()[7] & (!other.as_array()[7]),
])
§Avx2
Source§

fn cmp_gt(&self, other: I32x8) -> I32x8

§Scalar Equivalent:
I32x8::from([
    if self.as_array()[0] > other.as_array()[0] {  -1  } else { 0 },
    if self.as_array()[1] > other.as_array()[1] {  -1  } else { 0 },
    if self.as_array()[2] > other.as_array()[2] {  -1  } else { 0 },
    if self.as_array()[3] > other.as_array()[3] {  -1  } else { 0 },
    if self.as_array()[4] > other.as_array()[4] {  -1  } else { 0 },
    if self.as_array()[5] > other.as_array()[5] {  -1  } else { 0 },
    if self.as_array()[6] > other.as_array()[6] {  -1  } else { 0 },
    if self.as_array()[7] > other.as_array()[7] {  -1  } else { 0 },
])
§Avx2
Source§

fn shift_left<const BITS: usize>(&self) -> I32x8

§Scalar Equivalent:
let mut out = self.as_array();
for x in out.iter_mut() {
    *x <<= BITS;
}
I32x8::from(out)
§Avx2
Source§

fn shift_right<const BITS: usize>(&self) -> I32x8

§Scalar Equivalent:
let mut out = self.as_array();
for x in out.iter_mut() {
    *x >>= BITS;
}
I32x8::from(out)
§Avx2
Source§

fn unpack_lo(&self, other: I32x8) -> I32x8

§Scalar Equivalent:
I32x8::from([
    // Lane# 0
    self.as_array()[0],
    other.as_array()[0],
    self.as_array()[1],
    other.as_array()[1],
    // Lane# 1
    self.as_array()[4],
    other.as_array()[4],
    self.as_array()[5],
    other.as_array()[5],
])
§Avx2
Source§

fn unpack_hi(&self, other: I32x8) -> I32x8

§Scalar Equivalent:
I32x8::from([
    // Lane# 0
    self.as_array()[2],
    other.as_array()[2],
    self.as_array()[3],
    other.as_array()[3],
    // Lane# 1
    self.as_array()[6],
    other.as_array()[6],
    self.as_array()[7],
    other.as_array()[7],
])
§Avx2
Source§

fn max(&self, other: I32x8) -> I32x8

§Scalar Equivalent:
I32x8::from([
    self.as_array()[0].max(other.as_array()[0]),
    self.as_array()[1].max(other.as_array()[1]),
    self.as_array()[2].max(other.as_array()[2]),
    self.as_array()[3].max(other.as_array()[3]),
    self.as_array()[4].max(other.as_array()[4]),
    self.as_array()[5].max(other.as_array()[5]),
    self.as_array()[6].max(other.as_array()[6]),
    self.as_array()[7].max(other.as_array()[7]),
])
§Avx2
Source§

fn min(&self, other: I32x8) -> I32x8

§Scalar Equivalent:
I32x8::from([
    self.as_array()[0].min(other.as_array()[0]),
    self.as_array()[1].min(other.as_array()[1]),
    self.as_array()[2].min(other.as_array()[2]),
    self.as_array()[3].min(other.as_array()[3]),
    self.as_array()[4].min(other.as_array()[4]),
    self.as_array()[5].min(other.as_array()[5]),
    self.as_array()[6].min(other.as_array()[6]),
    self.as_array()[7].min(other.as_array()[7]),
])
§Avx2
Source§

const LANES: usize = 8usize

The number of elements of this vector.
Source§

const ZERO: Self

A vector where every element is zero.
Source§

type Scalar = i32

The scalar that this value holds.
Source§

type Array = [i32; 8]

The equivalent array type of this vector.
Source§

type Signed = I32x8

The signed version of this vector.
Source§

type Unsigned = U32x8

The unsigned version of this vector.
Source§

type BroadcastLoInput = I32x4

A vector of [Self::Scalar; 128 / (8 * std::mem::size_of::<Self::Scalar>())]
Source§

fn as_array(&self) -> Self::Array

Convert the vector to an array.
Source§

impl SimdBase32 for I32x8

Source§

fn shuffle<const I3: usize, const I2: usize, const I1: usize, const I0: usize>( &self, ) -> I32x8

§Scalar Equivalent:
I32x8::from([
    // 128-bit Lane #0
    self.as_array()[I0 + 0 * 4],
    self.as_array()[I1 + 0 * 4],
    self.as_array()[I2 + 0 * 4],
    self.as_array()[I3 + 0 * 4],
    // 128-bit Lane #1
    self.as_array()[I0 + 1 * 4],
    self.as_array()[I1 + 1 * 4],
    self.as_array()[I2 + 1 * 4],
    self.as_array()[I3 + 1 * 4],
])
§Avx2
Source§

impl SimdBase8x for I32x8

Source§

fn blend<const B7: bool, const B6: bool, const B5: bool, const B4: bool, const B3: bool, const B2: bool, const B1: bool, const B0: bool>( &self, if_true: I32x8, ) -> I32x8

§Scalar Equivalent:
I32x8::from([
        (if B0 { if_true } else { *self }).as_array()[0],
        (if B1 { if_true } else { *self }).as_array()[1],
        (if B2 { if_true } else { *self }).as_array()[2],
        (if B3 { if_true } else { *self }).as_array()[3],
        (if B4 { if_true } else { *self }).as_array()[4],
        (if B5 { if_true } else { *self }).as_array()[5],
        (if B6 { if_true } else { *self }).as_array()[6],
        (if B7 { if_true } else { *self }).as_array()[7],
])
§Avx2
Source§

impl SimdBaseGatherable<I32x8> for I32x8

§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 i32, indices: I32x8) -> I32x8

§Scalar Equivalent:
I32x8::from([
    base.offset(indices.as_array()[0] as isize).read_unaligned(),
    base.offset(indices.as_array()[1] as isize).read_unaligned(),
    base.offset(indices.as_array()[2] as isize).read_unaligned(),
    base.offset(indices.as_array()[3] as isize).read_unaligned(),
    base.offset(indices.as_array()[4] as isize).read_unaligned(),
    base.offset(indices.as_array()[5] as isize).read_unaligned(),
    base.offset(indices.as_array()[6] as isize).read_unaligned(),
    base.offset(indices.as_array()[7] as isize).read_unaligned(),
])
§Avx2
Source§

unsafe fn gather_masked( base: *const i32, indices: I32x8, mask: I32x8, src: I32x8, ) -> I32x8

§Scalar Equivalent:
I32x8::from([
    if ((mask.as_array()[0] as u32) >> 31) == 1 {
        base.offset(indices.as_array()[0] as isize).read_unaligned()
    } else {
        src.as_array()[0]
    },
    if ((mask.as_array()[1] as u32) >> 31) == 1 {
        base.offset(indices.as_array()[1] as isize).read_unaligned()
    } else {
        src.as_array()[1]
    },
    if ((mask.as_array()[2] as u32) >> 31) == 1 {
        base.offset(indices.as_array()[2] as isize).read_unaligned()
    } else {
        src.as_array()[2]
    },
    if ((mask.as_array()[3] as u32) >> 31) == 1 {
        base.offset(indices.as_array()[3] as isize).read_unaligned()
    } else {
        src.as_array()[3]
    },
    if ((mask.as_array()[4] as u32) >> 31) == 1 {
        base.offset(indices.as_array()[4] as isize).read_unaligned()
    } else {
        src.as_array()[4]
    },
    if ((mask.as_array()[5] as u32) >> 31) == 1 {
        base.offset(indices.as_array()[5] as isize).read_unaligned()
    } else {
        src.as_array()[5]
    },
    if ((mask.as_array()[6] as u32) >> 31) == 1 {
        base.offset(indices.as_array()[6] as isize).read_unaligned()
    } else {
        src.as_array()[6]
    },
    if ((mask.as_array()[7] as u32) >> 31) == 1 {
        base.offset(indices.as_array()[7] as isize).read_unaligned()
    } else {
        src.as_array()[7]
    },
])
§Avx2
Source§

impl SimdBaseGatherable<I32x8> for U32x8

§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 u32, indices: I32x8) -> U32x8

§Scalar Equivalent:
U32x8::from([
    base.offset(indices.as_array()[0] as isize).read_unaligned(),
    base.offset(indices.as_array()[1] as isize).read_unaligned(),
    base.offset(indices.as_array()[2] as isize).read_unaligned(),
    base.offset(indices.as_array()[3] as isize).read_unaligned(),
    base.offset(indices.as_array()[4] as isize).read_unaligned(),
    base.offset(indices.as_array()[5] as isize).read_unaligned(),
    base.offset(indices.as_array()[6] as isize).read_unaligned(),
    base.offset(indices.as_array()[7] as isize).read_unaligned(),
])
§Avx2
Source§

unsafe fn gather_masked( base: *const u32, indices: I32x8, mask: U32x8, src: U32x8, ) -> U32x8

§Scalar Equivalent:
U32x8::from([
    if (mask.as_array()[0] >> 31) == 1 {
        base.offset(indices.as_array()[0] as isize).read_unaligned()
    } else {
        src.as_array()[0]
    },
    if (mask.as_array()[1] >> 31) == 1 {
        base.offset(indices.as_array()[1] as isize).read_unaligned()
    } else {
        src.as_array()[1]
    },
    if (mask.as_array()[2] >> 31) == 1 {
        base.offset(indices.as_array()[2] as isize).read_unaligned()
    } else {
        src.as_array()[2]
    },
    if (mask.as_array()[3] >> 31) == 1 {
        base.offset(indices.as_array()[3] as isize).read_unaligned()
    } else {
        src.as_array()[3]
    },
    if (mask.as_array()[4] >> 31) == 1 {
        base.offset(indices.as_array()[4] as isize).read_unaligned()
    } else {
        src.as_array()[4]
    },
    if (mask.as_array()[5] >> 31) == 1 {
        base.offset(indices.as_array()[5] as isize).read_unaligned()
    } else {
        src.as_array()[5]
    },
    if (mask.as_array()[6] >> 31) == 1 {
        base.offset(indices.as_array()[6] as isize).read_unaligned()
    } else {
        src.as_array()[6]
    },
    if (mask.as_array()[7] >> 31) == 1 {
        base.offset(indices.as_array()[7] as isize).read_unaligned()
    } else {
        src.as_array()[7]
    },
])
§Avx2
Source§

impl Sub for I32x8

Source§

fn sub(self, rhs: I32x8) -> I32x8

Perform a pairwise wrapping_sub

§Scalar Equivalent
I32x8::from([
    self.as_array()[0].wrapping_sub(rhs.as_array()[0]),
    self.as_array()[1].wrapping_sub(rhs.as_array()[1]),
    self.as_array()[2].wrapping_sub(rhs.as_array()[2]),
    self.as_array()[3].wrapping_sub(rhs.as_array()[3]),
    self.as_array()[4].wrapping_sub(rhs.as_array()[4]),
    self.as_array()[5].wrapping_sub(rhs.as_array()[5]),
    self.as_array()[6].wrapping_sub(rhs.as_array()[6]),
    self.as_array()[7].wrapping_sub(rhs.as_array()[7]),
])
§AVX2 Intrinsics Used
§Neon Intrinsics Used
Source§

type Output = I32x8

The resulting type after applying the - operator.
Source§

impl SubAssign for I32x8

Source§

fn sub_assign(&mut self, other: I32x8)

Performs the -= operation. Read more
Source§

impl Zeroable for I32x8

§

fn zeroed() -> Self

Source§

impl Copy for I32x8

Source§

impl Eq for I32x8

Source§

impl Pod for I32x8

Auto Trait Implementations§

§

impl Freeze for I32x8

§

impl RefUnwindSafe for I32x8

§

impl Send for I32x8

§

impl Sync for I32x8

§

impl Unpin for I32x8

§

impl UnwindSafe for I32x8

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CheckedBitPattern for T
where T: AnyBitPattern,

§

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

If this function returns true, then it must be valid to reinterpret bits as &Self.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> AnyBitPattern for T
where T: Pod,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> NoUninit for T
where T: Pod,