Struct safe_arch::m256

source ·
#[repr(transparent)]
pub struct m256(pub __m256);
Expand description

The data for a 256-bit AVX register of eight f32 lanes.

  • This is very similar to having [f32; 8]. The main difference is that it’s aligned to 32 instead of just 4, and of course you can perform various intrinsic operations on it.

Tuple Fields§

§0: __m256

Implementations§

source§

impl m256

source

pub fn to_array(self) -> [f32; 8]

Transmutes the m256 to an array.

Same as m.into(), just lets you be more explicit about what’s happening.

source

pub fn from_array(f: [f32; 8]) -> Self

Transmutes an array into m256.

Same as m256::from(arr), it just lets you be more explicit about what’s happening.

source

pub fn to_bits(self) -> [u32; 8]

Converts into the bit patterns of these floats ([u32;8]).

Like f32::to_bits, but all eight lanes at once.

source

pub fn from_bits(bits: [u32; 8]) -> Self

Converts from the bit patterns of these floats ([u32;8]).

Like f32::from_bits, but all eight lanes at once.

Trait Implementations§

source§

impl Add<m256> for m256

§

type Output = m256

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl AddAssign<m256> for m256

source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
source§

impl Binary for m256

source§

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

Binary formats each float’s bit pattern (via f32::to_bits).

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

impl BitAnd<m256> for m256

§

type Output = m256

The resulting type after applying the & operator.
source§

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

Performs the & operation. Read more
source§

impl BitAndAssign<m256> for m256

source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
source§

impl BitOr<m256> for m256

§

type Output = m256

The resulting type after applying the | operator.
source§

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

Performs the | operation. Read more
source§

impl BitOrAssign<m256> for m256

source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
source§

impl BitXor<m256> for m256

§

type Output = m256

The resulting type after applying the ^ operator.
source§

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

Performs the ^ operation. Read more
source§

impl BitXorAssign<m256> for m256

source§

fn bitxor_assign(&mut self, rhs: Self)

Performs the ^= operation. Read more
source§

impl Clone for m256

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 m256

source§

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

Debug formats each float.

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

impl Default for m256

source§

fn default() -> Self

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

impl Display for m256

source§

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

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

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

impl Div<m256> for m256

§

type Output = m256

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl DivAssign<m256> for m256

source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
source§

impl From<[f32; 8]> for m256

source§

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

Converts to this type from the input type.
source§

impl From<m256> for [f32; 8]

source§

fn from(m: m256) -> Self

Converts to this type from the input type.
source§

impl LowerExp for m256

source§

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

LowerExp formats each float.

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

impl LowerHex for m256

source§

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

LowerHex formats each float’s bit pattern (via f32::to_bits).

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

impl Mul<m256> for m256

§

type Output = m256

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl MulAssign<m256> for m256

source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
source§

impl Neg for m256

§

type Output = m256

The resulting type after applying the - operator.
source§

fn neg(self) -> Self

Performs the unary - operation. Read more
source§

impl Not for m256

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-ones bit pattern.

§

type Output = m256

The resulting type after applying the ! operator.
source§

impl Octal for m256

source§

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

Octal formats each float’s bit pattern (via f32::to_bits).

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

impl PartialEq<m256> for m256

source§

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

Performs a comparison to get a mask, then moves the mask and checks for all true.

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 Sub<m256> for m256

§

type Output = m256

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl SubAssign<m256> for m256

source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
source§

impl TransparentWrapper<__m256> for m256

source§

fn wrap(s: Inner) -> Selfwhere 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) -> Innerwhere 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 m256

source§

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

UpperExp formats each float.

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

impl UpperHex for m256

source§

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

UpperHex formats each float’s bit pattern (via f32::to_bits).

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

impl Zeroable for m256

source§

fn zeroed() -> Self

source§

impl Copy for m256

source§

impl Pod for m256

Auto Trait Implementations§

§

impl RefUnwindSafe for m256

§

impl Send for m256

§

impl Sync for m256

§

impl Unpin for m256

§

impl UnwindSafe for m256

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> CheckedBitPattern for Twhere 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 Twhere 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 Twhere 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 Twhere 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 Twhere T: Pod,

source§

impl<T> NoUninit for Twhere T: Pod,