unzip
Bit deinterleave
This instruction is defined by:
-
Zbkb, version >= Zbkb@1.0.0
This instruction is included in the following profiles:
-
RVA22S64 (Optional)
-
RVA22U64 (Optional)
-
RVA23M64 (Optional)
-
RVA23S64 (Optional)
-
RVB23M64 (Optional)
-
RVB23S64 (Optional)
-
RVB23U64 (Optional)
Synopsis
This instruction 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.
Execution
-
IDL
-
Sail
XReg input = X[rs1];
XReg output = 0;
for (U32 i = 0; i < (%%LINK%func;xlen;xlen%%() / 2 - 1); i = i + 1) {
output[i] = input[2 * i];
output[i + %%LINK%func;xlen;xlen%%() / 2] = input[2 * i + 1];
}
X[rd] = output;
foreach (i from 0 to xlen/2-1) {
X(rd)[i] = X(rs1)[2*i];
X(rd)[i+xlen/2] = X(rs1)[2*i+1];
}