Home/Instructions/VNCLIP-WV
VNCLIP.WV

RISC-V VNCLIP.WV Instruction Details

Instruction ManualR-type

signed 2*SEW-to-SEW narrowing clip with vxrm rounding and saturation.

Instruction Syntax

vnclip.wv vd, vs2, vs1, vm
Operand Breakdown
Destination rd: register receiving the operation result.
Source rs1: register holding the first operand.
Source rs2: register holding the second operand.
VVector Fixed-PointNarrowing/Clip

Instruction Behavior

VNCLIP.WV right-shifts 2*SEW source elements by the selected amount, rounds according to vxrm, narrows to SEW, and saturates to the signed destination range; saturation sets vxsat.

Quick Understanding & Search Notes

VNCLIP.WV is an RVV fixed-point narrowing clip instruction for converting wide intermediate results back to SEW-width signed data.

Source elements are 2*SEW wide and destination elements are SEW wide.
Rounding is controlled by vxrm; this is not an ordinary logical right shift.
Out-of-range results saturate to the destination range and set the vxsat saturation flag.

Common Usage Scenarios

Fixed-Point Conversion

Understand this scenario with real code like «vnclip.wv v8, v12, v4, v0.t».

Precision Reduction

Understand this scenario with real code like «vnclip.wv v8, v12, v4, v0.t».

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

Rounding by vxrm (rnu/rne/rdn/rod), not frm
Source 2*SEW, dest SEW; EMUL changes
Sets vxsat on saturation

FAQ

How is VNCLIP.WV different from VNSRL/VNSRA?

VNCLIP rounds according to vxrm and saturates; VNSRL/VNSRA are narrowing right shifts without saturation clipping.