unzip
Bit deinterleave
Encoding
| 3125 | 2420 | 1915 | 1412 | 117 | 62 | 10 | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0000100 | 01111 | rs1 | 101 | rd | 00100 | 11 | |||||||||||||||||||||||||
Match 0x08f05013, mask 0xfff0707f. Source: unzip rd rs1 31..25=4 24..20=15 14..12=5 6..2=4 1..0=3 in riscv-opcodes/extensions/rv32_zbkb.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| rs1 | 19:15 | rs1 |
| rd | 11:7 | rd |
Description
Gathers bits from the high and low halves of the source word into odd/even bit positions in the destination word. It is the inverse of the zip instruction. This instruction is available only on RV32.
Description from riscv-unified-db, reformatted.
Operation
XReg input = X[xs1];
XReg output = 0;
for(U32 i=0; i < (xlen()/2); i = i+1) {
output[i] = input[2*i];
output[i+xlen()/2] = input[2*i+1];
}
X[xd] = output;Pseudocode in riscv-unified-db’s IDL, quoted unchanged.
Specification and related pages
- The RISC-V Instruction Set Manual: src/unpriv/zbkb.adoc (Zbkb)
- The RISC-V Instruction Set Manual: src/unpriv/zk.adoc (Zk)
- The RISC-V Instruction Set Manual: src/unpriv/zk.adoc (Zkn)
- The RISC-V Instruction Set Manual: src/unpriv/zk.adoc (Zks)
- riscv-unified-db: spec/std/isa/inst/Zbkb/unzip.yaml
- Zbkb instruction listing
- Zk instruction listing
- Zkn instruction listing
- Zks instruction listing