Skip to main content

AvxVector

Trait AvxVector 

Source
pub trait AvxVector:
    Copy
    + Debug
    + Send
    + Sync {
    const COMPLEX_PER_VECTOR: usize;
Show 40 methods // Required methods unsafe fn zero() -> Self; unsafe fn half_root2() -> Self; unsafe fn add(left: Self, right: Self) -> Self; unsafe fn sub(left: Self, right: Self) -> Self; unsafe fn xor(left: Self, right: Self) -> Self; unsafe fn neg(self) -> Self; unsafe fn mul(left: Self, right: Self) -> Self; unsafe fn fmadd(left: Self, right: Self, add: Self) -> Self; unsafe fn fnmadd(left: Self, right: Self, add: Self) -> Self; unsafe fn fmaddsub(left: Self, right: Self, add: Self) -> Self; unsafe fn fmsubadd(left: Self, right: Self, add: Self) -> Self; unsafe fn swap_complex_components(self) -> Self; unsafe fn duplicate_complex_components(self) -> (Self, Self); unsafe fn reverse_complex_elements(self) -> Self; unsafe fn unpacklo_complex(rows: [Self; 2]) -> Self; unsafe fn unpackhi_complex(rows: [Self; 2]) -> Self; unsafe fn broadcast_twiddle( index: usize, len: usize, direction: FftDirection, ) -> Self; unsafe fn make_rotation90(direction: FftDirection) -> Rotation90<Self>; unsafe fn make_mixedradix_twiddle_chunk( x: usize, y: usize, len: usize, direction: FftDirection, ) -> Self; unsafe fn transpose2_packed(rows: [Self; 2]) -> [Self; 2]; unsafe fn transpose3_packed(rows: [Self; 3]) -> [Self; 3]; unsafe fn transpose4_packed(rows: [Self; 4]) -> [Self; 4]; unsafe fn transpose5_packed(rows: [Self; 5]) -> [Self; 5]; unsafe fn transpose6_packed(rows: [Self; 6]) -> [Self; 6]; unsafe fn transpose7_packed(rows: [Self; 7]) -> [Self; 7]; unsafe fn transpose8_packed(rows: [Self; 8]) -> [Self; 8]; unsafe fn transpose9_packed(rows: [Self; 9]) -> [Self; 9]; unsafe fn transpose11_packed(rows: [Self; 11]) -> [Self; 11]; unsafe fn transpose12_packed(rows: [Self; 12]) -> [Self; 12]; unsafe fn transpose16_packed(rows: [Self; 16]) -> [Self; 16]; // Provided methods unsafe fn unpack_complex(rows: [Self; 2]) -> [Self; 2] { ... } unsafe fn mul_complex(left: Self, right: Self) -> Self { ... } unsafe fn rotate90(self, rotation: Rotation90<Self>) -> Self { ... } unsafe fn column_butterfly2(rows: [Self; 2]) -> [Self; 2] { ... } unsafe fn column_butterfly3(rows: [Self; 3], twiddles: Self) -> [Self; 3] { ... } unsafe fn column_butterfly4( rows: [Self; 4], rotation: Rotation90<Self>, ) -> [Self; 4] { ... } unsafe fn column_butterfly5( rows: [Self; 5], twiddles: [Self; 2], ) -> [Self; 5] { ... } unsafe fn column_butterfly7( rows: [Self; 7], twiddles: [Self; 3], ) -> [Self; 7] { ... } unsafe fn column_butterfly8( rows: [Self; 8], rotation: Rotation90<Self>, ) -> [Self; 8] { ... } unsafe fn column_butterfly11( rows: [Self; 11], twiddles: [Self; 5], ) -> [Self; 11] { ... }
}
Expand description

A SIMD vector of complex numbers, stored with the real values and imaginary values interleaved. Implemented for __m128, __m128d, __m256, __m256d, but these all require the AVX instruction set.

The goal of this trait is to reduce code duplication by letting code be generic over the vector type

