Skip to main content

Vec8

Struct Vec8 

Source
#[repr(C, align(32))]
pub struct Vec8(pub [f32; 8]);
Expand description

An 8-lane SIMD vector of f32 values, backed by AVX2 256-bit registers.

Tuple Fields§

§0: [f32; 8]

Implementations§

Source§

impl Vec8

Source

pub const ZERO: Self

Source

pub const ONE: Self

Source

pub const fn splat(val: f32) -> Self

Creates a vector with all lanes set to val.

Source

pub fn mul_add(self, a: Self, b: Self) -> Self

Computes fused multiply-add: self * a + b per lane.

Source

pub fn sum(self) -> f32

Sums all lanes, returning a scalar.

Source

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

Computes the dot product of two vectors, returning a scalar.

Source

pub fn abs(self) -> Self

Returns the absolute value of each lane.

Source

pub fn sqrt(self) -> Self

Returns the square root of each lane.

Source

pub fn floor(self) -> Self

Returns the floor (round toward negative infinity) of each lane.

Source

pub fn ceil(self) -> Self

Returns the ceil (round toward positive infinity) of each lane.

Source

pub fn round(self) -> Self

Returns the nearest integer (round half away from zero) of each lane.

Source

pub fn sin(self) -> Self

Computes the sine of each lane (radians). SLEEF u10 precision (< 1 ULP).

Source

pub fn cos(self) -> Self

Computes the cosine of each lane (radians). SLEEF u10 precision (< 1 ULP).

Source

pub fn exp(self) -> Self

Computes e^x for each lane. SLEEF precision.

Trait Implementations§

Source§

impl Add<Vec8> for f32

Adds a scalar to each lane of the vector (f32 + Vec8).

Source§

type Output = Vec8

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl Add<f32> for Vec8

Adds a scalar to each lane of the vector.

Source§

type Output = Vec8

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl Add for Vec8

Element-wise addition of two vectors.

Source§

type Output = Vec8

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl Clone for Vec8

Source§

fn clone(&self) -> Vec8

Returns a duplicate 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 Vec8

Formats the vector as Vec8([a, b, c, d, e, f, g, h]) for debug output.

Source§

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

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

impl Div<Vec8> for f32

Divides a scalar by each lane of the vector (f32 / Vec8).

Source§

type Output = Vec8

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl Div<f32> for Vec8

Divides each lane of the vector by a scalar.

Source§

type Output = Vec8

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl Div for Vec8

Element-wise division of two vectors.

Source§

type Output = Vec8

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl From<[f32; 8]> for Vec8

Creates a Vec8 from a [f32; 8] array.

Source§

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

Converts to this type from the input type.
Source§

impl From<Vec8> for [f32; 8]

Extracts the inner [f32; 8] array from a Vec8.

Source§

fn from(v: Vec8) -> Self

Converts to this type from the input type.
Source§

impl Index<usize> for Vec8

Indexes into the vector to retrieve a single f32 lane.

Source§

type Output = f32

The returned type after indexing.
Source§

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

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

impl Mul<Vec8> for f32

Multiplies a scalar by each lane of the vector (f32 * Vec8).

Source§

type Output = Vec8

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul<f32> for Vec8

Multiplies each lane of the vector by a scalar.

Source§

type Output = Vec8

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul for Vec8

Element-wise multiplication of two vectors.

Source§

type Output = Vec8

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Neg for Vec8

Negates each lane of the vector.

Source§

type Output = Vec8

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl PartialEq for Vec8

Compares two vectors for exact element-wise equality.

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 Sub<Vec8> for f32

Subtracts each lane of the vector from a scalar (f32 - Vec8).

Source§

type Output = Vec8

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl Sub<f32> for Vec8

Subtracts a scalar from each lane of the vector.

Source§

type Output = Vec8

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl Sub for Vec8

Element-wise subtraction of two vectors.

Source§

type Output = Vec8

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl Sum for Vec8

Sums an iterator of Vec8 values element-wise, starting from zero.

Source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl Copy for Vec8

Auto Trait Implementations§

§

impl Freeze for Vec8

§

impl RefUnwindSafe for Vec8

§

impl Send for Vec8

§

impl Sync for Vec8

§

impl Unpin for Vec8

§

impl UnsafeUnpin for Vec8

§

impl UnwindSafe for Vec8

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