Struct safe_arch::m256i

source ·
#[repr(transparent)]
pub struct m256i(pub __m256i);
Expand description

The data for a 256-bit AVX register of integer data.

  • The exact layout to view the type as depends on the operation used.
  • From and Into impls are provided for all the relevant signed integer array types.
  • Formatting impls print as four i32 values just because they have to pick something. If you want an alternative you can turn it into an array and print as you like.

Tuple Fields§

§0: __m256i

Trait Implementations§

source§

impl Binary for m256i

source§

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

Binary formats each i32.

let f = format!("{:b}", m256i::default());
assert_eq!(&f, "(0, 0, 0, 0, 0, 0, 0, 0)");
source§

impl BitAnd for m256i

source§

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

let a = m256i::from([0_i64, 0, 1, 1]);
let b = m256i::from([0_i64, 1, 0, 1]);
let c: [i64; 4] = (a & b).into();
assert_eq!(c, [0_i64, 0, 0, 1]);
§

type Output = m256i

The resulting type after applying the & operator.
source§

impl BitAndAssign for m256i

source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
source§

impl BitOr for m256i

source§

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

let a = m256i::from([0_i64, 0, 1, 1]);
let b = m256i::from([0_i64, 1, 0, 1]);
let c: [i64; 4] = (a | b).into();
assert_eq!(c, [0_i64, 1, 1, 1]);
§

type Output = m256i

The resulting type after applying the | operator.
source§

impl BitOrAssign for m256i

source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
source§

impl BitXor for m256i

source§

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

let a = m256i::from([0_i64, 0, 1, 1]);
let b = m256i::from([0_i64, 1, 0, 1]);
let c: [i64; 4] = (a ^ b).into();
assert_eq!(c, [0_i64, 1, 1, 0]);
§

type Output = m256i

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for m256i

source§

fn bitxor_assign(&mut self, rhs: Self)

Performs the ^= operation. Read more
source§

impl Clone for m256i

source§

fn clone(&self) -> Self

Returns a copy 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 Debug for m256i

source§

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

Debug formats each i32.

let f = format!("{:?}", m256i::default());
assert_eq!(&f, "m256i(0, 0, 0, 0, 0, 0, 0, 0)");
source§

impl Default for m256i

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Display for m256i

source§

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

Display formats each i32, and leaves the type name off of the font.

let f = format!("{}", m256i::default());
assert_eq!(&f, "(0, 0, 0, 0, 0, 0, 0, 0)");
source§

impl From<[i128; 2]> for m256i

source§

fn from(i: [i128; 2]) -> Self

Converts to this type from the input type.
source§

impl From<[i16; 16]> for m256i

source§

fn from(arr: [i16; 16]) -> Self

Converts to this type from the input type.
source§

impl From<[i32; 8]> for m256i

source§

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

Converts to this type from the input type.
source§

impl From<[i64; 4]> for m256i

source§

fn from(arr: [i64; 4]) -> Self

Converts to this type from the input type.
source§

impl From<[i8; 32]> for m256i

source§

fn from(arr: [i8; 32]) -> Self

Converts to this type from the input type.
source§

impl From<[u128; 2]> for m256i

source§

fn from(u: [u128; 2]) -> Self

Converts to this type from the input type.
source§

impl From<[u16; 16]> for m256i

source§

fn from(arr: [u16; 16]) -> Self

Converts to this type from the input type.
source§

impl From<[u32; 8]> for m256i

source§

fn from(arr: [u32; 8]) -> Self

Converts to this type from the input type.
source§

impl From<[u64; 4]> for m256i

source§

fn from(arr: [u64; 4]) -> Self

Converts to this type from the input type.
source§

impl From<[u8; 32]> for m256i

source§

fn from(arr: [u8; 32]) -> Self

Converts to this type from the input type.
source§

impl From<m256i> for [i128; 2]

source§

fn from(m: m256i) -> Self

Converts to this type from the input type.
source§

impl From<m256i> for [i16; 16]

source§

fn from(m: m256i) -> Self

Converts to this type from the input type.
source§

impl From<m256i> for [i32; 8]

source§

fn from(m: m256i) -> Self

Converts to this type from the input type.
source§

impl From<m256i> for [i64; 4]

source§

fn from(m: m256i) -> Self

Converts to this type from the input type.
source§

impl From<m256i> for [i8; 32]

source§