Required Associated Constants§

Required Methods§

Source

unsafe fn zero() -> Self

Source

unsafe fn half_root2() -> Self

Source

unsafe fn add(left: Self, right: Self) -> Self

Source

unsafe fn sub(left: Self, right: Self) -> Self

Source

unsafe fn xor(left: Self, right: Self) -> Self

Source

unsafe fn neg(self) -> Self

Source

unsafe fn mul(left: Self, right: Self) -> Self

Source

unsafe fn fmadd(left: Self, right: Self, add: Self) -> Self

Source

unsafe fn fnmadd(left: Self, right: Self, add: Self) -> Self

Source

unsafe fn fmaddsub(left: Self, right: Self, add: Self) -> Self

Source

unsafe fn fmsubadd(left: Self, right: Self, add: Self) -> Self

Source

unsafe fn swap_complex_components(self) -> Self

Swap each real number with its corresponding imaginary number

Source

unsafe fn duplicate_complex_components(self) -> (Self, Self)

first return is the reals duplicated into the imaginaries, second return is the imaginaries duplicated into the reals

Source

unsafe fn reverse_complex_elements(self) -> Self

Reverse the order of complex numbers in the vector, so that the last is the first and the first is the last

Source

unsafe fn unpacklo_complex(rows: [Self; 2]) -> Self

Copies the even elements of rows[1] into the corresponding odd elements of rows[0] and returns the result.

Source

unsafe fn unpackhi_complex(rows: [Self; 2]) -> Self

Copies the odd elements of rows[0] into the corresponding even elements of rows[1] and returns the result.

Source

unsafe fn broadcast_twiddle( index: usize, len: usize, direction: FftDirection, ) -> Self

Fill a vector by computing a twiddle factor and repeating it across the whole vector

Source

unsafe fn make_rotation90(direction: FftDirection) -> Rotation90<Self>

create a Rotator90 instance to rotate complex numbers either 90 or 270 degrees, based on the value of inverse

Source

unsafe fn make_mixedradix_twiddle_chunk( x: usize, y: usize, len: usize, direction: FftDirection, ) -> Self

Generates a chunk of twiddle factors starting at (X,Y) and incrementing X COMPLEX_PER_VECTOR times. The result will be [twiddle(x*y, len), twiddle((x+1)*y, len), twiddle((x+2)*y, len), …] for as many complex numbers fit in a vector

Source

unsafe fn transpose2_packed(rows: [Self; 2]) -> [Self; 2]

Packed transposes. Used by mixed radix. These all take a NxC array, where C is COMPLEX_PER_VECTOR, and transpose it to a CxN array. But they also pack the result into as few vectors as possible, with the goal of writing the transposed data out contiguously.

Source

unsafe fn transpose3_packed(rows: [Self; 3]) -> [Self; 3]

Source

unsafe fn transpose4_packed(rows: [Self; 4]) -> [Self; 4]

Source

unsafe fn transpose5_packed(rows: [Self; 5]) -> [Self; 5]

Source

unsafe fn transpose6_packed(rows: [Self; 6]) -> [Self; 6]

Source

unsafe fn transpose7_packed(rows: [Self; 7]) -> [Self; 7]

Source

unsafe fn transpose8_packed(rows: [Self; 8]) -> [Self; 8]

Source

unsafe fn transpose9_packed(rows: [Self; 9]) -> [Self; 9]

Source

unsafe fn transpose11_packed(rows: [Self; 11]) -> [Self; 11]

Source

unsafe fn transpose12_packed(rows: [Self; 12]) -> [Self; 12]

Source

unsafe fn transpose16_packed(rows: [Self; 16]) -> [Self; 16]

Provided Methods§

Source

unsafe fn unpack_complex(rows: [Self; 2]) -> [Self; 2]

Source

unsafe fn mul_complex(left: Self, right: Self) -> Self

Pairwise multiply the complex numbers in left with the complex numbers in right.

Source

