[][src]Trait simba::simd::SimdValue

pub trait SimdValue: Sized {
    type Element: SimdValue<Element = Self::Element, SimdBool = bool>;
    type SimdBool: SimdBool;
    fn lanes() -> usize;
fn splat(val: Self::Element) -> Self;
fn extract(&self, i: usize) -> Self::Element;
unsafe fn extract_unchecked(&self, i: usize) -> Self::Element;
fn replace(&mut self, i: usize, val: Self::Element);
unsafe fn replace_unchecked(&mut self, i: usize, val: Self::Element);
fn select(self, cond: Self::SimdBool, other: Self) -> Self; fn map_lanes(self, f: impl Fn(Self::Element) -> Self::Element) -> Self
    where
        Self: Clone
, { ... }
fn zip_map_lanes(
        self,
        b: Self,
        f: impl Fn(Self::Element, Self::Element) -> Self::Element
    ) -> Self
    where
        Self: Clone
, { ... } }

Base trait for every SIMD types.

Associated Types

type Element: SimdValue<Element = Self::Element, SimdBool = bool>

The type of the elements of each lane of this SIMD value.

type SimdBool: SimdBool

Type of the result of comparing two SIMD values like self.

Loading content...

Required methods

fn lanes() -> usize

The number of lanes of this SIMD value.

fn splat(val: Self::Element) -> Self

Initializes an SIMD value with each lanes set to val.

fn extract(&self, i: usize) -> Self::Element

Extracts the i-th lane of self.

Panics if i >= Self::lanes().

unsafe fn extract_unchecked(&self, i: usize) -> Self::Element

Extracts the i-th lane of self without bound-checking.

fn replace(&mut self, i: usize, val: Self::Element)

Replaces the i-th lane of self by val.

Panics if i >= Self::lanes().

unsafe fn replace_unchecked(&mut self, i: usize, val: Self::Element)

Replaces the i-th lane of self by val without bound-checking.

fn select(self, cond: Self::SimdBool, other: Self) -> Self

Merges self and other depending on the lanes of cond.

For each lane of cond with bits set to 1, the result's will contain the value of the lane of self. For each lane of cond with bits set to 0, the result's will contain the value of the lane of other.

Loading content...

Provided methods

fn map_lanes(self, f: impl Fn(Self::Element) -> Self::Element) -> Self where
    Self: Clone

Applies a function to each lane of self.

Note that, while convenient, this method can be extremely slow as this requires to extract each lane of self and then combine them again into a new SIMD value.

fn zip_map_lanes(
    self,
    b: Self,
    f: impl Fn(Self::Element, Self::Element) -> Self::Element
) -> Self where
    Self: Clone

Applies a function to each lane of self paired with the corresponding lane of b.

Note that, while convenient, this method can be extremely slow as this requires to extract each lane of self and then combine them again into a new SIMD value.

Loading content...

Implementations on Foreign Types

impl<N: SimdValue> SimdValue for Complex<N>[src]

type Element = Complex<N::Element>

type SimdBool = N::SimdBool

impl SimdValue for bool[src]

type Element = bool

type SimdBool = bool

impl SimdValue for u8[src]

type Element = u8

type SimdBool = bool

impl SimdValue for u16[src]

type Element = u16

type SimdBool = bool

impl SimdValue for u32[src]

type Element = u32

type SimdBool = bool

impl SimdValue for u64[src]

type Element = u64

type SimdBool = bool

impl SimdValue for u128[src]

type Element = u128

type SimdBool = bool

impl SimdValue for usize[src]

type Element = usize

type SimdBool = bool

impl SimdValue for i8[src]

type Element = i8

type SimdBool = bool

impl SimdValue for i16[src]

type Element = i16

type SimdBool = bool

impl SimdValue for i32[src]

type Element = i32

type SimdBool = bool

impl SimdValue for i64[src]

type Element = i64

type SimdBool = bool

impl SimdValue for i128[src]

type Element = i128

type SimdBool = bool

impl SimdValue for isize[src]

type Element = isize

type SimdBool = bool

impl SimdValue for f32[src]

type Element = f32

type SimdBool = bool

impl SimdValue for f64[src]

type Element = f64

