[Libre-soc-bugs] [Bug 425] DIV overflow not being calculated correctly

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Jul 10 11:26:33 BST 2020


--- Comment #10 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
ok so that translation worked.  that resulted in that particular
regression "working".  however on re-enabling the random testing
(s/def tst_/def test_/g) _another_ test came up (test_7_regression)
which this time is when overflow *should* be set (according to the
simulator) but that the overflow detection (microwatt-style this
time) is *not* detecting.

the input:

    def test_7_regression(self):
        # https://bugs.libre-soc.org/show_bug.cgi?id=425
        lst = ["divw. 3, 1, 2"]
        initial_regs = [0] * 32
        initial_regs[1] = 0xf1791627e05e8096
        initial_regs[2] = 0xffc868bf4573da0b
        self.run_tst_program(Program(lst), initial_regs)

the hardware output (from the debug output):

     res output {'cr_a': 2, 'xer_ov': 0, 'o': 0, 'xer_so': 0}

the simulator output (from the debug output)

     sim output {'o': 0, 'cr_a': 3, 'xer_ov': 1, 'xer_so': 1}

cr_a[1] is correct - the output is zero.
cr_a[0] contains a copy of XER.ov which is wrong.

actually the sim output might be wrong, here.  it should never be
set to 0b1.  the two legal values are 0b00 and 0b11, NEVER 0b01.

You are receiving this mail because:
You are on the CC list for the bug.

More information about the libre-soc-bugs mailing list