1 from openpower
.simulator
.program
import Program
2 from openpower
.endian
import bigendian
4 from openpower
.test
.common
import TestAccumulatorBase
7 class DivTestLong(TestAccumulatorBase
):
10 for width
in ("w", "d"):
11 for sign
in ("", "u"):
14 instrs
+= ["div" + width
+ sign
+ ov
+ cnd
,
15 "div" + width
+ "e" + sign
+ ov
+ cnd
]
16 for sign
in ("s", "u"):
17 instrs
+= ["mod" + sign
+ width
]
22 0xFFFF_FFFF_FFFF_FFFF,
23 0xFFFF_FFFF_FFFF_FFFE,
24 0x7FFF_FFFF_FFFF_FFFF,
25 0x8000_0000_0000_0000,
26 0x1234_5678_0000_0000,
27 0x1234_5678_8000_0000,
28 0x1234_5678_FFFF_FFFF,
29 0x1234_5678_7FFF_FFFF,
32 l
= [f
"{instr} 3, 1, 2"]
33 for ra
in test_values
:
34 for rb
in test_values
:
35 initial_regs
= [0] * 32
38 # use "with" so as to close the files used
39 with
Program(l
, bigendian
) as prog
:
40 self
.add_case(prog
, initial_regs
)