This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -mfpmath=sse -mno-80387 troubles

tbp wrote:

In latest CVS, these problems should be fixed. Please try to compile
your code with the latest CVS gcc, and if it still crashes, please file
a bugreport. If you spot an x87 constant, please add a testcase to
PR19653. However ...

Ok, will do tomorrow.

Just a note - do not use -mno-80387 if you are calling external math functions. This option now implies -mno-fp-ret-in-387 and it will introduce an ABI mismatch. The goal is that -mfpmath=sse should be enough to prevent unnecessary x87 code.

BTW: I don't think that x87 should be fully disabled for -mfpmath=sse. st(0) can be used as a temporary storage for memory-to-memory transfers. Also, it can do on-the-fly FP extending and truncating, without touching a SSE reg:

movsd (%eax),xmm1      # ~7 cycles
cvtsd2ss xmm1,(%esp)   # 14 cycles

could be implemented by:
fldl (%eax)   # ~7cycles
fstps (%esp) # ~7cycles

There is nothing wrong, if fldl is replaced with fldz or fld1. The performance problems will arise in case when memory location is used in subsequent SSE computations. In this case, it would be better if zero is "generated" in SSE register and stored to memory from SSE reg.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]