unsafe fn rotate90(self, rotation: Rotation90<Self>) -> Self

Source

unsafe fn column_butterfly2(rows: [Self; 2]) -> [Self; 2]

Source

unsafe fn column_butterfly3(rows: [Self; 3], twiddles: Self) -> [Self; 3]

Source

unsafe fn column_butterfly4( rows: [Self; 4], rotation: Rotation90<Self>, ) -> [Self; 4]

Source

unsafe fn column_butterfly5(rows: [Self; 5], twiddles: [Self; 2]) -> [Self; 5]

Source

unsafe fn column_butterfly7(rows: [Self; 7], twiddles: [Self; 3]) -> [Self; 7]

Source

unsafe fn column_butterfly8( rows: [Self; 8], rotation: Rotation90<Self>, ) -> [Self; 8]

Source

unsafe fn column_butterfly11( rows: [Self; 11], twiddles: [Self; 5], ) -> [Self; 11]

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl AvxVector for __m128

Source§

const COMPLEX_PER_VECTOR: usize = 2

Source§

unsafe fn zero() -> Self

Source§

unsafe fn half_root2() -> Self

Source§

unsafe fn xor(left: Self, right: Self) -> Self

Source§

unsafe fn neg(self) -> Self

Source§

unsafe fn add(left: Self, right: Self) -> Self

Source§

unsafe fn sub(left: Self, right: Self) -> Self

Source§

unsafe fn mul(left: Self, right: Self) -> Self

Source§

unsafe fn fmadd(left: Self, right: Self, add: Self) -> Self

Source§

unsafe fn fnmadd(left: Self, right: Self, add: Self) -> Self

Source§

unsafe fn fmaddsub(left: Self, right: Self, add: Self) -> Self

Source§

unsafe fn fmsubadd(left: Self, right: Self, add: Self) -> Self

Source§

unsafe fn reverse_complex_elements(self) -> Self

Source§

unsafe fn unpacklo_complex(rows: [Self; 2]) -> Self

Source§

unsafe fn unpackhi_complex(rows: [Self; 2]) -> Self

Source§

unsafe fn swap_complex_components(self) -> Self

Source§

unsafe fn duplicate_complex_components(self) -> (Self, Self)

Source§

unsafe fn make_rotation90(direction: FftDirection) -> Rotation90<Self>

Source§

unsafe fn make_mixedradix_twiddle_chunk( x: usize, y: usize, len: usize, direction: FftDirection, ) -> Self

Source§

unsafe fn broadcast_twiddle( index: usize, len: usize, direction: FftDirection, ) -> Self

Source§

unsafe fn transpose2_packed(rows: [Self; 2]) -> [Self; 2]

Source§

unsafe fn transpose3_packed(rows: [Self; 3]) -> [Self; 3]

Source§

unsafe fn transpose4_packed(rows: [Self; 4]) -> [Self; 4]

Source§

unsafe fn transpose5_packed(rows: [Self; 5]) -> [Self; 5]

Source§

unsafe fn transpose6_packed(rows: [Self; 6]) -> [Self; 6]

Source§

unsafe fn transpose7_packed(rows: [Self; 7]) -> [Self; 7]

Source§

unsafe fn transpose8_packed(rows: [Self; 8]) -> [Self; 8]

Source§

unsafe fn transpose9_packed(rows: [Self; 9]) -> [Self; 9]

Source§

unsafe fn transpose11_packed(rows: [Self; 11]) -> [Self; 11]

Source§

unsafe fn transpose12_packed(rows: [Self; 12]) -> [Self; 12]

Source§

unsafe fn transpose16_packed(rows: [Self; 16]) -> [Self; 16]

Source§

impl AvxVector for __m256

Source§

const COMPLEX_PER_VECTOR: usize = 4

Source§

unsafe fn zero() -> Self

Source§

unsafe fn half_root2() -> Self

Source§

unsafe fn xor(left: Self, right: Self) -> Self

Source§

unsafe fn neg(self) -> Self

