Skip to main content

Lanes

Trait Lanes 

Source
pub(crate) trait Lanes: Copy {
    type V: Copy;

    // Required methods
    fn splat(self, x: f64) -> Self::V;
    fn load(self, a: [f64; 4]) -> Self::V;
    fn store(self, v: Self::V) -> [f64; 4];
    fn add(self, a: Self::V, b: Self::V) -> Self::V;
    fn sub(self, a: Self::V, b: Self::V) -> Self::V;
    fn mul(self, a: Self::V, b: Self::V) -> Self::V;
    fn mul_add(self, a: Self::V, b: Self::V, c: Self::V) -> Self::V;
    fn neg(self, a: Self::V) -> Self::V;
    fn abs(self, a: Self::V) -> Self::V;
    fn all_finite(self, a: Self::V, b: Self::V) -> bool;
}
Expand description

Four f64 lanes and their arithmetic (invariant L1).

Required Associated Types§

Source

type V: Copy

A quad.

Required Methods§

Source

fn splat(self, x: f64) -> Self::V

(x, x, x, x).

Source

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

The quad with lanes a.

Source

fn store(self, v: Self::V) -> [f64; 4]

The lanes of v.

Source

fn add(self, a: Self::V, b: Self::V) -> Self::V

RN(a + b) on each lane.

Source

fn sub(self, a: Self::V, b: Self::V) -> Self::V

RN(a − b) on each lane.

Source

fn mul(self, a: Self::V, b: Self::V) -> Self::V

RN(a b) on each lane.

Source

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

RN(a b + c) on each lane, fused.

Source

fn neg(self, a: Self::V) -> Self::V

−a on each lane (exact).

Source

fn abs(self, a: Self::V) -> Self::V

|a| on each lane (exact).

Source

fn all_finite(self, a: Self::V, b: Self::V) -> bool

Every lane of a and of b is finite.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<S: Simd> Lanes for X2<S>

Source§

type V = [<S as Simd>::f64s; 2]

Source§

impl<S: Simd> Lanes for X4<S>

Source§

type V = <S as Simd>::f64s