powmod asm tests pass!
authorJacob Lifshay <programmerjake@gmail.com>
Tue, 17 Oct 2023 05:22:50 +0000 (22:22 -0700)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 1 Dec 2023 17:58:20 +0000 (17:58 +0000)
src/openpower/test/bigint/powmod.py

index 56f48ffff18269043358c78f4c0a16a5187ecfc9..7fc794685bebb1f3c2451c64da041a0e81143e29 100644 (file)
@@ -1217,7 +1217,6 @@ class PowModCases(TestAccumulatorBase):
             base %= mod
             yield (base, exp, mod)
 
-    @skip_case("FIXME: divmod is too slow to test powmod")
     def case_powmod_256(self):
         for base, exp, mod in PowModCases.powmod_256_test_inputs():
             expected = pow(base, exp, mod)
@@ -1234,10 +1233,15 @@ class PowModCases(TestAccumulatorBase):
                 for i in range(4):
                     # write d in LE order to regs 32-35
                     initial_regs[32 + i] = (mod >> (64 * i)) % 2**64
-                # only check regs up to r7 since that's where the output is.
                 # don't check CR
-                e = ExpectedState(int_regs=initial_regs[:8], crregs=0)
+                e = ExpectedState(int_regs=initial_regs, crregs=0)
+                for i in range(128):
+                    nonvolatile = 14 <= i <= 31
+                    if nonvolatile or i in (1, 2, 13):
+                        continue
+                    e.intregs[i] = None
                 e.ca = None  # ignored
+                e.sprs['SVSHAPE0'] = None
                 for i in range(4):
                     # write output in LE order to regs 4-7
                     e.intregs[4 + i] = (expected >> (64 * i)) % 2**64