Does XPERM4 access memory?
No. It only rearranges bit fields or performs register lookup within integer registers.
nibble crossbar permutation (Zbkx).
Syntax: xperm4 rd, rs1, rs2; integer x0–x31 or ABI names, without an assembly immediate.
32-bit OP: funct7=0010100, funct3=010, opcode=0110011.
RV32/RV64 Zbkx; rs1 holds XLEN/4 4-bit entries, each rs2 element supplies an index, and out-of-range results are zero.
An x0 source is zero and writes to x0 are discarded. Overlap reads values before writeback; equal source registers share one value. No memory access.
XPERM4 (Zbkx) treats rs1 as a table of XLEN/4 4-bit elements and each 4-bit element of rs2 as an index. At each result position, an index below XLEN/4 selects the corresponding 4-bit element from rs1; otherwise the result element is zero.
Each 4-bit rs2 element indexes the rs1 element table; an out-of-range index produces a zero result element.
x0 is always zero; source values are read before writeback. Teaching steps are not processor cycles.
00101000110001011010010100110011x[rs2] indexes 8 entries in x[rs1]; result = 0x00000000
Shows the instruction's fixed and register fields.
XPERM4 performs register lookup: rs1 holds XLEN/4 nibble entries and each nibble of rs2 selects an entry; out-of-range indexes produce zero.
RV32 Zbkx, x11=0x89ABCDEF, x12=0x76543210: xperm4 x10, x11, x12 gives x10=0x89ABCDEF.
RV32 Zbkx, x11=0x89ABCDEF, x12=0x76543210: xperm4 x10, x11, x12 gives x10=0x89ABCDEF.
No. It only rearranges bit fields or performs register lookup within integer registers.
It belongs to the Zbkx crossbar-permutation extension.