[fpc-devel] Extended($FFFFFFFFFFFFFFFF) = -1?

Jonas Maebe jonas.maebe at elis.ugent.be
Mon Mar 3 18:02:35 CET 2014


On 03 Mar 2014, at 17:43, Ewald wrote:

> 
> On 03 Mar 2014, at 12:49, Hans-Peter Diettrich wrote:
> 
>> What you observed was related to the argument passed to WriteLn. When WriteLn includes code to output a QWord, then the output should reflect the bitpattern (unsigned number). The output of an Extended value reflects the value converted from integral to floating point, and that conversion assumes signed values. IIRC the x87 FPU doesn't have an instruction to load unsigned integral values, so that no compiler has a chance to make it load an unsigned value.
> 
> Alright, that I did not know. Thanks for the info. I always assumed there was an instruction FULD, but it isn't there apparently.

Nevertheless, Hans-Peter's statement is wrong. FPC can perfectly convert any qword value into an extended value. It's not because something cannot be done using a single instruction, that it cannot be done at all.


Jonas


More information about the fpc-devel mailing list