Webcentive RISC-V Reference

vsm4k.vi

Vector SM4 KeyExpansion

Extension
Zvks, Zvksed
XLEN
RV32 and RV64
Assembly (riscv-unified-db)
vsm4k.vi vd, vs2, imm
Length
32-bit

Encoding

31262524201915141211760
1000011vs2zimm5010vd1110111

Match 0x86002077, mask 0xfe00707f. Source: vsm4k.vi 31..26=0x21 25=1 vs2 zimm5 14..12=0x2 vd 6..0=0x77 in riscv-opcodes/extensions/rv_zvksed.

FieldBitsriscv-opcodes name
vs224:20vs2
zimm519:15zimm5
vd11:7vd

Description

Performs four rounds of SM4 key expansion. Four round keys are read as a four-element group from vs2, and the next four round keys are written to vd. The round group number, 0-7, comes from imm[2:0] and selects which group of four round keys is generated; imm[4:3] are ignored. For example, imm=1 generates round keys 4, 5, 6, and 7.

Description from riscv-unified-db, reformatted.

Specification and related pages