Home/Instructions/VNCLIP-WI
VNCLIP.WI

RISC-V VNCLIP.WI Instruction Details

Instruction ManualI-type

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

Instruction Syntax

vnclip.wi vd, vs2, uimm, vm
Operand Breakdown
Destination rd: general-purpose register receiving the result.
Source rs1: register holding the first operand.
Immediate imm: 12-bit signed value, sign-extended before operation with rs1.
VVector Fixed-PointNarrowing/Clip

Instruction Behavior

VNCLIP.WI 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.WI 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.wi v8, v12, 3, v0.t».

Precision Reduction

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

Pre-Use Checklist

Syntax Check
  • Confirm the current instruction format is I-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.WI different from VNSRL/VNSRA?

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