move div tests to openpower.test
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 23 Apr 2021 18:38:35 +0000 (19:38 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 23 Apr 2021 18:38:35 +0000 (19:38 +0100)
src/soc/fu/div/test/test_pipe_caller_long.py

index 4739842fa016fa0500d6e3302f8517b645f2a21c..5b360108fe4cc3fc9f38a2ea25cb904ccc41ef7a 100644 (file)
@@ -1,46 +1,9 @@
 import unittest
-from openpower.simulator.program import Program
-from openpower.endian import bigendian
 
-from openpower.test.common import TestAccumulatorBase
 from soc.fu.div.test.helper import DivTestHelper
 from soc.fu.div.pipe_data import DivPipeKind
 
-
-class DivTestLong(TestAccumulatorBase):
-    def case_all(self):
-        instrs = []
-        for width in ("w", "d"):
-            for sign in ("", "u"):
-                for ov in ("", "o"):
-                    for cnd in ("", "."):
-                        instrs += ["div" + width + sign + ov + cnd,
-                                   "div" + width + "e" + sign + ov + cnd]
-            for sign in ("s", "u"):
-                instrs += ["mod" + sign + width]
-        test_values = [
-            0x0,
-            0x1,
-            0x2,
-            0xFFFF_FFFF_FFFF_FFFF,
-            0xFFFF_FFFF_FFFF_FFFE,
-            0x7FFF_FFFF_FFFF_FFFF,
-            0x8000_0000_0000_0000,
-            0x1234_5678_0000_0000,
-            0x1234_5678_8000_0000,
-            0x1234_5678_FFFF_FFFF,
-            0x1234_5678_7FFF_FFFF,
-        ]
-        for instr in instrs:
-            l = [f"{instr} 3, 1, 2"]
-            for ra in test_values:
-                for rb in test_values:
-                    initial_regs = [0] * 32
-                    initial_regs[1] = ra
-                    initial_regs[2] = rb
-                    # use "with" so as to close the files used
-                    with Program(l, bigendian) as prog:
-                        self.add_case(prog, initial_regs)
+from openpower.test.div.long_div_cases import DivTestLong
 
 
 class TestPipeLong(DivTestHelper):