fn from(m: m256i) -> Self

Converts to this type from the input type.
source§

impl From<m256i> for [u128; 2]

source§

fn from(m: m256i) -> Self

Converts to this type from the input type.
source§

impl From<m256i> for [u16; 16]

source§

fn from(m: m256i) -> Self

Converts to this type from the input type.
source§

impl From<m256i> for [u32; 8]

source§

fn from(m: m256i) -> Self

Converts to this type from the input type.
source§

impl From<m256i> for [u64; 4]

source§

fn from(m: m256i) -> Self

Converts to this type from the input type.
source§

impl From<m256i> for [u8; 32]

source§

fn from(m: m256i) -> Self

Converts to this type from the input type.
source§

impl LowerExp for m256i

source§

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

LowerExp formats each i32.

let f = format!("{:e}", m256i::default());
assert_eq!(&f, "(0e0, 0e0, 0e0, 0e0, 0e0, 0e0, 0e0, 0e0)");
source§

impl LowerHex for m256i

source§

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

LowerHex formats each i32.

let f = format!("{:x}", m256i::default());
assert_eq!(&f, "(0, 0, 0, 0, 0, 0, 0, 0)");
source§

impl Not for m256i

source§

fn not(self) -> Self

Not a direct intrinsic, but it’s very useful and the implementation is simple enough.

Negates the bits by performing an xor with an all-1s bit pattern.

let a = m256i::from([0_u128, 0]);
let c: [u128; 2] = (!a).into();
assert_eq!(c, [u128::MAX, u128::MAX]);
§

type Output = m256i

The resulting type after applying the ! operator.
source§

impl Octal for m256i

source§

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

Octal formats each i32.

let f = format!("{:o}", m256i::default());
assert_eq!(&f, "(0, 0, 0, 0, 0, 0, 0, 0)");
source§

impl PartialEq for m256i

source§

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

let a = m256i::from([0_i64, 0, 1, 1]);
let b = m256i::from([0_i64, 1, 0, 1]);
assert_eq!(a, a);
assert_ne!(a, b);
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TransparentWrapper<__m256i> for m256i

source§

fn wrap(s: Inner) -> Self
where Self: Sized,

Convert the inner type into the wrapper type.
source§

fn wrap_ref(s: &Inner) -> &Self

Convert a reference to the inner type into a reference to the wrapper type.
source§

fn wrap_mut(s: &mut Inner) -> &mut Self

Convert a mutable reference to the inner type into a mutable reference to the wrapper type.
source§

fn wrap_slice(s: &[Inner]) -> &[Self]
where Self: Sized,

Convert a slice to the inner type into a slice to the wrapper type.
source§

fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]
where Self: Sized,

Convert a mutable slice to the inner type into a mutable slice to the wrapper type.
source§

fn peel(s: Self) -> Inner
where Self: Sized,

Convert the wrapper type into the inner type.
source§

fn peel_ref(s: &Self) -> &Inner

Convert a reference to the wrapper type into a reference to the inner type.
source§

fn peel_mut(s: &mut Self) -> &mut Inner

Convert a mutable reference to the wrapper type into a mutable reference to the inner type.
source§

fn peel_slice(s: &[Self]) -> &[Inner]
where Self: Sized,

Convert a slice to the wrapped type into a slice to the inner type.
source§

fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]
where Self: Sized,

Convert a mutable slice to the wrapped type into a mutable slice to the inner type.
source§

impl UpperExp for m256i

source§

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

UpperExp formats each i32.

let f = format!("{:E}", m256i::default());
assert_eq!(&f, "(0E0, 0E0, 0E0, 0E0, 0E0, 0E0, 0E0, 0E0)");
source§

impl UpperHex for m256i

source§

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

UpperHex formats each i32.

let f = format!("{:X}", m256i::default());
assert_eq!(&f, "(0, 0, 0, 0, 0, 0, 0, 0)");
source§

impl Zeroable for m256i

source§

fn zeroed() -> Self

source§

impl Copy for m256i

source§

impl Eq for m256i

source§

impl Pod for m256i

Auto Trait Implementations§

§

impl Freeze for m256i

§

impl RefUnwindSafe for m256i

§

impl Send for m256i

§

impl Sync for m256i

§

impl Unpin for m256i

§

impl UnwindSafe for m256i

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
source§

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.
source§

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.
source§

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

source§

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