apply pseudo-code corrections
authorJacob Lifshay <programmerjake@gmail.com>
Thu, 22 Sep 2022 23:11:51 +0000 (16:11 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Thu, 22 Sep 2022 23:11:51 +0000 (16:11 -0700)
openpower/prefix_codes.mdwn

index 51575195be2c96a965dcb9225d255d9a2a96ab79..f09760179ab035fdaf7529bced82c0b220b8fc81 100644 (file)
@@ -68,8 +68,7 @@ Pseudo-code:
     overflow <- 0
     do while in_pos <u 64
         # walk the binary tree in `tree` from parent to the selected child
-        # XXX should this be "in-_bits" not "bitstream"?
-        decoded <- decoded * 2 + bitstream[63 - in_pos]
+        decoded <- decoded * 2 + in_bits[63 - in_pos]
         in_pos <- in_pos + 1
         if decoded >=u 64 then
             overflow <- 1
@@ -79,8 +78,7 @@ Pseudo-code:
             output[56 - 8 * out_byte:63 - 8 * out_byte] <- decoded
             decoded <- 1
             out_byte <- out_byte + 1
-            # XXX if one? if "imm"?
-            if one | (out_byte >=u 8) then
+            if imm | (out_byte >=u 8) then
                 break
     RT <- output
     RS <- decoded_in_pos