jxl_grid

Trait SimdVector

Source
pub trait SimdVector: Copy {
    const SIZE: usize;
Show 16 methods // Required methods fn available() -> bool; unsafe fn zero() -> Self; unsafe fn set<const N: usize>(val: [f32; N]) -> Self; unsafe fn splat_f32(val: f32) -> Self; unsafe fn load(ptr: *const f32) -> Self; unsafe fn load_aligned(ptr: *const f32) -> Self; unsafe fn extract_f32<const N: i32>(self) -> f32; unsafe fn store(self, ptr: *mut f32); unsafe fn store_aligned(self, ptr: *mut f32); unsafe fn add(self, lhs: Self) -> Self; unsafe fn sub(self, lhs: Self) -> Self; unsafe fn mul(self, lhs: Self) -> Self; unsafe fn div(self, lhs: Self) -> Self; unsafe fn abs(self) -> Self; unsafe fn muladd(self, mul: Self, add: Self) -> Self; unsafe fn mulsub(self, mul: Self, sub: Self) -> Self;
}
Expand description

Trait representing a SIMD vector.

Required Associated Constants§

Source

const SIZE: usize

The number of f32 lanes in a single SIMD vector.

Required Methods§

Source

fn available() -> bool

Return whether this vector type is supported by current CPU.

Source

unsafe fn zero() -> Self

Initialize a SIMD vector with zeroes.

§Safety

CPU should support the vector type.

Source

unsafe fn set<const N: usize>(val: [f32; N]) -> Self

Initialize a SIMD vector with given floats.

§Safety

CPU should support the vector type.

Source

unsafe fn splat_f32(val: f32) -> Self

Initialize a SIMD vector filled with given float.

§Safety

CPU should support the vector type.

Source

unsafe fn load(ptr: *const f32) -> Self

Load a SIMD vector from memory.

The pointer doesn’t need to be aligned.

§Safety

CPU should support the vector type, and the given pointer must be valid.

Source

unsafe fn load_aligned(ptr: *const f32) -> Self

Load a SIMD vector from memory with aligned pointer.

§Safety

CPU should support the vector type, and the given pointer must be valid and properly aligned.

Source

unsafe fn extract_f32<const N: i32>(self) -> f32

Extract a single element from the SIMD vector.

§Safety

CPU should support the vector type.

Source

unsafe fn store(self, ptr: *mut f32)

Store the SIMD vector to memory.

The pointer doesn’t need to be aligned.

§Safety

CPU should support the vector type, and the given pointer must be valid.

Source

unsafe fn store_aligned(self, ptr: *mut f32)

Store the SIMD vector to memory with aligned pointer.

§Safety

CPU should support the vector type, and the given pointer must be valid and properly aligned.

Source

unsafe fn add(self, lhs: Self) -> Self

Add two vectors element-wise.

§Safety

CPU should support the vector type.

Source

unsafe fn sub(self, lhs: Self) -> Self

Subtract two vectors element-wise.

§Safety

CPU should support the vector type.

Source

unsafe fn mul(self, lhs: Self) -> Self

Multiply two vectors element-wise.

§Safety

CPU should support the vector type.

Source

unsafe fn div(self, lhs: Self) -> Self

Divide two vectors element-wise.

§Safety

CPU should support the vector type.

Source

unsafe fn abs(self) -> Self

Compute the absolute value for each element of the vector.

§Safety

CPU should support the vector type.

Source

unsafe fn muladd(self, mul: Self, add: Self) -> Self

Computes self * mul + add element-wise.

§Safety

CPU should support the vector type.

Source

unsafe fn mulsub(self, mul: Self, sub: Self) -> Self

Computes self * mul - add element-wise.

§Safety

CPU should support the vector type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§