PACK
Pack two words into a register
PACK rd, rs1, rs2
Packs the lower halves of rs1 and rs2 into rd.
Encoding
Binary Layout
0000100
31:25
rs2
24:20
rs1
19:15
100
14:12
rd
11:7
0110011
6:0
Operands
-
rd
Destination register (integer) -
rs1
Lower Half -
rs2
Upper Half
Example
PACK t0, a0, a1
Related
More in Zbkb
Reference
View in RISC-V Unprivileged ISA Specification ↗
RISC-V ISA Manual
Description
Pack two words into a register: Packs the lower halves of rs1 and rs2 into rd. Operation: R[rd] = (R[rs2] << XLEN/2) | (R[rs1] & ((1 << XLEN/2)-1));.
Operation
R[rd] = (R[rs2] << XLEN/2) | (R[rs1] & ((1 << XLEN/2)-1));