VROL.VX

RISC-V VROL.VX Instruction Details

Instruction ManualR-type

Vector rotate left by scalar amount; each vs2 element uses the low log2(SEW) bits of the amount.

Instruction Syntax

vrol.vx vd, vs2, rs1, vm
Operand Breakdown
Destination rd: register receiving the operation result.
Source rs1: register holding the first operand.
Source rs2: register holding the second operand.
ZvbbVector Bit Manipulation

Instruction Behavior

VROL.VX is a Zvbb vector rotate-left instruction. Each active element takes data from vs2 and rotates it by the amount from x[rs1]; only the low log2(SEW) bits of the amount are used.

Quick Understanding & Search Notes

VROL.VX performs a Zvbb rotate left on each active element; the scalar operand supplies only the rotate amount and data comes from vs2.

Only the low log2(SEW) bits of the amount are used; no extra rotation beyond SEW is represented.
There is no official vrol.vi; immediate rotate-left can be expressed through vror.vi with the complementary amount.

Common Usage Scenarios

Crypto & Security

Understand this scenario with real code like «vrol.vx vd, vs2, a1».

Vector Acceleration

Understand this scenario with real code like «vrol.vx vd, vs2, a1».

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

This is rotate left; shifted-out bits wrap around rather than being discarded.
The rotate amount is truncated to the element width through the low log2(SEW) bits.
It follows V-extension vl, vstart, vtype, and optional vm mask rules.

FAQ

Does VROL.VX change element width?

No. The result element width remains the current SEW.

How is VROL.VX different from VWSLL?

Rotate keeps the same width and wraps bits; VWSLL is a widening logical left shift with a 2*SEW destination.