Topics / SIMD vectorization

Performance topic

SIMD vectorization

Process 4, 8, 16 or 32 values per instruction with SSE, AVX2, AVX-512, NEON or SVE. The wins come from data layout as much as from intrinsics: aligned, contiguous lanes, masks instead of branches, and wide loads.

4,448proven techniques
183pitfalls: tried, then slower
908repositories
164from papers

Examples from real commits

benfulcher/hctsa 32× Split a long stream into 64-draw blocks, get each block's start state by exact jump-ahead with matrix powers mod m, then advance all blocks together as vector columns. proof: commit → Plonky3/Plonky3 17.7× Hash whole chunks of a few long messages in separate lanes, each lane with its own chunk counter, then fold the chunk values into each message's tree in lockstep. proof: commit → FFmpeg/FFmpeg 6.2× Unroll the recurrence by 4 with precomputed powers c1..c4 so each group of 4 outputs is independent FMA terms, then vectorize the 4-lane group with SSE FMA3. proof: commit → DragonSpit/HPCsharp 4× Accumulate widened 16/32-bit sums in registers for 256 iterations before widening to 64-bit. proof: commit → dotnet/runtime 3.3× Table-free software vector clz for byte and ushort: smear the top set bit downward with shifts and ORs, then compute width minus PopCount of the smeared value. proof: commit → facebook/zstd 3.1× 4-way NEON vectorization with vqtbl2q_u8 byte-permutation to pack 32-bit fields into 16-bit SeqDef layout proof: commit → bytedance/sonic-cpp 3× Use SVE2 HISTSEG to count matching structural bytes per 16-byte segment in one instruction, skipping mask creation when no interesting characters are present. proof: commit → klauspost/reedsolomon 2.7× Multiply GF(2^8) bytes by a constant via one GF2P8AFFINEQB per 64 bytes using a precomputed 8x8 bit matrix, replacing nibble-table shuffles. proof: commit →

Languages

  • C++2,033
  • C1,191
  • Rust423
  • CUDA107
  • C#76
  • Python46

Hardware

  • x862,764
  • ARM855
  • CPU575
  • NVIDIA GPU160
  • GPU65

Fields

  • data & compression1,008
  • math908
  • general852
  • graphics644
  • CPU598

Where these come from

Repositories with the most techniques on this topic in the database:

opencv/opencv · 40FFmpeg/FFmpeg · 36gnuradio/volk · 33Cykooz/fast_image_resize · 31google/skia · 31juj/MathGeoLib · 29simd-everywhere/simde · 27Plonky3/Plonky3 · 26mirror/x264 · 26mozilla/aom · 26

Ask Claude for the full answer

Each technique comes with its bottleneck, measured speedup, trade-offs, conditions and the commit or paper behind it, served to Claude through MCP.

claude mcp add --transport http adtomic https://www.adtomic.co/mcp

Connect Claude Pricing

Related topics

Better algorithmsPrecomputation and memoizationAvoiding allocationsEarly exit and pruningBit tricks and strength reduction