1 <!-- https://libre-soc.org/openpower/prefix_codes/ -->
3 # [DRAFT] Prefix-code decode
15 in_bits[0:63] <- (RC|0)
18 orig_in_bits <- in_bits
22 do bit_length = 1 to 6
25 if ra_used | (_RA = 0) then
30 in_bits <- 0b1 || (RA)[0:62]
32 in_bits <- 0b0 || in_bits[0:62]
33 # walk the binary tree in `tree` from parent to the selected child
34 tree_index <- tree_index * 2
36 tree_index <- tree_index + 1
37 if tree_index < 64 then
38 if tree[63 - tree_index] then
50 if i = tree_index then
53 compressed_index <- compressed_index + possible
54 else if tree[63 - i] = 1 then
55 compressed_index <- compressed_index + possible
58 RT[0:63] <- tree_index
60 in_bits <- orig_in_bits
63 RT[0:63] <- tree_index
65 in_bits <- orig_in_bits
68 RT[0:63] <- compressed_index
70 in_bits <- orig_in_bits
72 RT[0:63] <- tree_index
74 RT[0:63] <- compressed_index
76 in_bits <- orig_in_bits
79 CR0 <- ra_used || (tree_index >= 64) || found || hit_end
81 Special Registers Altered: