Register Guide

RISC-V vl / vl Register: Vector Length CSR

vl is a read-only Vector Length CSR holding the number of elements updated by a vector instruction. Only vsetvl, vsetvli, vsetivli, and fault-only-first vector load variants can update it.

ABI name: vl; physical register: vl.
Save rule: Caller.
Read it through its psABI role first, then inspect how each instruction reads or writes it.
Physical Name vlABI Name vlSave Rule Caller
Role
Vector Length CSR
Convention
Caller-saved
Remember This First
The calling convention listed for this entry is: Caller-saved.
RISC-V Vector ISA Reference

ABI register

vl is a read-only Vector Length CSR holding the number of elements updated by a vector instruction. Only vsetvl, vsetvli, vsetivli, and fault-only-first vector load variants can update it.

Preserved across calls: Caller
RISC-V Unprivileged ISA Manual, V extension

When It Fits Best

  • - Use it according to the documented role: Vector Length CSR.
  • - Consult the applicable ISA or ABI specification for concrete read, write, or execution semantics.

When Not To Use It This Way

  • - Do not apply the integer temporary-register t* rules to this entry.
  • - Do not infer behavior not defined by this page or the applicable specification from the ABI name.

What Happens Around A Call

1

The calling convention listed for this entry is: Caller-saved.

2

The save rule listed for this entry is: Caller.

Read The Documented Role

Examples explain the rule, not a complete program
# vl / vl
# Vector Length CSR
# Caller-saved