type SimdBool = bool

impl SimdValue for d128[src]

type Element = d128

type SimdBool = bool

Loading content...

Implementors

impl SimdValue for AutoSimd<[bool; 1]>[src]

type Element = bool

type SimdBool = AutoSimd<[bool; 1]>

impl SimdValue for AutoSimd<[bool; 2]>[src]

type Element = bool

type SimdBool = AutoSimd<[bool; 2]>

impl SimdValue for AutoSimd<[bool; 4]>[src]

type Element = bool

type SimdBool = AutoSimd<[bool; 4]>

impl SimdValue for AutoSimd<[bool; 8]>[src]

type Element = bool

type SimdBool = AutoSimd<[bool; 8]>

impl SimdValue for AutoSimd<[bool; 16]>[src]

type Element = bool

type SimdBool = AutoSimd<[bool; 16]>

impl SimdValue for AutoSimd<[bool; 32]>[src]

type Element = bool

type SimdBool = AutoSimd<[bool; 32]>

impl SimdValue for AutoSimd<[f32; 2]>[src]

type Element = f32

type SimdBool = AutoBoolx2

impl SimdValue for AutoSimd<[f32; 4]>[src]

type Element = f32

type SimdBool = AutoBoolx4

impl SimdValue for AutoSimd<[f32; 8]>[src]

type Element = f32

type SimdBool = AutoBoolx8

impl SimdValue for AutoSimd<[f32; 16]>[src]

type Element = f32

type SimdBool = AutoBoolx16

impl SimdValue for AutoSimd<[f64; 2]>[src]

type Element = f64

type SimdBool = AutoBoolx2

impl SimdValue for AutoSimd<[f64; 4]>[src]

type Element = f64

type SimdBool = AutoBoolx4

impl SimdValue for AutoSimd<[f64; 8]>[src]

type Element = f64

type SimdBool = AutoBoolx8

impl SimdValue for AutoSimd<[i8; 2]>[src]

type Element = i8

type SimdBool = AutoBoolx2

impl SimdValue for AutoSimd<[i8; 4]>[src]

type Element = i8

type SimdBool = AutoBoolx4

impl SimdValue for AutoSimd<[i8; 8]>[src]

type Element = i8

type SimdBool = AutoBoolx8

impl SimdValue for AutoSimd<[i8; 16]>[src]

type Element = i8

type SimdBool = AutoBoolx16

impl SimdValue for AutoSimd<[i8; 32]>[src]

type Element = i8

type SimdBool = AutoBoolx32

impl SimdValue for AutoSimd<[i16; 2]>[src]

type Element = i16

type SimdBool = AutoBoolx2

impl SimdValue for AutoSimd<[i16; 4]>[src]

type Element = i16

type SimdBool = AutoBoolx4

impl SimdValue for AutoSimd<[i16; 8]>[src]

type Element = i16

type SimdBool = AutoBoolx8

impl SimdValue for AutoSimd<[i16; 16]>[src]

type Element = i16

type SimdBool = AutoBoolx16

impl SimdValue for AutoSimd<[i16; 32]>[src]

type Element = i16

type SimdBool = AutoBoolx32

impl SimdValue for AutoSimd<[i32; 2]>[src]

type Element = i32

type SimdBool = AutoBoolx2

impl SimdValue for AutoSimd<[i32; 4]>[src]

type Element = i32

type SimdBool = AutoBoolx4

impl SimdValue for AutoSimd<[i32; 8]>[src]

type Element = i32

type SimdBool = AutoBoolx8

impl SimdValue for AutoSimd<[i32; 16]>[src]

type Element = i32

type SimdBool = AutoBoolx16

impl SimdValue for AutoSimd<[i64; 2]>[src]

type Element = i64

type SimdBool = AutoBoolx2

impl SimdValue for AutoSimd<[i64; 4]>[src]

type Element = i64

type SimdBool = AutoBoolx4

impl SimdValue for AutoSimd<[i64; 8]>[src]

type Element = i64

type SimdBool = AutoBoolx8

impl SimdValue for AutoSimd<[i128; 1]>[src]

type Element = i128

type SimdBool = AutoBoolx1

