more cleanup after swapping RA/RB for pcdec.
authorJacob Lifshay <programmerjake@gmail.com>
Mon, 26 Sep 2022 21:50:34 +0000 (14:50 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Mon, 26 Sep 2022 21:50:34 +0000 (14:50 -0700)
openpower/isa/prefix_codes.mdwn
src/openpower/test/prefix_codes/prefix_codes_cases.py

index 20cdb9c37a8adc6f692f26e04c8b75c397e1df0a..88606e7b4f1af0914369e3fbbe903a7980a1bc63 100644 (file)
@@ -9,12 +9,12 @@ VA2-Form
 Pseudo-code:
 
     tree[0:63] <- (RB)
-    rb_used <- 0b0
+    ra_used <- 0b0
     in_bits[0:63] <- (RC|0)
     if in_bits = 0 then
         in_bits[0:63] <- 1
     final_in_bits <- in_bits
-    final_rb_used <- rb_used
+    final_ra_used <- ra_used
     output <- [0] * 64
     out_byte <- 0
     decoded[0:7] <- 1
@@ -22,9 +22,9 @@ Pseudo-code:
     do while out_byte < 8
         in_bit <- in_bits[63]
         if in_bits = 1 then
-            if rb_used | (_RA = 0) then
+            if ra_used | (_RA = 0) then
                 leave
-            rb_used <- 0b1
+            ra_used <- 0b1
             in_bit <- (RA)[63]
             in_bits <- 0b1 || (RA)[0:62]
         else
@@ -34,7 +34,7 @@ Pseudo-code:
         if decoded <u 64 then
             if tree[63 - decoded] then
                 final_in_bits <- in_bits
-                final_rb_used <- rb_used
+                final_ra_used <- ra_used
                 output[56 - 8 * out_byte:63 - 8 * out_byte] <- decoded
                 decoded[0:7] <- 1
                 out_byte <- out_byte + 1
@@ -45,7 +45,7 @@ Pseudo-code:
             leave
     RT <- output
     RS <- final_in_bits
-    CR0 <- final_rb_used || 0b0 || (output = 0) || so_bit
+    CR0 <- final_ra_used || 0b0 || (output = 0) || so_bit
 
 Special Registers Altered:
 
index 4784b72c5a9c254e7e6d343ce25b5ddf6b71e7af..a6fc71de84ef276600edac80cc7ecc8818af50d3 100644 (file)
@@ -65,7 +65,7 @@ class PrefixCodesCases(TestAccumulatorBase):
         expected_RT = int.from_bytes(
             [int("1" + code, 2) for code in decoded], 'little')
         decoded_bits_len = len("".join(decoded))
-        expected_rb_used = False
+        expected_ra_used = False
         RB_val = make_tree(*supported_codes)
         rev_input_bits = input_bits[::-1]
         RA_val = 0
@@ -75,8 +75,8 @@ class PrefixCodesCases(TestAccumulatorBase):
             RA_val = int(rev_input_bits[:64], 2)
             RA = 7
             rev_input_bits = rev_input_bits[64:]
-            expected_rb_used = decoded_bits_len > len(rev_input_bits)
-            if expected_rb_used:
+            expected_ra_used = decoded_bits_len > len(rev_input_bits)
+            if expected_ra_used:
                 expected_RS = (RA_val + 2 ** 64) >> decoded_bits_len
         RC_val = int("1" + rev_input_bits, 2)
         if expected_RS is None:
@@ -90,7 +90,7 @@ class PrefixCodesCases(TestAccumulatorBase):
         e = ExpectedState(pc=4, int_regs=gprs)
         e.intregs[4] = expected_RT
         e.intregs[5] = expected_RS
-        e.crregs[0] = expected_rb_used * 8 + expected_EQ * 2 + expected_SO
+        e.crregs[0] = expected_ra_used * 8 + expected_EQ * 2 + expected_SO
         with self.subTest(supported_codes=supported_codes,
                           input_bits=original_input_bits):
             self.add_case(Program(lst, False), gprs, expected=e,