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

OBones obones at free.fr
Mon May 28 15:19:04 CEST 2012

Jonas Maebe wrote:
> On 28 May 2012, at 14:41, OBones wrote:
>> I'm compiling the program at the end of this message
> The program is missing.
Bugger, why does this keep happening to me???
Anyway, this time it is at the end.
>> I really need to have the same instruction set used for floating point maths, hence the use of SSE3 in both cases.
> If your x86-64 target is Win64, using -CfSSE2/-CfSSE3 will not result in exactly the same fpu instructions on i386 and x86-64 under all circumstances. The reason is that it is impossible to disable 80 bit extended floating point support in the i386 version of the compiler (and impossible to enable it in FPC/Win64). As a result:
> a) constants that cannot be represented exactly using double precision will still be parsed as extended precision by the compiler (and as a result, other terms in the same expression will be promoted along with it)
> b) several run time library functions and constants are declared using the most precise real type type available on the platform (i.e., extended on i386 and double on Win64)
Yes, I'm aware of that, but I want to minimize the places where 
differences can come from, so using the same instruction set helps doing 


program testFPU;


   current: Integer;
   __VARIABLE: Double;

    NS = class
      class function VARIABLE: Double;

class function NS.VARIABLE: Double;
   Result:= __VARIABLE;

function ComputeIt: Double;
   if Frac(current/NS.VARIABLE) = current/NS.VARIABLE then
     Result := Trunc(current/NS.VARIABLE)
     Result := Trunc(current/NS.VARIABLE)+1



More information about the fpc-pascal mailing list