[fpc-pascal] Error in x32 compiler when using SSE3

Jonas Maebe jonas.maebe at elis.ugent.be
Mon May 28 15:50:44 CEST 2012

On 28 May 2012, at 15:19, OBones wrote:

> Bugger, why does this keep happening to me???
> Anyway, this time it is at the end.

I cannot reproduce the problem with 2.6.0/2.7.1 on Mac OS X/i386, nor with 2.7.1 on Linux/i386. I even don't see any comis* instructions in the code, the comparison is performed by the x87 fpu because frac() returns an extended result on i386. The only way I can get a comisd, is
a) when targeting Win64/x86-64, but then it's a "comisd reg,reg" instruction
b) when compiling in ObjFPC mode rather than Delphi mode and compiling for i386, and adding an explicit double() typecast around the result of frac (that's not possible in Delphi mode, because Delphi does not allow changing the precision of floating point expressions via explicit typecasts). Then I do see a "comisd ref, reg", but it compiles fine here with 2.7.1 for Mac OS X/i386 and Linux/i386 (I don't have a 2.6.0 rtl for Linux or Win32 handy to test).


More information about the fpc-pascal mailing list