add extra div regression tests
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 22 Aug 2020 23:45:28 +0000 (00:45 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 22 Aug 2020 23:46:19 +0000 (00:46 +0100)
src/soc/fu/div/test/test_pipe_caller.py

index def5c77fcd00a458aef74e79e9fca3dc789d27a7..ccd3e1b686b6b9751c6d8b4187b1768599fe455f 100644 (file)
@@ -21,6 +21,17 @@ class DivTestCases(TestAccumulatorBase):
         with Program(lst, bigendian) as prog:
             self.add_case(prog, initial_regs)
 
+    def case_divduo_regression(self):
+        lst = [f"divduo. 11, 20, 6"]
+        initial_regs = [0] * 32
+        #gpr: 00ff00ff00ff0080 <- r6
+        #gpr: 000000000000007f <- r11
+        #gpr: 7f6e5d4c3b2a1908 <- r20
+        initial_regs[6] = 0x00ff00ff00ff0080
+        initial_regs[20] = 0x7f6e5d4c3b2a1908
+        with Program(lst, bigendian) as prog:
+            self.add_case(prog, initial_regs)
+
     def case_0_regression(self):
         for i in range(40):
             lst = ["divwo 3, 1, 2"]
@@ -119,6 +130,14 @@ class DivTestCases(TestAccumulatorBase):
         with Program(lst, bigendian) as prog:
             self.add_case(prog, initial_regs)
 
+    def case_11_regression(self):
+        lst = ["divwo. 3, 1, 2"]
+        initial_regs = [0] * 32
+        initial_regs[1] = 0xffffffffffffffff
+        initial_regs[2] = 0xffffffffffffffff
+        with Program(lst, bigendian) as prog:
+            self.add_case(prog, initial_regs)
+
     def case_divw_by_zero_1(self):
         lst = ["divw. 3, 1, 2"]
         initial_regs = [0] * 32