logoalt Hacker News

Const-meyesterday at 9:03 PM4 repliesview on HN

I would add than SSE1 and SSE2 are now required parts of AMD64 instruction set. All 64-bit PC processors are required to support them both. For that reason, modern compilers are ignoring x87 FPU when building 64-bit binaries. Instead, they compile all float and double arithmetic into SSE1 and SSE2 instructions, respectively.


Replies

theandrewbaileyyesterday at 9:36 PM

Take a look at the micro-architecture levels. x86-64-v1 contains all the instructions that the original AMD64 and compatible Intel CPUs supported. v2 is all the SSE levels, v3 is AVX and AVX2, v4 is AVX-512.

https://en.wikipedia.org/wiki/X86-64#Microarchitecture_level...

show 1 reply
wbltoday at 12:53 AM

Extended double has some niche and quite useful for its application properties. You can for instance simulate 128 bit floats more easily with it.

grg0yesterday at 9:13 PM

Which is not to say that they are necessarily auto-vectorizing. You know wassup when you see vaddsd instead of vaddpd. And ideally you'd use AVX-512 to saturate a modern cache line if you can afford to drop support for the older devices.

icelusxlyesterday at 9:20 PM

Compilers like GCC and Clang treat C's "long double" type by default as 80-bit wide and result in x87 generated code. This can be overridden to use either 64-bit or 128-bit floating point values.