| 1 |
//! This example is mean to be used for inspecting the generated assembly. |
| 2 |
//! This can be interesting when working with simd intrinsics. |
| 3 |
//! |
| 4 |
//! To use: |
| 5 |
//! - Mark the function that should be investigated with `#[inline(never)]`. |
| 6 |
//! - If needed, add any required feature to the function, for example `#[target_feature(enable = "sse4.1")]` |
| 7 |
//! - Change the code below to use the changed function. |
| 8 |
//! Currently it is set up to look at the f32 version of the SSE 4-point butterfly. |
| 9 |
//! It uses the FftPlannerSse to plan a length 4 FFT, that will use the modified butterfly. |
| 10 |
//! - Ask rustc to output assembly code: |
| 11 |
//! `cargo rustc --release --features sse --example asmtest -- --emit=asm` |
| 12 |
//! - This will create a file at `target/release/examples/asmtest-0123456789abcdef.s` (with a random number in the filename). |
| 13 |
//! - Open this file and search for the function. |
| 14 |
|
| 15 |
use rustfft::num_complex::Complex32; |
| 16 |
//use rustfft::num_complex::Complex64; |
| 17 |
//use rustfft::FftPlannerScalar; |
| 18 |
use rustfft::FftPlannerSse; |
| 19 |
//use rustfft::FftPlannerNeon; |
| 20 |
|
| 21 |
fn main() { |
| 22 |
//let mut planner = FftPlannerScalar::new(); |
| 23 |
let mut planner = FftPlannerSse::new().unwrap(); |
| 24 |
//let mut planner = FftPlannerNeon::new().unwrap(); |
| 25 |
let fft = planner.plan_fft_forward(4); |
| 26 |
|
| 27 |
let mut buffer = vec![Complex32::new(0.0, 0.0); 100]; |
| 28 |
fft.process(&mut buffer); |
| 29 |
} |