Re: [fpc-devel] Signed division

2018-06-01 Thread J. Gareth Moreton
Aah, thank you. That clears things up. Hooray for documentation! It's the same as suspected and listed below. (and I noticed a mistake. I meant to say only if the numerator (left-hand side operand) is negative, not positive) Gareth aka. Kit On Fri 01/06/18 12:42 , "Christo Crause" christo.

Re: [fpc-devel] Signed division

2018-06-01 Thread Christo Crause
On Fri, Jun 1, 2018 at 11:13 AM, J. Gareth Moreton < gar...@moreton-family.com> wrote: > Hi everyone, > > I'm starting to make some modifications to the optimizer so it optimises > div and mod operations on signed integers (I've done unsigned integers > already). One question that I've stumbled ac

[fpc-devel] Signed division

2018-06-01 Thread J. Gareth Moreton
Hi everyone, I'm starting to make some modifications to the optimizer so it optimises div and mod operations on signed integers (I've done unsigned integers already). One question that I've stumbled across... what are the rules regarding the sign of the result?  Experimenting with IDIV suggests