tags:

views:

593

answers:

4

I know that x87 has higher internal precision, which is probably the biggest difference that people see between it and SSE operations. But I have to wonder, is there any other benefit to using x87? I have a habit of typing -mfpmath=sse automatically in any project, and I wonder if I'm missing anything else that the x87 FPU offers.

+8  A: 
  1. It's present on really old machines.

EOF

Simeon Pilgrim
+2  A: 
  • There is considerable legacy and small system compatibility with the x87: SSE is a relatively new processor feature. If your code is to run on an embedded microcontroller, there's a good chance it won't support SSE instructions.

  • Even systems which don't have an FPU installed will often provide 80x87 emulators which will make the code run transparently (more or less). I don't know of any SSE emulators—certainly one of my systems doesn't have any, so the newest Adobe Photoshop elements versions refuse to run.

  • The 80x87 instructions have good parallel operation characteristics which have been thoroughly explored and analyzed since its introduction in 1982 or so. Various clones of the x86 might stall on an SSE instructions.

wallyk
So your bottom line is: (a) x87 has good legacy support (b) x87 has been well studied.
Nathan Fellman
+8  A: 

x87 has some instructions that don't exist in the SSE instruction set.

Out of the head it's all the trigonometric stuff like fsin, fcos, fatan, fatan2 and some of the exponential/logarithm stuff.

If your code spends most of the time doing trigonometry you may see a slight performance boost if you use x87. Some DSP algorithms would fall into this category.

However, for code math-code where you spend most of your time doing additions, multiplications ect. SSE is usually faster.

Nils Pipenbrinck
@LiraNuna really? I'm not aware of any opcode that directly calculate sin or cos from the SSE instruction set.
Nils Pipenbrinck
This is absolute bullshit, you can build your own sse sin/cos/tan versions and they run _much_ faster than on the fpu (especialy if you calculate 4 values at the same time)
Quonux
A: 

FPU instructions are smaller than SSE instructions, so they are ideal for demoscene stuff

Quonux