zip
Bit interleave
Encoding
| 3125 | 2420 | 1915 | 1412 | 117 | 62 | 10 | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0000100 | 01111 | rs1 | 001 | rd | 00100 | 11 | |||||||||||||||||||||||||
Match 0x08f01013, mask 0xfff0707f. Source: zip rd rs1 31..25=4 24..20=15 14..12=1 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
Scatters all of the odd and even bits of a source word into the high and low halves of a destination word. It is the inverse of the unzip 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[2*i] = input[i];
output[2*i+1] = input[i+xlen()/2];
}
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/zip.yaml
- Zbkb instruction listing
- Zk instruction listing
- Zkn instruction listing
- Zks instruction listing