impl SimdValue for AutoSimd<[i128; 2]>[src]

type Element = i128

type SimdBool = AutoBoolx2

impl SimdValue for AutoSimd<[i128; 4]>[src]

type Element = i128

type SimdBool = AutoBoolx4

impl SimdValue for AutoSimd<[isize; 2]>[src]

type Element = isize

type SimdBool = AutoBoolx2

impl SimdValue for AutoSimd<[isize; 4]>[src]

type Element = isize

type SimdBool = AutoBoolx4

impl SimdValue for AutoSimd<[isize; 8]>[src]

type Element = isize

type SimdBool = AutoBoolx8

impl SimdValue for AutoSimd<[u8; 2]>[src]

type Element = u8

type SimdBool = AutoBoolx2

impl SimdValue for AutoSimd<[u8; 4]>[src]

type Element = u8

type SimdBool = AutoBoolx4

impl SimdValue for AutoSimd<[u8; 8]>[src]

type Element = u8

type SimdBool = AutoBoolx8

impl SimdValue for AutoSimd<[u8; 16]>[src]

type Element = u8

type SimdBool = AutoBoolx16

impl SimdValue for AutoSimd<[u8; 32]>[src]

type Element = u8

type SimdBool = AutoBoolx32

impl SimdValue for AutoSimd<[u16; 2]>[src]

type Element = u16

type SimdBool = AutoBoolx2

impl SimdValue for AutoSimd<[u16; 4]>[src]

type Element = u16

type SimdBool = AutoBoolx4

impl SimdValue for AutoSimd<[u16; 8]>[src]

type Element = u16

type SimdBool = AutoBoolx8

impl SimdValue for AutoSimd<[u16; 16]>[src]

type Element = u16

type SimdBool = AutoBoolx16

impl SimdValue for AutoSimd<[u16; 32]>[src]

type Element = u16

type SimdBool = AutoBoolx32

impl SimdValue for AutoSimd<[u32; 2]>[src]

type Element = u32

type SimdBool = AutoBoolx2

impl SimdValue for AutoSimd<[u32; 4]>[src]

type Element = u32

type SimdBool = AutoBoolx4

impl SimdValue for AutoSimd<[u32; 8]>[src]

type Element = u32

type SimdBool = AutoBoolx8

impl SimdValue for AutoSimd<[u32; 16]>[src]

type Element = u32

type SimdBool = AutoBoolx16

impl SimdValue for AutoSimd<[u64; 2]>[src]

type Element = u64

type SimdBool = AutoBoolx2

impl SimdValue for AutoSimd<[u64; 4]>[src]

type Element = u64

type SimdBool = AutoBoolx4

impl SimdValue for AutoSimd<[u64; 8]>[src]

type Element = u64

type SimdBool = AutoBoolx8

impl SimdValue for AutoSimd<[u128; 1]>[src]

type Element = u128

type SimdBool = AutoBoolx1

impl SimdValue for AutoSimd<[u128; 2]>[src]

type Element = u128

type SimdBool = AutoBoolx2

impl SimdValue for AutoSimd<[u128; 4]>[src]

type Element = u128

type SimdBool = AutoBoolx4

impl SimdValue for AutoSimd<[usize; 2]>[src]

type Element = usize

type SimdBool = AutoBoolx2

impl SimdValue for AutoSimd<[usize; 4]>[src]

type Element = usize

type SimdBool = AutoBoolx4

impl SimdValue for AutoSimd<[usize; 8]>[src]

type Element = usize

type SimdBool = AutoBoolx8

impl SimdValue for Simd<f32x2>[src]

type Element = f32

type SimdBool = m32x2

impl SimdValue for Simd<f32x4>[src]

type Element = f32

type SimdBool = m32x4

impl SimdValue for Simd<f32x8>[src]

type Element = f32

type SimdBool = m32x8

impl SimdValue for Simd<f32x16>[src]

type Element = f32

type SimdBool = m32x16

impl SimdValue for Simd<f64x2>[src]

type Element = f64

type SimdBool = m64x2

impl SimdValue for Simd<f64x4>[src]

type Element = f64

type SimdBool = m64x4

impl SimdValue for Simd<f64x8>[src]

