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 that.

==================================================================

program testFPU;

uses
   Math;

var
  current: Integer;
  __VARIABLE: Double;

type
   NS = class
     class function VARIABLE: Double;
   end;

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

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

begin

end.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to