add regression test for completely borked value from mulhd
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 5 Jul 2022 13:04:24 +0000 (14:04 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 5 Jul 2022 13:04:24 +0000 (14:04 +0100)
https://bugs.libre-soc.org/show_bug.cgi?id=855

src/openpower/test/mul/mul_cases.py

index ea0b997405b8ef23fec6ac738237bc4fbfb04e6e..7b751f9200708a99699eb5b9f9024a3e6c30a0e0 100644 (file)
@@ -1,11 +1,22 @@
 from openpower.simulator.program import Program
 from openpower.endian import bigendian
 from openpower.test.common import TestAccumulatorBase, skip_case
+from openpower.test.state import ExpectedState
 
 import random
 
 
 class MulTestCases2Arg(TestAccumulatorBase):
+
+    def case_kestrel_regression_0(self):
+        lst = ["mulhd r30,r9,r30"]
+        initial_regs = [0] * 32
+        initial_regs[30] = 0x20c49ba5e353f7cf
+        initial_regs[9] = 0x1f40
+        e = ExpectedState(initial_regs, 4)
+        e.intregs[30] = 0x400
+        self.add_case(Program(lst, bigendian), initial_regs, expected=e)
+
     def case_0_mullw(self):
         lst = [f"mullw 3, 1, 2"]
         initial_regs = [0] * 32