CLMUL

Carry-less Multiply

CLMUL rd, rs1, rs2

Performs carry-less multiplication of the lower bits of rs1 and rs2. Used for CRC and GCM (crypto).

Details

CLMUL performs carry-less multiplication of rs1 and rs2, writing the lower XLEN bits of the carry-less product to rd. Used in GF(2^n) arithmetic and CRC computation.

Pseudocode Operation

R[rd] = clmul(R[rs1], R[rs2]);

Example

CLMUL x10, x11, x12

Encoding

Binary Layout
0000101
31:25
rs2
24:20
rs1
19:15
001
14:12
rd
11:7
0110011
6:0
 
Format R-Type
Opcode 0x33
Extension Zbc

Operands

  • rd
    Destination register (integer)
  • rs1
    Source register 1 (integer)
  • rs2
    Source register 2 (integer)