Skip to main content

Portable

Struct Portable 

Source
pub struct Portable;
Expand description

Lanes as [f64; 4] in ordinary Rust arithmetic.

Available everywhere; on aarch64 the compiler maps the lane loops onto NEON registers. Each method performs exactly the IEEE-754 operation the Simd contract names, lane by lane.

Trait Implementations§

Source§

impl Clone for Portable

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 Portable

Source§

impl Debug for Portable

Source§

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

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

impl Default for Portable

Source§

fn default() -> Self

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

impl Simd for Portable

Source§

type V = [f64; 4]

Four f64 lanes.
Source§

type W = [f64; 8]

Eight f64 lanes for element-wise work: one 512-bit register where the CPU has AVX-512 and the kernel opts in (Kernel::WIDE), two four-lane vectors otherwise. Every operation on them is exact per lane, so the width never changes a result.
Source§

fn splat(self, x: f64) -> [f64; 4]

All lanes x.
Source§

fn load(self, a: &[f64; 4]) -> [f64; 4]

Lanes from an array.
Source§

fn store(self, v: [f64; 4], a: &mut [f64; 4])

Lanes into an array.
Source§

fn to_array(self, v: [f64; 4]) -> [f64; 4]

Lanes as an array.
Source§

fn add(self, a: [f64; 4], b: [f64; 4]) -> [f64; 4]

Lane-wise a + b.
Source§

fn sub(self, a: [f64; 4], b: [f64; 4]) -> [f64; 4]

Lane-wise a - b.
Source§

fn mul(self, a: [f64; 4], b: [f64; 4]) -> [f64; 4]

Lane-wise a * b.
Source§

fn div(self, a: [f64; 4], b: [f64; 4]) -> [f64; 4]

Lane-wise a / b.
Source§

fn sqrt(self, a: [f64; 4]) -> [f64; 4]

Lane-wise square root.
Source§

fn mul_add(self, a: [f64; 4], b: [f64; 4], c: [f64; 4]) -> [f64; 4]

Lane-wise a * b + c with a single rounding.
Source§

fn max(self, a: [f64; 4], b: [f64; 4]) -> [f64; 4]

Lane-wise if a > b { a } else { b }.
Source§

fn min(self, a: [f64; 4], b: [f64; 4]) -> [f64; 4]

Lane-wise if a < b { a } else { b }.
Source§

fn abs(self, a: [f64; 4]) -> [f64; 4]

Lane-wise absolute value (sign bit cleared).
Source§

fn select_positive( self, test: [f64; 4], yes: [f64; 4], no: [f64; 4], ) -> [f64; 4]

Lane-wise if test > 0 { yes } else { no } (NaN takes no).
Source§

fn shift1(self, v: [f64; 4]) -> [f64; 4]

[0, v0, v1, v2]: lanes moved up by one, +0.0 shifted in.
Source§

fn shift2(self, v: [f64; 4]) -> [f64; 4]

[0, 0, v0, v1]: lanes moved up by two, +0.0 shifted in.
Source§

fn broadcast_last(self, v: [f64; 4]) -> [f64; 4]

All lanes the last lane v3.
Source§

fn last_lane(self, v: [f64; 4]) -> f64

The last lane v3 as a scalar.
Source§

fn transpose4( self, a: [f64; 4], b: [f64; 4], c: [f64; 4], d: [f64; 4], ) -> [[f64; 4]; 4]

The 4×4 transpose of the rows a, b, c, d: result j is [a_j, b_j, c_j, d_j]. Pure data movement, so no value changes.
Source§

fn load8(self, a: &[f64; 8]) -> [f64; 8]

Eight lanes from an array.
Source§

fn store8(self, v: [f64; 8], a: &mut [f64; 8])

Eight lanes into an array.
Source§

fn splat8(self, x: f64) -> [f64; 8]

All eight lanes x.
Source§

fn add8(self, a: [f64; 8], b: [f64; 8]) -> [f64; 8]

Lane-wise a + b over eight lanes.
Source§

fn sub8(self, a: [f64; 8], b: [f64; 8]) -> [f64; 8]

Lane-wise a - b over eight lanes.
Source§

fn mul8(self, a: [f64; 8], b: [f64; 8]) -> [f64; 8]

Lane-wise a * b over eight lanes.
Source§

fn div8(self, a: [f64; 8], b: [f64; 8]) -> [f64; 8]

Lane-wise a / b over eight lanes.
Source§

fn sqrt8(self, a: [f64; 8]) -> [f64; 8]

Lane-wise square root over eight lanes.
Source§

fn max8(self, a: [f64; 8], b: [f64; 8]) -> [f64; 8]

Lane-wise if a > b { a } else { b } over eight lanes.
Source§

fn select_positive8( self, test: [f64; 8], yes: [f64; 8], no: [f64; 8], ) -> [f64; 8]

Lane-wise if test > 0 { yes } else { no } over eight lanes (NaN takes no).

Auto Trait Implementations§

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.