type Element = f64

type SimdBool = m64x8

impl SimdValue for Simd<i8x2>[src]

type Element = i8

type SimdBool = m8x2

impl SimdValue for Simd<i8x4>[src]

type Element = i8

type SimdBool = m8x4

impl SimdValue for Simd<i8x8>[src]

type Element = i8

type SimdBool = m8x8

impl SimdValue for Simd<i8x16>[src]

type Element = i8

type SimdBool = m8x16

impl SimdValue for Simd<i8x32>[src]

type Element = i8

type SimdBool = m8x32

impl SimdValue for Simd<i8x64>[src]

type Element = i8

type SimdBool = m8x64

impl SimdValue for Simd<i16x2>[src]

type Element = i16

type SimdBool = m16x2

impl SimdValue for Simd<i16x4>[src]

type Element = i16

type SimdBool = m16x4

impl SimdValue for Simd<i16x8>[src]

type Element = i16

type SimdBool = m16x8

impl SimdValue for Simd<i16x16>[src]

type Element = i16

type SimdBool = m16x16

impl SimdValue for Simd<i16x32>[src]

type Element = i16

type SimdBool = m16x32

impl SimdValue for Simd<i32x2>[src]

type Element = i32

type SimdBool = m32x2

impl SimdValue for Simd<i32x4>[src]

type Element = i32

type SimdBool = m32x4

impl SimdValue for Simd<i32x8>[src]

type Element = i32

type SimdBool = m32x8

impl SimdValue for Simd<i32x16>[src]

type Element = i32

type SimdBool = m32x16

impl SimdValue for Simd<i64x2>[src]

type Element = i64

type SimdBool = m64x2

impl SimdValue for Simd<i64x4>[src]

type Element = i64

type SimdBool = m64x4

impl SimdValue for Simd<i64x8>[src]

type Element = i64

type SimdBool = m64x8

impl SimdValue for Simd<i128x1>[src]

type Element = i128

type SimdBool = m128x1

impl SimdValue for Simd<i128x2>[src]

type Element = i128

type SimdBool = m128x2

impl SimdValue for Simd<i128x4>[src]

type Element = i128

type SimdBool = m128x4

impl SimdValue for Simd<isizex2>[src]

type Element = isize

type SimdBool = msizex2

impl SimdValue for Simd<isizex4>[src]

type Element = isize

type SimdBool = msizex4

impl SimdValue for Simd<isizex8>[src]

type Element = isize

type SimdBool = msizex8

impl SimdValue for Simd<m8x2>[src]

type Element = bool

type SimdBool = Simd<m8x2>

impl SimdValue for Simd<m8x4>[src]

type Element = bool

type SimdBool = Simd<m8x4>

impl SimdValue for Simd<m8x8>[src]

type Element = bool

type SimdBool = Simd<m8x8>

impl SimdValue for Simd<m8x16>[src]

type Element = bool

type SimdBool = Simd<m8x16>

impl SimdValue for Simd<m8x32>[src]

type Element = bool

type SimdBool = Simd<m8x32>

impl SimdValue for Simd<m8x64>[src]

type Element = bool

type SimdBool = Simd<m8x64>

impl SimdValue for Simd<m16x2>[src]

type Element = bool

type SimdBool = Simd<m16x2>

impl SimdValue for Simd<m16x4>[src]

type Element = bool

type SimdBool = Simd<m16x4>

impl SimdValue for Simd<m16x8>[src]

type Element = bool

type SimdBool = Simd<m16x8>

impl SimdValue for Simd<m16x16>[src]

type Element = bool

type SimdBool = Simd<m16x16>

impl SimdValue for Simd<m16x32>[src]

type Element = bool

type SimdBool = Simd<m16x32>

impl SimdValue for Simd<m32x2>[src]

type Element = bool

type SimdBool = Simd<m32x2>

impl SimdValue for Simd<m32x4>[src]

type Element = bool

type SimdBool = Simd<m32x4>

impl SimdValue for Simd<m32x8>[src]

type Element = bool

type SimdBool = Simd<m32x8>

impl SimdValue for Simd<m32x16>[src]

type Element = bool

type SimdBool = Simd<m32x16>

