>> what is the meaning of this compiler define?
>> I am expecting, that Currency datatype is internaly stored using
>>Int64
>> datatype (*10000).
>> This compiler define is set for Win64, but not for Win32.
>> Does it means, that on Win32 there is Currency internaly represented
>> using another data type?
>>
>
> Correct. On all non-Win64 x86 systems the Currency type is a FPU
>based type.

x87 FPU based data types only when doing calculations inside FPU?
Am I right, that in memory layout is sam e as for Int64 on Win64 and also on Win32? When I try:

var
  c: currency:
  i: int64 absolute c;
begin
  // SizeOf(c) = SizeOf(i) = 8 on both Win32 and also Win64
  c:= <some value>;
  // then in "i" is c*10000
  writeln(i); // prints c*10000
end.

So in memory is stored always as int64 and when CPU/FPU is working with it then is converted to extended and loaded into FPU registers - FILD. And when stored back into memory FIST is used to convert value in FPU register to signed 64bit integer and stored into memory.
So it is safe to assume that in memory is Currency always stored as Int64 on Win32, Win64?

Thanks
-Laco.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to