1 <!-- https://libre-soc.org/openpower/prefix_codes/ -->
3 # [DRAFT] Prefix-code decode
7 * pcdec. RT,RA,RB,RC,once
13 in_bits[0:63] <- (RC|0)
16 final_in_bits <- in_bits
17 final_ra_used <- ra_used
26 if ra_used | (_RA = 0) then
28 if decoded != 1 then # error: stopped in the middle of a code
33 in_bits <- 0b1 || (RA)[0:62]
35 in_bits <- 0b0 || in_bits[0:62]
36 # walk the binary tree in `tree` from parent to the selected child
37 decoded <- decoded[1:7] || in_bit
39 if tree[63 - decoded] then
40 final_in_bits <- in_bits
41 final_ra_used <- ra_used
42 output[56 - 8 * out_byte:63 - 8 * out_byte] <- decoded
44 out_byte <- out_byte + 1
53 CR0 <- final_ra_used || (output = 0) || early_stop || so_bit
55 Special Registers Altered: