swap RA/RB so that RA|0 is used not RB|0
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 26 Sep 2022 11:03:07 +0000 (12:03 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 26 Sep 2022 11:03:07 +0000 (12:03 +0100)
RB|0 would need a new flag to be passed down to ALUs in HDL

openpower/isa/prefix_codes.mdwn
src/openpower/test/prefix_codes/prefix_codes_cases.py

index ab6c2c6bcd82f89e2fa5c382311ac9b183ee379f..f5cb1b508502aa8aa2b31fefdbbb388b3a7e107c 100644 (file)
@@ -1,6 +1,6 @@
 <!-- https://libre-soc.org/openpower/prefix_codes/ -->
 
-# [DRAFT] Prefix-code decode
+# [DRBFT] Prefix-code decode
 
 VA2-Form
 
@@ -8,7 +8,7 @@ VA2-Form
 
 Pseudo-code:
 
-    tree[0:63] <- (RA)
+    tree[0:63] <- (RB)
     rb_used <- 0b0
     in_bits[0:63] <- (RC|0)
     if in_bits = 0 then
@@ -22,11 +22,11 @@ Pseudo-code:
     do while out_byte < 8
         in_bit <- in_bits[63]
         if in_bits = 1 then
-            if rb_used | (_RB = 0) then
+            if rb_used | (_RA = 0) then
                 leave
             rb_used <- 0b1
-            in_bit <- (RB)[63]
-            in_bits <- 0b1 || (RB)[0:62]
+            in_bit <- (RA)[63]
+            in_bits <- 0b1 || (RA)[0:62]
         else
             in_bits <- 0b0 || in_bits[0:62]
         # walk the binary tree in `tree` from parent to the selected child
index 0f8a72aa70f06aec9f5a15d695bda3b8d917c4e5..088d2d9d6e318b92fdeaf50cf411504a1e2f0231 100644 (file)
@@ -81,7 +81,7 @@ class PrefixCodesCases(TestAccumulatorBase):
         RC_val = int("1" + rev_input_bits, 2)
         if expected_RS is None:
             expected_RS = RC_val >> decoded_bits_len
-        lst = list(SVP64Asm([f"pcdec. 4,6,{RB},5,0"]))
+        lst = list(SVP64Asm([f"pcdec. 4,{RB},6,5,0"]))
         gprs = [0] * 32
         gprs[6] = RA_val
         if RB: