* [[openpower/isa]] - pseudo-code extracted from POWER V3.0B PDF spec
* [[openpower/gem5]]
* [[openpower/sv]]
+* [[openpower/prefix_codes]] Decode/encode prefix-codes, used by JPEG, DEFLATE, etc.
* [[openpower/opcode_regs_deduped]]
* [[openpower/simd_vsx]]
* [[openpower/ISA_WG]] - OpenPOWER ISA Working Group
--- /dev/null
+# Prefix-code encode/decode acceleration
+
+This is useful for Huffman codes, and other prefix-codes, which are used a lot in common formats:
+
+* DEFLATE (zip, png, gzip, etc.)
+* JPEG
+* MP3
+* etc.
+
+# Prefix-code decode description
+
+`pcdec RT,RA,RB,RC,imm`
+
+if `imm` is 1 TODO FIXME
+
+# [DRAFT] Prefix-code decode
+
+VA-Form
+
+* pcdec RT,RA,RB,RC,imm
+
+Pseudo-code:
+
+ tree[0:63] <- (RA)
+ in_bits[0:63] <- (RB)
+ in_pos <- (RC)
+ decoded_in_pos <- in_pos
+ output <- [0] * 64
+ out_byte <- 0
+ decoded[0:7] <- 1
+ overflow <- 0
+ do while in_pos <u 64
+ # walk the binary tree in `tree` from parent to the selected child
+ decoded <- decoded * 2 + bitstream[63 - in_pos]
+ in_pos <- in_pos + 1
+ if decoded >=u 64 then
+ overflow <- 1
+ break
+ if tree[63 - decoded] then
+ decoded_in_pos <- in_pos
+ output[56 - 8 * out_byte:63 - 8 * out_byte] <- decoded
+ decoded <- 1
+ out_byte <- out_byte + 1
+ if one | (out_byte >=u 8) then
+ break
+ RT <- output
+ RS <- decoded_in_pos
+
+Special Registers Altered:
+
+ SO OV OV32
+
+# [DRAFT] Prefix-code encode
+
+TODO
\ No newline at end of file
* [[sv/fclass]] detect class of FP numbers
* [[sv/int_fp_mv]] Move and convert GPR <-> FPR, needed for !VSX
* [[sv/av_opcodes]] scalar opcodes for Audio/Video
+* [[prefix_codes]] Decode/encode prefix-codes, used by JPEG, DEFLATE, etc.
* TODO: OpenPOWER adaptation [[openpower/transcendentals]]
Twin targetted instructions (two registers out, one implicit, just like