SIMD

SIMD Within a Register (SWAR) on Strings in Go 1.20

To introduce SWAR (SIMD within-a-register) techniques in go, we’ll implement the simplest thing I can think of: checking if a string is ASCII. SWAR is the technique of operating over multiple datapoints within one register of the cpu. In our case one 64-bit variable will contain 8 bytes of our string so we can process 8 bytes at a time. We’ll do this in go without any C functions or assembly.

Which Consumer Computers Support AVX-512?

Update 2025-02-16: I’ll belatedly note that AMD’s Zen 4 and Zen 5 processors support AVX-512 instructions. So if your software makes use of it, then you’ll get a speed boost when processing large files on your PC. For the best throughput, AMDs desktop 9000 series (Zen 5) processors have a full-width 512-bit datapath for AVX-512 instructions, meaning they can process up to twice the instructions per clock for this type of instructions compared to Zen 4.