Adventures in SIMD-Thinking (part 2 of 2)
summary
Implements small-kernel convolution and UTF-8→UTF-32 conversion using Intel intrinsics (SSE, AVX, AVX2, AVX-512), broadcasting kernel coefficients into registers and using a fused multiply-add loop with a shift-up-with-carry register trick so odd kernel sizes 3–15 fit in a 16-lane register; benchmarks vs Intel MKL on 1k–10M elements show up to ~12–15× speedup (kernel 15 ≈8× in one run). UTF conversion uses a DFA plus an ASCII fast path with move mask/unpack shuffles; AVX2 helps on Clang/MSVC but GCC shows little or mixed benefit.
AI-written summary · about
chapters (4)
related talks
04mLightning Talk: How to Leverage SIMD Intrinsics for Massive Slowdowns
01h 06m“Improving Performance Through Compiler Switches..."
01h 03mCompute More in Less Time Using C++ Simd Wrapper Libraries
01h 04mDesign for Performance
01h 37mAn Overview of Program Optimization Techniques
06mLightning Talk: Use SIMD Pairwise Reduction in C++!
54mx86 Internals for Fun & Profit
01h 03mBuilding Abstractions at the Hardware-software Boundary
