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.
ZbcBit ManipulationCrypto

Instruction Behavior

clmulr returns bits 2*XLEN-2:XLEN-1 of the 2*XLEN carry-less product and can accelerate CRC calculations.

CLMULR Decode & Execute Animation

This model shows ISA-visible GF(2) XOR partial products; it does not model integer carries, a pipeline, or a cryptographic protocol.

Execution context
32-bit encoding fields
31..25
funct7
0000101
24..20
rs2
01100
19..15
rs1
01011
14..12
funct3
010
11..7
rd
01010
6..0
opcode
0110011
Execution data path

funct7=0000101, funct3=010

x10 <- pending

Quick Understanding & Search Notes

clmulr returns bits 2*XLEN-2:XLEN-1 of the 2*XLEN carry-less product and can accelerate CRC calculations.

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

Bit Manipulation

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
  • Verify rd, rs1, rs2 (and rs3) are valid GPRs.
  • Confirm funct3 and funct7 encoding is correct.
Semantic Check
  • Check if the result affects subsequent branches or address calculations.
  • Ensure the rd register is not overwritten by another instruction.

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.