Skip to main content

Simd

Struct Simd 

Source
#[repr(C)]
pub struct Simd<T, const LANES: usize, const N: usize>(pub [T; LANES]);

Tuple Fields§

§0: [T; LANES]

Implementations§

Source§

impl<T: Copy> Simd<T, 1, 1>

Source

pub fn with_x(x: T) -> Self

Source

pub fn x(&self) -> T

Source

pub unsafe fn x_unchecked(&self) -> &T

Source

pub fn set_x(&mut self, val: T)

Source

pub fn r(&self) -> T

Source

pub unsafe fn r_unchecked(&self) -> &T

Source

pub fn set_r(&mut self, val: T)

Source§

impl<T: Copy> Simd<T, 2, 2>

Source

pub const fn with_xy(x: T, y: T) -> Self

Source

pub fn with_rg(r: T, g: T) -> Self

Source

pub fn x(&self) -> T

Source

pub unsafe fn x_unchecked(&self) -> &T

Source

pub fn set_x(&mut self, val: T)

Source

pub fn r(&self) -> T

Source

pub unsafe fn r_unchecked(&self) -> &T

Source

pub fn set_r(&mut self, val: T)

Source

pub fn y(&self) -> T

Source

pub unsafe fn y_unchecked(&self) -> &T

Source

pub fn set_y(&mut self, val: T)

Source

pub fn g(&self) -> T

Source

pub unsafe fn g_unchecked(&self) -> &T

Source

pub fn set_g(&mut self, val: T)

Source

pub fn xy(&self) -> Simd<T, 2, 2>

Source

pub fn load(vals: &[T; 2]) -> Self

Source§

impl<T: Default + Copy> Simd<T, 4, 3>

Source

pub fn with_xyz(x: T, y: T, z: T) -> Self

Source

pub fn with_rgb(r: T, g: T, b: T) -> Self

Source

pub fn x(&self) -> T

Source

pub unsafe fn x_unchecked(&self) -> &T

Source

pub fn set_x(&mut self, val: T)

Source

pub fn r(&self) -> T

Source

pub unsafe fn r_unchecked(&self) -> &T

Source

pub fn set_r(&mut self, val: T)

Source

pub fn y(&self) -> T

Source

pub unsafe fn y_unchecked(&self) -> &T

Source

pub fn set_y(&mut self, val: T)

Source

pub fn g(&self) -> T

Source

pub unsafe fn g_unchecked(&self) -> &T

Source

pub fn set_g(&mut self, val: T)

Source

pub fn xy(&self) -> Simd<T, 2, 2>

Source

pub fn z(&self) -> T

Source

pub unsafe fn z_unchecked(&self) -> &T

Source

pub fn set_z(&mut self, val: T)

Source

pub fn b(&self) -> T

Source

pub unsafe fn b_unchecked(&self) -> &T

Source

pub fn set_b(&mut self, val: T)

Source

pub fn xyz(&self) -> Simd<T, 3, 3>

Source§

impl Simd<f32, 4, 3>

Source

pub const fn with_xyz_f32(x: f32, y: f32, z: f32) -> Self

Source

pub const fn with_rgb_f32(r: f32, g: f32, b: f32) -> Self

Source

pub fn dot(&self, other: &Self) -> f32

Source

pub fn fmla(&self, n: &Self, m: &Self) -> Self

Source§

impl<T: Copy> Simd<T, 4, 4>

Source

pub const fn with_xyzw(x: T, y: T, z: T, w: T) -> Self

Source

pub const fn with_rgba(r: T, g: T, b: T, a: T) -> Self

Source

pub fn x(&self) -> T

Source

pub unsafe fn x_unchecked(&self) -> &T

Source

pub fn set_x(&mut self, val: T)

Source

pub fn r(&self) -> T

Source

pub unsafe fn r_unchecked(&self) -> &T

Source

pub fn set_r(&mut self, val: T)

Source

pub fn y(&self) -> T

Source

pub unsafe fn y_unchecked(&self) -> &T

Source

pub fn set_y(&mut self, val: T)

Source

pub fn g(&self) -> T

Source

