Skip to content

Add reproducible x86 assembly checks#18

Merged
falseywinchnet merged 1 commit into
mainfrom
ff46h3-main/improve-cache-locality-and-optimize-assembly
Jun 12, 2026
Merged

Add reproducible x86 assembly checks#18
falseywinchnet merged 1 commit into
mainfrom
ff46h3-main/improve-cache-locality-and-optimize-assembly

Conversation

@falseywinchnet

Copy link
Copy Markdown
Owner

Motivation

  • Provide a reproducible, documented way to emit annotated x86 assembly for both AVX2/FMA and SSE2/no-AVX builds so the SSE/AVX pathways can be inspected and audited automatically.
  • Record findings from the assembly audit and related micro-benchmark spot checks to guide future SIMD/locality work and to avoid regressions.

Description

  • Add a separate make asm-check target that probes the compiler for AVX2/FMA and SSE2/no-AVX support and emits annotated assembly into build/src/bfft_avx2.s and build/src/bfft_sse2.s when available by using $(AVX2_FLAGS) and $(SSE2_FLAGS) in the Makefile.
  • Wire assembly outputs into the build tree without changing the default make/make test flow so normal builds continue to use the automatic SIMD policy.
  • Update src/ASSEMBLY_NOTES.txt with audit findings and benchmark spot checks describing AVX2/SSE2 shapes, a rejected SSE fusion experiment (high register pressure), and example benchmark numbers observed during inspection.

Testing

  • Ran make clean, make, and make test with the automatic SIMD selection and all library correctness tests passed.
  • Ran make asm-check which produced build/src/bfft_avx2.s and build/src/bfft_sse2.s on a host compiler that accepted those switches.
  • Ran the benchmark and probe programs used for the audit: ./build/examples/benchmark 4096 1000, ./build/examples/benchmark 65536 200, and ./build/examples/locality_probe 65536 200 64; these completed and produced the recorded spot-check timings (FFTW columns were unavailable because FFTW/FFTWf were not found by dlopen).
  • Built and ran an SSE2/no-AVX correctness build and its benchmark to validate the SSE pathway (g++ -msse2 -mno-avx compile); correctness tests passed for the SSE2 build.

Codex Task

@falseywinchnet falseywinchnet merged commit d9a47ac into main Jun 12, 2026
4 checks passed
@falseywinchnet falseywinchnet deleted the ff46h3-main/improve-cache-locality-and-optimize-assembly branch June 12, 2026 11:56
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