Source§

unsafe fn add(left: Self, right: Self) -> Self

Source§

unsafe fn sub(left: Self, right: Self) -> Self

Source§

unsafe fn mul(left: Self, right: Self) -> Self

Source§

unsafe fn fmadd(left: Self, right: Self, add: Self) -> Self

Source§

unsafe fn fnmadd(left: Self, right: Self, add: Self) -> Self

Source§

unsafe fn fmaddsub(left: Self, right: Self, add: Self) -> Self

Source§

unsafe fn fmsubadd(left: Self, right: Self, add: Self) -> Self

Source§

unsafe fn reverse_complex_elements(self) -> Self

Source§

unsafe fn unpacklo_complex(rows: [Self; 2]) -> Self

Source§

unsafe fn unpackhi_complex(rows: [Self; 2]) -> Self

Source§

unsafe fn swap_complex_components(self) -> Self

Source§

unsafe fn duplicate_complex_components(self) -> (Self, Self)

Source§

unsafe fn make_rotation90(direction: FftDirection) -> Rotation90<Self>

Source§

unsafe fn make_mixedradix_twiddle_chunk( x: usize, y: usize, len: usize, direction: FftDirection, ) -> Self

Source§

unsafe fn broadcast_twiddle( index: usize, len: usize, direction: FftDirection, ) -> Self

Source§

unsafe fn transpose2_packed(rows: [Self; 2]) -> [Self; 2]

Source§

unsafe fn transpose3_packed(rows: [Self; 3]) -> [Self; 3]

Source§

unsafe fn transpose4_packed(rows: [Self; 4]) -> [Self; 4]

Source§

unsafe fn transpose5_packed(rows: [Self; 5]) -> [Self; 5]

Source§

unsafe fn transpose6_packed(rows: [Self; 6]) -> [Self; 6]

Source§

unsafe fn transpose7_packed(rows: [Self; 7]) -> [Self; 7]

Source§

unsafe fn transpose8_packed(rows: [Self; 8]) -> [Self; 8]

Source§

unsafe fn transpose9_packed(rows: [Self; 9]) -> [Self; 9]

Source§

unsafe fn transpose11_packed(rows: [Self; 11]) -> [Self; 11]

Source§

unsafe fn transpose12_packed(rows: [Self; 12]) -> [Self; 12]

Source§

unsafe fn transpose16_packed(rows: [Self; 16]) -> [Self; 16]

Source§

impl AvxVector for __m128d

Source§

const COMPLEX_PER_VECTOR: usize = 1

Source§

unsafe fn zero() -> Self

Source§

unsafe fn half_root2() -> Self

Source§

unsafe fn xor(left: Self, right: Self) -> Self

Source§

unsafe fn neg(self) -> Self

Source§

unsafe fn add(left: Self, right: Self) -> Self

Source§

unsafe fn sub(left: Self, right: Self) -> Self

Source§

unsafe fn mul(left: Self, right: Self) -> Self

Source§

unsafe fn fmadd(left: Self, right: Self, add: Self) -> Self

Source§

unsafe fn fnmadd(left: Self, right: Self, add: Self) -> Self

Source§

unsafe fn fmaddsub(left: Self, right: Self, add: Self) -> Self

Source§

unsafe fn fmsubadd(left: Self, right: Self, add: Self) -> Self

Source§

unsafe fn reverse_complex_elements(self) -> Self

Source§

unsafe fn unpacklo_complex(_rows: [Self; 2]) -> Self

Source§

unsafe fn unpackhi_complex(_rows: [Self; 2]) -> Self

Source§

unsafe fn swap_complex_components(self) -> Self

Source§

unsafe fn duplicate_complex_components(self) -> (Self, Self)

Source§

unsafe fn make_rotation90(direction: FftDirection) -> Rotation90<Self>

Source§

unsafe fn make_mixedradix_twiddle_chunk( x: usize, y: usize, len: usize, direction: FftDirection, ) -> Self

