Hello Andreas,
Am 20.03.2023 um 15:54 schrieb Andreas Enge:
Hello Michael,
I am attaching a simplified C file and the corresponding assembly
output; which I cannot read, but there are differences between the two
invocations of fprintf.
Seems that you accidentally attached the object file (binary) instead of
the assembly output. :-)
The weirdest thing is that actually the value is the integer 123. So it
should be stored in any kind of register exactly.
123 as a normalized binary floating point number would be
1.921875 × 2⁶
and you would have to represent the mantissa in binary (1.111011₂).
Still this should fit into most floating point registers easily.
But possibly the value computed by the algorithm of parsing the number
resulted in e.g.
1.111011000000000000000000000000000000000000000000000001011₂ × 2⁶
which is still 123 when converted back to a 52-bit mantissa, but
something ever so slightly larger when treated as an 80-bit float with
64 bits mantissa.
Or maybe I'm missing something :-)
Regards,
Michael