impl SimdValue for Simd<m64x2>[src]

type Element = bool

type SimdBool = Simd<m64x2>

impl SimdValue for Simd<m64x4>[src]

type Element = bool

type SimdBool = Simd<m64x4>

impl SimdValue for Simd<m64x8>[src]

type Element = bool

type SimdBool = Simd<m64x8>

impl SimdValue for Simd<m128x1>[src]

type Element = bool

type SimdBool = Simd<m128x1>

impl SimdValue for Simd<m128x2>[src]

type Element = bool

type SimdBool = Simd<m128x2>

impl SimdValue for Simd<m128x4>[src]

type Element = bool

type SimdBool = Simd<m128x4>

impl SimdValue for Simd<msizex2>[src]

type Element = bool

type SimdBool = Simd<msizex2>

impl SimdValue for Simd<msizex4>[src]

type Element = bool

type SimdBool = Simd<msizex4>

impl SimdValue for Simd<msizex8>[src]

type Element = bool

type SimdBool = Simd<msizex8>

impl SimdValue for Simd<u8x2>[src]

type Element = u8

type SimdBool = m8x2

impl SimdValue for Simd<u8x4>[src]

type Element = u8

type SimdBool = m8x4

impl SimdValue for Simd<u8x8>[src]

type Element = u8

type SimdBool = m8x8

impl SimdValue for Simd<u8x16>[src]

type Element = u8

type SimdBool = m8x16

impl SimdValue for Simd<u8x32>[src]

type Element = u8

type SimdBool = m8x32

impl SimdValue for Simd<u8x64>[src]

type Element = u8

type SimdBool = m8x64

impl SimdValue for Simd<u16x2>[src]

type Element = u16

type SimdBool = m16x2

impl SimdValue for Simd<u16x4>[src]

type Element = u16

type SimdBool = m16x4

impl SimdValue for Simd<u16x8>[src]

type Element = u16

type SimdBool = m16x8

impl SimdValue for Simd<u16x16>[src]

type Element = u16

type SimdBool = m16x16

impl SimdValue for Simd<u16x32>[src]

type Element = u16

type SimdBool = m16x32

impl SimdValue for Simd<u32x2>[src]

type Element = u32

type SimdBool = m32x2

impl SimdValue for Simd<u32x4>[src]

type Element = u32

type SimdBool = m32x4

impl SimdValue for Simd<u32x8>[src]

type Element = u32

type SimdBool = m32x8

impl SimdValue for Simd<u32x16>[src]

type Element = u32

type SimdBool = m32x16

impl SimdValue for Simd<u64x2>[src]

type Element = u64

type SimdBool = m64x2

impl SimdValue for Simd<u64x4>[src]

type Element = u64

type SimdBool = m64x4

impl SimdValue for Simd<u64x8>[src]

type Element = u64

type SimdBool = m64x8

impl SimdValue for Simd<u128x1>[src]

type Element = u128

type SimdBool = m128x1

impl SimdValue for Simd<u128x2>[src]

type Element = u128

type SimdBool = m128x2

impl SimdValue for Simd<u128x4>[src]

type Element = u128

type SimdBool = m128x4

impl SimdValue for Simd<usizex2>[src]

type Element = usize

type SimdBool = msizex2

impl SimdValue for Simd<usizex4>[src]

type Element = usize

type SimdBool = msizex4

impl SimdValue for Simd<usizex8>[src]

type Element = usize

type SimdBool = msizex8

impl SimdValue for WideBoolF32x4[src]

type Element = bool

type SimdBool = Self

impl SimdValue for WideF32x4[src]

type Element = f32

type SimdBool = WideBoolF32x4

impl<Fract: LeEqU8> SimdValue for FixedI8<Fract>[src]

type Element = Self

type SimdBool = bool

impl<Fract: LeEqU16> SimdValue for FixedI16<Fract>[src]

type Element = Self

type SimdBool = bool

impl<Fract: LeEqU32> SimdValue for FixedI32<Fract>[src]

type Element = Self

type SimdBool = bool

impl<Fract: LeEqU64> SimdValue for FixedI64<Fract>[src]

type Element = Self

type SimdBool = bool

Loading content...