Home/Instructions/VZEXT-VF4
VZEXT.VF4

RISC-V VZEXT.VF4 Instruction Details

Instruction ManualR-type

VZEXT.VF4 zero-extends narrower elements to the current SEW.

Instruction Syntax

vzext.vf4 vd, vs2, vm
Operand Breakdown
vd: destination vector register group.
vs2/vs1 or scalar source: selected by suffixes such as .vv, .vx, .vi, or .vf.
vm: when present, vm=0 uses v0 as the execution mask and vm=1 is unmasked.
VVector Operations

Instruction Behavior

vzext.vf4 is a V extension zero-extension instruction. It zero-extends source elements with EEW=SEW/4 to SEW-wide results in vd.

Quick Understanding & Search Notes

vzext.vf4 is a V extension vector instruction. Active elements are controlled by vl, vtype, vstart, and the optional v0.t mask; it zero-extends SEW/4 source elements to SEW results.

Official syntax is `vzext.vf4 vd, vs2, vm`; without a mask operand it is unmasked, while `, v0.t` updates only selected active elements.
Tail elements and masked-off elements follow the current vtype tail/mask policy; the mnemonic alone does not imply zeroing.
Do not interchange vzext and vsext; they match only when the source sign bit is 0.

Vector Execution Context

When reading VZEXT.VF4, do not stop at the mnemonic. Official V-extension semantics also depend on the current vl, vtype, and mask state. The suffix and operand form determine whether sources are vector, scalar, or immediate values.

Check vl first

The current vl determines the number of body elements. Typical code executes vsetvli, vsetivli, or vsetvl before this instruction.

Then check vtype

The current vtype supplies SEW, LMUL, tail policy, and mask policy; these affect element width, register-group size, and inactive/tail destination elements.

Then check vm/v0

For ordinary vector instructions with vm, vm=0 uses v0 as the execution mask and vm=1 is unmasked. A few forms such as VMERGE use v0 as data-selection input.

Official source: RISC-V V Standard Extension for Vector Operations

Common Usage Scenarios

Bit Operations & Masks

Understand this scenario with real code like «vzext.vf4 v8, v12, v0.t».

Data Storing

Understand this scenario with real code like «vzext.vf4 v8, v12, v0.t».

Vector Operations

Understand this scenario with real code like «vzext.vf4 v8, v12, 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

The source element width is current SEW/4; the form is valid only when that width and the LMUL/EMUL combination are legal.
This is zero-extension, not sign-extension; use the corresponding vsext form for signed extension.
Destination and source groups can have different EMUL values, so overlap constraints matter.

FAQ

What determines the element count for vzext.vf4?

The current vl and vtype determine it, with vstart, LMUL, SEW, mask state, and tail policy also affecting execution.

Does vzext.vf4 always process the whole vector register?

No. V instructions operate on active elements; register grouping and inactive-element behavior are controlled by vtype and policy bits.