[Lazarus] AGG missing 3 asm conversions to work on 64-bit CPU's

Hans-Peter Diettrich DrDiettrich1 at aol.com
Fri Mar 9 11:51:17 CET 2012


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





More information about the Lazarus mailing list