4 ms·
The FPU stack is only 8 entries in x86-64, yes, but the 128-bit SSE float/SIMD register set was indeed expanded to 16 entries, just like the GPRs (rax, rcx etc)
by hrydgard 10y ago
The FPU stack is only 8 entries in x86-64, yes, but the 128-bit SSE float/SIMD register set was indeed expanded to 16 entries, just like the GPRs (rax, rcx etc). The FPU stack is legacy and is barely used anymore, instead most floating point operations are done with SSE instructions.
- wolfgke 10y ago> The FPU stack is legacy and is barely used anymore I know that if you implement an algorithm via SSE/AVX it typically is much faster than if you use the FPU. But I still believe that the FPU has its uses: For example it also supports 80 bit precision floating point numbers, while SSE/AVX only support 32 or 64 bit ones. There are applications where this capability can be quite useful. This is one reason why the FPU is still supported (and sometimes used) in 64 bit mode.
- hrydgard 10y agoYes, it has its occasional uses and is still supported, but the point is that x86-64 got a noticable FP capability boost through the doubling of the SSE registers compared to 32-bit x86. SSE is not just for SIMD, it has single/double scalar instructions as well, which mostly replace the old FPU. If you look at generic floating point code generated for x86 by any modern C/C++ compiler, you won't see any FPU use, it's all SSE scalar, and occasionally SIMD for clever compilers.
- phkahler 10y agoThere was a nice thread last week about bugs due to the internal 80-bit representation in the old FPU. IMHO it should have been deprecated long ago and x64_64 should have disallowed its use entirely. There are 128bit FP these days implemented with new hardware and instructions.