4 ms·
Having a constant size probably made it easy for the compiler to properly generate bytecode that uses vectorized instructions
by sdinsn 7y ago
Having a constant size probably made it easy for the compiler to properly generate bytecode that uses vectorized instructions
- BubRoss 7y agoI would say that's unlikely. SIMD instructions don't usually get used by normal compilers without very specific loops that make sure there are no obstacles to vectorization. Also the best way to use SIMD is to loop through a large array of two and do very simple operations with them. Modern CPUs actually have three (I think) floating point slots so their total floating point throughput isn't simply a fraction of the SIMD size.
- sdinsn 7y ago> SIMD instructions don't usually get used by normal compilers without very specific loops Compilers are smart. Even Java's JIT will generate SIMD instructions pretty well
- BubRoss 7y agoI would have to see this to believe it. Even Intel's own compiler is extremely sensitive to small changes turning off SIMD use in a loop. You can try out compilers and see their asm at godbolt.org