Skip to main content

m128

Struct m128 

Source
#[repr(transparent)]
pub struct m128(pub __m128);
Expand description

The data for a 128-bit SSE register of four f32 lanes.

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

Tuple Fields§

§0: __m128

Implementations§

Source§

impl m128

Source

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

Transmutes the m128 to an array.

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

Source

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

Transmutes an array into m128.

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

Source

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

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

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

Source

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

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

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

Trait Implementations§

Source§

impl Add for m128

Source§

type Output = m128

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl AddAssign for m128

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl Binary for m128

Source§

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

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

Source§

impl BitAnd for m128

Source§

type Output = m128

The resulting type after applying the & operator.
Source§

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

Performs the & operation. Read more
Source§

impl BitAndAssign for m128

Source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
Source§

impl BitOr for m128

Source§

type Output = m128

The resulting type after applying the | operator.
Source§

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

Performs the | operation. Read more
Source§

impl BitOrAssign for m128

Source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
Source§

impl BitXor for m128

Source§

type Output = m128

The resulting type after applying the ^ operator.
Source§

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

Performs the ^ operation. Read more
Source§

impl BitXorAssign for m128

Source§

fn bitxor_assign(&mut self, rhs: Self)

Performs the ^= operation. Read more
Source§

impl Clone for m128

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for m128

Source§

impl Debug for m128

Source§

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

Debug formats each float.

Source§

impl Default for m128

Source§

fn default() -> Self

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

impl Display for m128

Source§

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

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

Source§

impl Div for m128

Source§

type Output = m128

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl DivAssign for m128

Source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
Source§

impl From<[f32; 4]> for m128

Source§

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

Converts to this type from the input type.
Source§

impl From<m128> for [f32; 4]

Source§

fn from(m: m128) -> Self

Converts to this type from the input type.
Source§

impl LowerExp for m128

Source§

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

LowerExp formats each float.

Source§

impl LowerHex for m128

Source§

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

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

Source§

impl Mul for m128

Source§

type Output = m128

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl MulAssign for m128

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl Neg for m128

Source§

type Output = m128

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self

Performs the unary - operation. Read more
Source§

impl Not for m128

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.

Source§

type Output = m128

The resulting type after applying the ! operator.
Source§

impl Octal for m128

Source§

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

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

Source§

impl PartialEq for m128

Source§

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

Not a direct intrinsic, this is a cmp_eq_mask and then a move_mask.

1.0.0 (const: unstable) · 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 Pod for m128

Available on crate feature bytemuck only.
Source§

impl Sub for m128

Source§

type Output = m128

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl SubAssign for m128

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl TransparentWrapper<__m128> for m128

Available on crate feature bytemuck only.
Source§

fn wrap(s: Inner) -> Self
where Self: Sized, Inner: 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, Inner: 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, Inner: 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, Inner: 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, Inner: 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, Inner: Sized,

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

impl UpperExp for m128

Source§

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

UpperExp formats each float.

Source§

impl UpperHex for m128

Source§

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

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

Source§

impl Zeroable for m128

Available on crate feature bytemuck only.
Source§

fn zeroed() -> Self

Auto Trait Implementations§

§

impl Freeze for m128

§

impl RefUnwindSafe for m128

§

impl Send for m128

§

impl Sync for m128

§

impl Unpin for m128

§

impl UnsafeUnpin for m128

§

impl UnwindSafe for m128

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> AnyBitPattern for T
where T: Pod,

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,

Source§

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> 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> NoUninit for T
where T: Pod,

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.