Does XPERM4 access memory?
No. It only rearranges bit fields or performs register lookup within integer registers.
nibble crossbar permutation (Zbkx).
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.
00101000110001011010010100110011x[rs2] indexes 8 entries in x[rs1]; result = 0x00000000
Shows the instruction's fixed and register fields.
XPERM4 is a Zbkx cross-register permutation instruction; this page follows the official B-extension operation.
Understand this scenario with real code like «xperm4 a0, a1, a2».
Understand this scenario with real code like «xperm4 a0, a1, a2».
No. It only rearranges bit fields or performs register lookup within integer registers.
It belongs to the Zbkx crossbar-permutation extension.