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§
const COMPLEX_PER_VECTOR: usize
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
Sourceunsafe fn swap_complex_components(self) -> Self
unsafe fn swap_complex_components(self) -> Self
Swap each real number with its corresponding imaginary number
Sourceunsafe fn duplicate_complex_components(self) -> (Self, Self)
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
Sourceunsafe fn reverse_complex_elements(self) -> Self
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
Sourceunsafe fn unpacklo_complex(rows: [Self; 2]) -> Self
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.
Sourceunsafe fn unpackhi_complex(rows: [Self; 2]) -> Self
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.
Sourceunsafe fn broadcast_twiddle(
index: usize,
len: usize,
direction: FftDirection,
) -> Self
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
Sourceunsafe fn make_rotation90(direction: FftDirection) -> Rotation90<Self>
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
Sourceunsafe fn make_mixedradix_twiddle_chunk(
x: usize,
y: usize,
len: usize,
direction: FftDirection,
) -> Self
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
Sourceunsafe fn transpose2_packed(rows: [Self; 2]) -> [Self; 2]
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.
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]
Sourceunsafe fn mul_complex(left: Self, right: Self) -> Self
unsafe fn mul_complex(left: Self, right: Self) -> Self
Pairwise multiply the complex numbers in left with the complex numbers in right.
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]
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".