| 1 |
//! This example is meant to be used for inspecting the generated assembly. |
| 2 |
//! This can be interesting when working with simd intrinsics, or trying to reduce code size |
| 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 call a generic planned DCT, which will cause all dct code to be compiled |
| 9 |
//! - Ask rustc to output assembly code: |
| 10 |
//! `cargo rustc --release --example asmtest -- --emit=asm` |
| 11 |
//! - This will create a file at `target/release/examples/asmtest-0123456789abcdef.s` (with a random number in the filename). |
| 12 |
//! - Open this file and search for the function. |
| 13 |
|
| 14 |
use rustdct::DctPlanner; |
| 15 |
|
| 16 |
fn main() { |
| 17 |
let mut planner = DctPlanner::new(); |
| 18 |
let dct = planner.plan_dct2(4); |
| 19 |
|
| 20 |
let mut buffer: Vec<f32> = vec![0.0; dct.len()]; |
| 21 |
dct.process_dct2(&mut buffer); |
| 22 |
} |