What is the alternative to an FPU on x86-64?

The code that performs calculations on floating-point numbers uses different extensions on x86 and x86-64 systems. On x86, this is an FPU, and on x86-64?

Author: drkwdck, 2020-11-23

1 answers

They are the same.
In both modes, you can use two sets of instructions: x87 (what is apparently called an FPU in the question) and SSE(including subsequent extensions: SSE2/3/4 Of course, provided that a particular processor supports these extensions: x87 is built into everything since the i486, and SSE[2] in all general-purpose CPUs since the Pentium 4.

For x86_64 there are minor differences, but they do not change the essence. For example, for SSE in long mode available 16 registers (%xmm0-%xmm15), and not 8.

Also, some compilers (gcc in particular) for building under x86-target usually use arithmetic based on x87 by default, and when building under x86_64 - SSE.* For more information, see the options documentation gcc -mfpmath and -ffast-math. Most other modern compilers usually use SSE-arithmetic by default, and for x86 - goals.


* Thank you @Eugene Ryabtsev for clarifying
 4
Author: Fat-Zer, 2020-11-23 10:05:57