pub unsafe fn g_unchecked(&self) -> &T

Source

pub fn set_g(&mut self, val: T)

Source

pub fn xy(&self) -> Simd<T, 2, 2>

Source

pub fn z(&self) -> T

Source

pub unsafe fn z_unchecked(&self) -> &T

Source

pub fn set_z(&mut self, val: T)

Source

pub fn b(&self) -> T

Source

pub unsafe fn b_unchecked(&self) -> &T

Source

pub fn set_b(&mut self, val: T)

Source

pub fn xyz(&self) -> Simd<T, 3, 3>

Source

pub fn w(&self) -> T

Source

pub unsafe fn w_unchecked(&self) -> &T

Source

pub fn set_w(&mut self, val: T)

Source

pub fn a(&self) -> T

Source

pub unsafe fn a_unchecked(&self) -> &T

Source

pub fn set_a(&mut self, val: T)

Source

pub fn load(vals: &[T; 4]) -> Self

Source§

impl Simd<f32, 4, 4>

Source

pub const fn with_xyzw_f32(x: f32, y: f32, z: f32, w: f32) -> Self

Source

pub const fn with_rgba_f32(r: f32, g: f32, b: f32, a: f32) -> Self

Source

pub fn with_xyz(xyz: &f32x3, w: f32) -> Self

Source

pub fn dot(&self, other: &Self) -> f32

Source

pub fn fmla(&self, n: &Self, m: &Self) -> Self

Source

pub fn mul_f32(&self, val: f32) -> Self

Source

pub fn div_f32(&self, val: f32) -> Self

Source§

impl Simd<f16, 4, 4>

Source

pub const fn with_xyzw_f16(x: f16, y: f16, z: f16, w: f16) -> Self

Source

pub const fn with_rgba_f16(r: f16, g: f16, b: f16, a: f16) -> Self

Trait Implementations§

Source§

impl<T: Clone, const LANES: usize, const N: usize> Clone for Simd<T, LANES, N>

Source§

fn clone(&self) -> Simd<T, LANES, N>

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<T: Copy, const LANES: usize, const N: usize> Copy for Simd<T, LANES, N>

Source§

impl<T: Debug, const LANES: usize, const N: usize> Debug for Simd<T, LANES, N>

Source§

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

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

impl<T: Default + Copy, const LANES: usize, const N: usize> Default for Simd<T, LANES, N>

Source§

fn default() -> Self

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

impl<T: Eq, const LANES: usize, const N: usize> Eq for Simd<T, LANES, N>

Source§

impl<T: Hash, const LANES: usize, const N: usize> Hash for Simd<T, LANES, N>

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<T, const LANES: usize, const N: usize> Index<usize> for Simd<T, LANES, N>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<T, const LANES: usize, const N: usize> IndexMut<usize> for Simd<T, LANES, N>

Source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<T: PartialEq, const LANES: usize, const N: usize> PartialEq for Simd<T, LANES, N>

Source§

fn eq(&self, other: &Simd<T, LANES, N>) -> bool

Tests for self and other values to be equal, and is used by ==.
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<T: PartialEq, const LANES: usize, const N: usize> StructuralPartialEq for Simd<T, LANES, N>

Auto Trait Implementations§

§

impl<T, const LANES: usize, const N: usize> Freeze for Simd<T, LANES, N>
where T: Freeze,

§

impl<T, const LANES: usize, const N: usize> RefUnwindSafe for Simd<T, LANES, N>
where T: RefUnwindSafe,

§

impl<T, const LANES: usize, const N: usize> Send for Simd<T, LANES, N>
where T: Send,

§

impl<T, const LANES: usize, const N: usize> Sync for Simd<T, LANES, N>
where T: Sync,

§

impl<T, const LANES: usize, const N: usize> Unpin for Simd<T, LANES, N>
where T: Unpin,

§

impl<T, const LANES: usize, const N: usize> UnsafeUnpin for Simd<T, LANES, N>
where T: UnsafeUnpin,

§

impl<T, const LANES: usize, const N: usize> UnwindSafe for Simd<T, LANES, N>
where T: UnwindSafe,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.