[Libre-soc-bugs] [Bug 396] create simulator PowerISA div/mod functions
bugzilla-daemon at libre-soc.org
bugzilla-daemon at libre-soc.org
Thu Jun 25 18:13:16 BST 2020
https://bugs.libre-soc.org/show_bug.cgi?id=396
--- Comment #5 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Jacob Lifshay from comment #4)
> (In reply to Luke Kenneth Casson Leighton from comment #3)
> > jacob can i ask you if you could check something:
> >
> > can you write a function that multiplies the result by the divisor
> > and checks that the result is equal to the dividend in all cases
> > where overflow is *not* true, and conversely when it is not equal
> > that the overflow *is* true?
>
> That's incorrect, as the simple example of 3/2 will show:
>
> 3/2 -> 1
> 1*2 == 2 != 3
drat. oh wait! plus the modulo. if you add the modulo that brings it
to par.
but... hmmm that means computing the modulo in tandem.
i'm looking for ways to avoid having to reproduce the entire computation
just to calculate the overflow.
the alternative - which i am not happy about - is to modify the pseudocode
to return an overflow flag and detect the condition *in* the pseudocode
itself.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the libre-soc-bugs
mailing list