Source§

unsafe fn broadcast_twiddle( index: usize, len: usize, direction: FftDirection, ) -> Self

Source§

unsafe fn transpose2_packed(rows: [Self; 2]) -> [Self; 2]

Source§

unsafe fn transpose3_packed(rows: [Self; 3]) -> [Self; 3]

Source§

unsafe fn transpose4_packed(rows: [Self; 4]) -> [Self; 4]

Source§

unsafe fn transpose5_packed(rows: [Self; 5]) -> [Self; 5]

Source§

unsafe fn transpose6_packed(rows: [Self; 6]) -> [Self; 6]

Source§

unsafe fn transpose7_packed(rows: [Self; 7]) -> [Self; 7]

Source§

unsafe fn transpose8_packed(rows: [Self; 8]) -> [Self; 8]

Source§

unsafe fn transpose9_packed(rows: [Self; 9]) -> [Self; 9]

Source§

unsafe fn transpose11_packed(rows: [Self; 11]) -> [Self; 11]

Source§

unsafe fn transpose12_packed(rows: [Self; 12]) -> [Self; 12]

Source§

unsafe fn transpose16_packed(rows: [Self; 16]) -> [Self; 16]

Source§

impl AvxVector for __m256d

Source§

const COMPLEX_PER_VECTOR: usize = 2

Source§

unsafe fn zero() -> Self

Source§

unsafe fn half_root2() -> Self

Source§

unsafe fn xor(left: Self, right: Self) -> Self

Source§

unsafe fn neg(self) -> Self

Source§

unsafe fn add(left: Self, right: Self) -> Self

Source§

unsafe fn sub(left: Self, right: Self) -> Self

Source§

unsafe fn mul(left: Self, right: Self) -> Self

Source§

unsafe fn fmadd(left: Self, right: Self, add: Self) -> Self

Source§

unsafe fn fnmadd(left: Self, right: Self, add: Self) -> Self

Source§

unsafe fn fmaddsub(left: Self, right: Self, add: Self) -> Self

Source§

unsafe fn fmsubadd(left: Self, right: Self, add: Self) -> Self

Source§

unsafe fn reverse_complex_elements(self) -> Self

Source§

unsafe fn unpacklo_complex(rows: [Self; 2]) -> Self

Source§

unsafe fn unpackhi_complex(rows: [Self; 2]) -> Self

Source§

unsafe fn swap_complex_components(self) -> Self

Source§

unsafe fn duplicate_complex_components(self) -> (Self, Self)

Source§

unsafe fn make_rotation90(direction: FftDirection) -> Rotation90<Self>

Source§

unsafe fn make_mixedradix_twiddle_chunk( x: usize, y: usize, len: usize, direction: FftDirection, ) -> Self

Source§

unsafe fn broadcast_twiddle( index: usize, len: usize, direction: FftDirection, ) -> Self

Source§

unsafe fn transpose2_packed(rows: [Self; 2]) -> [Self; 2]

Source§

unsafe fn transpose3_packed(rows: [Self; 3]) -> [Self; 3]

Source§

unsafe fn transpose4_packed(rows: [Self; 4]) -> [Self; 4]

Source§

unsafe fn transpose5_packed(rows: [Self; 5]) -> [Self; 5]

Source§

unsafe fn transpose6_packed(rows: [Self; 6]) -> [Self; 6]

Source§

unsafe fn transpose7_packed(rows: [Self; 7]) -> [Self; 7]

Source§

unsafe fn transpose8_packed(rows: [Self; 8]) -> [Self; 8]

Source§

unsafe fn transpose9_packed(rows: [Self; 9]) -> [Self; 9]

Source§

unsafe fn transpose11_packed(rows: [Self; 11]) -> [Self; 11]

Source§

unsafe fn transpose12_packed(rows: [Self; 12]) -> [Self; 12]

Source§

unsafe fn transpose16_packed(rows: [Self; 16]) -> [Self; 16]

Implementors§