Skip to content

Add AVX2 forward-combine path to BODFT kernel#43

Merged
falseywinchnet merged 1 commit into
mainfrom
c93rxr-main/implement-avx2-pathway-for-odd-fft-transform
Jun 23, 2026
Merged

Add AVX2 forward-combine path to BODFT kernel#43
falseywinchnet merged 1 commit into
mainfrom
c93rxr-main/implement-avx2-pathway-for-odd-fft-transform

Conversation

@falseywinchnet

Copy link
Copy Markdown
Owner

Motivation

  • Improve BODFT (odd-frequency DFT) forward performance to match the FFT codepath by adding a 256-bit AVX2/FMA double-precision combine implementation and enable assembly inspection and notes tracking.
  • Reduce the twiddle-multiply cost and increase vector utilization by handling four paired radix-4 positions per iteration in the AVX2 path.

Description

  • Implemented a 256-bit AVX2/FMA forward combine: added bodft_combine_fwd_avx2_f64 and helpers bodft_uzp4_pd, bodft_store4_pd, bodft_rev4_pd in src/detail/bodft_kernel.hpp and wired it ahead of the existing 128-bit SIMD fallback in combine_fwd.
  • Kept the existing 128-bit SoA SIMD paths (SSE2/NEON) and scalar tail for non-AVX2/tail cases, and left the float path on the portable 128-bit flow pending an 8-position AVX2 float pack pass.
  • Extended Makefile to emit a BODFT AVX2 assembly target (build/.../src/bodft_avx2.s) and include it in asm-check.
  • Added src/detail/bodft_avx2_notes.md to record validation commands, assembly inspection steps, performance observations and next work items.

Testing

  • Ran make test BUILD_DIR=build-avx2 CXXWARNFLAGS='-Wall -Wextra -Wpedantic -Werror' and saw both correctness checks pass (correctness ok and c api ok).
  • Built and ran the BODFT-specific benchmark with make build-avx2/examples/bodft_benchmark BUILD_DIR=build-avx2 && build-avx2/examples/bodft_benchmark, which produced correctness output and timing numbers for f64/f32 (completed successfully).
  • Generated and inspected AVX2 assembly with make asm-check BUILD_DIR=build-avx2 and verified AVX/FMA/ymm patterns via rg 'vfmadd|vfmsub|vperm|ymm' build-avx2/src/bodft_avx2.s, confirming vectorized code emission.
  • Built and ran a BFFT benchmark example with make build-avx2/examples/benchmark BUILD_DIR=build-avx2 && build-avx2/examples/benchmark 65536 200 to compare end-to-end timings in this environment (completed; platform-specific comparison columns such as FFTW/MKL were unavailable).

Codex Task

@falseywinchnet falseywinchnet merged commit 7cb2b9e into main Jun 23, 2026
4 checks passed
@falseywinchnet falseywinchnet deleted the c93rxr-main/implement-avx2-pathway-for-odd-fft-transform branch June 23, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant