Home/Instructions/Carry-Less Multiply Reversed
CLMULR

RISC-V CLMULR Instruction Details

Instruction ManualR-type

Carry-less multiply (reversed, for CRC)

Instruction Syntax

clmulr rd, rs1, rs2
Operand Breakdown
Destination rd: register receiving the operation result.
Source rs1: register holding the first operand.
Source rs2: register holding the second operand.
BZbcBit ManipulationCrypto

Instruction Encoding

31..25
funct7
24..20
rs2
19..15
rs1
14..12
funct3
11..7
rd
6..0
opcode

CLMULR uses opcode 0110011 (0x33), funct3 010, funct7 0000101. The rs1 and rs2 fields select the two source registers, and rd selects the destination register.

Format: R-type
opcode: 0110011 (0x33)
funct3: 010 (0x2)
funct7: 0000101 (0x05)

Instruction Behavior

clmulr returns the carry-less product bits arranged for reflected-polynomial algorithms.

Quick Understanding & Search Notes

clmulr returns the carry-less product bits arranged for reflected-polynomial algorithms.

These instructions are part of a B-extension subset and operate on XLEN-wide integer register values.
clmulr is not ordinary integer multiplication with reversed operands; it is the Zbc-defined bit selection.

Common Usage Scenarios

Crypto & Security

Understand this scenario with real code like «clmulr x10, x11, x12 ; x10 = bits[2XLEN-2:XLEN-1] of clmul product».

Multiplication & Division

Understand this scenario with real code like «clmulr x10, x11, x12 ; x10 = bits[2XLEN-2:XLEN-1] of clmul product».

Pre-Use Checklist

Syntax Check
  • Confirm the current instruction format is R-type.
  • Confirm the operand order matches the example.
Semantic Check
  • Ensure the destination register usage is compatible with the calling convention.
  • Confirm this is not the lower-level form of a pseudo-instruction expansion.

Pitfalls / Common Confusions

clmulr is not ordinary integer multiplication with reversed operands; it is the Zbc-defined bit selection.

FAQ

Does clmulr access memory?

No. It reads integer register operands and writes rd only.

Does clmulr interpret signed numbers?

These bit operations work on bit patterns directly; aside from the specified word-width selection, arithmetic signed magnitude is not used.