Menu

1 / 23

SIMD and Go : r/golang

#golang#redditgolang#simd#reddit#photo
Reading 0:00
15s threshold

r/golang

u/Charming_Skin_8549

SIMD and Go

internals-for-interns.com

Take a really boring loop: walk two []float32 slices and add them together, element by element. Written the normal way in Go, the CPU handles one pair per step. The funny thing is that the same CPU has hardware that could handle eight pairs at once, and a plain Go loop never uses it. That hardware is SIMD. Until recently, the only way to use it from Go was hand-written assembly. Now Go has an experimental simd/archsimd package (Go 1.26) and a portable simd package on top of it (Go 1.27), so you can write normal Go that turns into SIMD instructions.

Open

comcastbusiness • Ad

Get the most comprehensive cybersecurity for small business at the best price + ask about a $500 prepaid card.

Learn More

comcastbusiness.com

Best

Open comment sort options

Comments Section

Hot-Ad-2786

Great read

wothotturd1

yeah agreed, really well put together