#[repr(simd)]pub struct __m128i(/* private fields */);Expand description
128-bit wide integer vector type, x86-specific
This type is the same as the __m128i type defined by Intel,
representing a 128-bit SIMD register. Usage of this type typically
corresponds to the sse and up target features for x86/x86_64.
Internally this type may be viewed as:
i8x16- sixteeni8variables packed togetheri16x8- eighti16variables packed togetheri32x4- fouri32variables packed togetheri64x2- twoi64variables packed together
(as well as unsigned versions). Each intrinsic may interpret the internal bits differently, check the documentation of the intrinsic to see how it’s being used.
The in-memory representation of this type is the same as the one of an equivalent array (i.e. the in-memory order of elements is the same, and there is no padding); however, the alignment is different and equal to the size of the type. Note that the ABI for function calls may not be the same.
Note that this means that an instance of __m128i typically just means
a “bag of bits” which is left up to interpretation at the point of use.
Most intrinsics using __m128i are prefixed with _mm_ and the
integer types tend to correspond to suffixes like “epi8” or “epi32”.
§Examples
#[cfg(target_arch = "x86")]
use std::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use std::arch::x86_64::*;
let all_bytes_zero = _mm_setzero_si128();
let all_bytes_one = _mm_set1_epi8(1);
let four_i32 = _mm_set_epi32(1, 2, 3, 4);Trait Implementations§
§impl TransparentWrapper<__m128i> for m128i
impl TransparentWrapper<__m128i> for m128i
§fn wrap_ref(s: &Inner) -> &Self
fn wrap_ref(s: &Inner) -> &Self
§fn wrap_mut(s: &mut Inner) -> &mut Self
fn wrap_mut(s: &mut Inner) -> &mut Self
§fn wrap_slice(s: &[Inner]) -> &[Self] ⓘwhere
Self: Sized,
fn wrap_slice(s: &[Inner]) -> &[Self] ⓘwhere
Self: Sized,
§fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self] ⓘwhere
Self: Sized,
fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self] ⓘwhere
Self: Sized,
§fn peel_ref(s: &Self) -> &Inner
fn peel_ref(s: &Self) -> &Inner
§fn peel_mut(s: &mut Self) -> &mut Inner
fn peel_mut(s: &mut Self) -> &mut Inner
§fn peel_slice(s: &[Self]) -> &[Inner] ⓘwhere
Self: Sized,
fn peel_slice(s: &[Self]) -> &[Inner] ⓘwhere
Self: Sized,
§fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner] ⓘwhere
Self: Sized,
fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner] ⓘwhere
Self: Sized,
§impl TransparentWrapper<__m128i> for m128i
impl TransparentWrapper<__m128i> for m128i
§fn wrap_ref(s: &Inner) -> &Self
fn wrap_ref(s: &Inner) -> &Self
§fn wrap_mut(s: &mut Inner) -> &mut Self
fn wrap_mut(s: &mut Inner) -> &mut Self
§fn wrap_slice(s: &[Inner]) -> &[Self] ⓘwhere
Self: Sized,
fn wrap_slice(s: &[Inner]) -> &[Self] ⓘwhere
Self: Sized,
§fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self] ⓘwhere
Self: Sized,
fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self] ⓘwhere
Self: Sized,
§fn peel_ref(s: &Self) -> &Inner
fn peel_ref(s: &Self) -> &Inner
§fn peel_mut(s: &mut Self) -> &mut Inner
fn peel_mut(s: &mut Self) -> &mut Inner
§fn peel_slice(s: &[Self]) -> &[Inner] ⓘwhere
Self: Sized,
fn peel_slice(s: &[Self]) -> &[Inner] ⓘwhere
Self: Sized,
§fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner] ⓘwhere
Self: Sized,
fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner] ⓘwhere
Self: Sized,
impl Copy for __m128i
impl Pod for __m128i
Auto Trait Implementations§
impl Freeze for __m128i
impl RefUnwindSafe for __m128i
impl Send for __m128i
impl Sync for __m128i
impl Unpin for __m128i
impl UnwindSafe for __m128i
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ByteSized for T
impl<T> ByteSized for T
Source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Source§fn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Source§fn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Source§impl<T, R> Chain<R> for Twhere
T: ?Sized,
impl<T, R> Chain<R> for Twhere
T: ?Sized,
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
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
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ExtAny for T
impl<T> ExtAny for T
Source§fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId of Self using a custom hasher.Source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Source§impl<T> ExtMem for Twhere
T: ?Sized,
impl<T> ExtMem for Twhere
T: ?Sized,
Source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Source§fn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Source§fn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Source§fn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Source§fn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true if dropping values of this type matters. Read moreSource§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self without running its destructor. Read moreSource§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Source§unsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSource§unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSource§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
unsafe_slice only.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Hook for T
impl<T> Hook for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more