Re: [fpc-devel] The "magic div" algorithm

2021-09-10 Thread J. Gareth Moreton via fpc-devel
This one is for Marģers especially: https://gitlab.com/freepascal.org/fpc/source/-/issues/39355 Gareth aka. Kit -- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus ___ fpc-devel maillist - fpc-de

[fpc-devel] Division optimisations

2021-09-10 Thread J. Gareth Moreton via fpc-devel
Hi everyone, I'm looking at ways to optimise div and mod, starting with x86 and then probably AArch64.  The obvious one is attempting to merge "Q := N div D; R := N mod D;", where D is a variable (but invariant between the two instructions), since DIV returns the quotient in R/EAX and the rema

Re: [fpc-devel] Division optimisations

2021-09-10 Thread Florian Klämpfl via fpc-devel
Am 10.09.21 um 21:17 schrieb J. Gareth Moreton via fpc-devel: Hi everyone, I'm looking at ways to optimise div and mod, starting with x86 and then probably AArch64.  The obvious one is attempting to merge "Q := N div D; R := N mod D;", where D is a variable (but invariant between the two inst

Re: [fpc-devel] Division optimisations

2021-09-10 Thread J. Gareth Moreton via fpc-devel
I suppose in truth, I can, and that in itself is probably fairly cross-platform (although I'll stick with x86 for the moment and get that working).  Sometimes the simple solution eludes me!  Is there anything I need to take into account when it comes to range checking (that is, if a third party