Advanced SIMD Algorithms in Pictures
Talkat CppCon 2023 · on Thursday, 2023-10-05· at 15:15· Adams, 6700 North Gaylord Rockies Boulevard·
summary
Covers concrete implementations for memcmp copy_if and set_intersection using real SIMD tools (EVE library AVX2/AVX512 BMI2 and platform-specific masks). Demonstrates memcmp ~4× vs 8-bit loop with top-bit masks and ctz based first-true, shows copy_if ≈3–10× wins with compress-copy variants (table-lookup BMI2 shuffle and a scalar sparse loop), and gives set_intersection 2–20× depending on density and register width; benchmarks include x86 and Apple M1 and note when a method degrades.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:04Talk overview
- 2:26Compiler auto-vectorize mismatch
- 3:30SIMD registers and Eve library
- 5:43Mismatch under the hood
- 7:28First SIMD operation
- 9:40Standard SIMD vs Eve library
- 10:23SIMD copy_if
- 13:32Copy implementations trade-offs
- 15:20Benchmarking copy_if gains
- 16:48Compress limitations
- 17:09Set intersection basics
- 18:56SIMD set intersection
- 20:01has_equal in SIMD
- 21:08Benchmarking set intersection
- 22:52Acknowledgments
related talks
01h 03mCompute More in Less Time Using C++ Simd Wrapper Libraries
01h 00mSIMD in C++20: EVE of a new Era
54mFast C++ by using SIMD Types with Generic Lambdas and Filters
01h 02mSqueezing the Hardware to Make Performance Juice
43mUnlock the Power of Parallel Computing With SWAR (SIMD Within A Register)
12mVectorCDC: Accelerating Data Deduplication with Vector Instructions
01h 00m“Want fast C++? Know your hardware!"
01h 04mDesign for Performance
