From 9407c84692ecd62b736f0fc57da2a6b2edde0905 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 23 Aug 2020 00:45:28 +0100 Subject: [PATCH] add extra div regression tests --- src/soc/fu/div/test/test_pipe_caller.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/soc/fu/div/test/test_pipe_caller.py b/src/soc/fu/div/test/test_pipe_caller.py index def5c77f..ccd3e1b6 100644 --- a/src/soc/fu/div/test/test_pipe_caller.py +++ b/src/soc/fu/div/test/test_pipe_caller.py @@ -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 -- 2.30.2