Graeme Geldenhuys schrieb:
For example, here is a one method that is often called, but because
there is no 64-bit x86_64 implementation, the agg output is not
correct (compared to the 32-bit version of my program).
IMO the Delphi implementation is already broken, because it doesn't
respect the signedness of the argument, so that the description
"SHR n is equivalent to DIV 2^n"
doesn't hold.
// SHR for signed integers is differently implemented in pascal compilers
// than in c++ compilers. On the assembler level, c++ is using the SAR and
// pascal is using SHR. That gives completely different result, when the
// number is negative. We have to be compatible with c++ implementation,
// thus instead of directly using SHR we emulate c++ solution.
IMO this should read
"SHR is broken for signed integers in *Delphi*, so we need a correct
additional implementation..."
DoDi
--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus