Live data from Hacker News

Everyone should know SIMD

mitchellh.com

1–10 of 263 posts

Re: Everyone should know SIMD

#4
post #2

I just do gcc -O3 and get SIMD without having to learn it

In the article, Mitchel mentions how this doesn’t always work. In fact, as someone who’s worked in compiler development, I can say it’s a small miracle when it does work.

Re: Everyone should know SIMD

#6
post #2

I just do gcc -O3 and get SIMD without having to learn it

auto-vectorization is not nearly as good as you would hope it to be. The best SIMD optimizations likely require changing your data format from AoS to SoA.

And -march=native or at least -march=x86-64-v3 or similar, alternatively identifying relevant functions and manually invoking FMV and uarch specialization via target_clones. Plus non-integer code can generally not be autovectorized in normal-math mode since FP is non-commutative.

Re: Everyone should know SIMD

#7
post #5

Earlier quoted context omitted.

auto-vectorization is not nearly as good as you would hope it to be. The best SIMD optimizations likely require changing your data format from AoS to SoA.

What are AoS and SoA?

Array of Structs and Struct of Arrays

Re: Everyone should know SIMD

#8
post #5

Earlier quoted context omitted.

auto-vectorization is not nearly as good as you would hope it to be. The best SIMD optimizations likely require changing your data format from AoS to SoA.

What are AoS and SoA?

Array of Structs and Struct of Arrays https://en.wikipedia.org/wiki/AoS_and_SoA

Re: Everyone should know SIMD

#9
post #2

I just do gcc -O3 and get SIMD without having to learn it

auto-vectorization is not nearly as good as you would hope it to be. The best SIMD optimizations likely require changing your data format from AoS to SoA.

The one feature in Jonathan Blow's Jai language I really envy is a a single keyword to switch AoS to SoA and visa-versa at comptime

Re: Everyone should know SIMD

#10
post #2

I just do gcc -O3 and get SIMD without having to learn it

auto-vectorization is not nearly as good as you would hope it to be. The best SIMD optimizations likely require changing your data format from AoS to SoA.

Well, then I just prompt Claude and get SIMD without having to learn it /s
Post reply on HN