vtype
Vector data type register
- Address
0xC21- Group
- Unprivileged and user-level CSRs
- Privilege
URO(privileged spec CSR listing, Unprivileged Vector CSRs)- Access
- read-only; lowest privilege U (user/unprivileged)
- Address range
- Standard read-only
- Name in riscv-unified-db
- Vector Type
Privileged spec: Vector data type register
Description
Provides the default type used to interpret the contents of the vector register file.
From riscv-unified-db, reformatted.
Fields
| Field | Bits | Type | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
VILL | RV32 31 / RV64 63 | RO-H | The vill bit is used to encode that a previous vset{i}vl{i} instruction attempted to write an unsupported value to vtype. Note: The vill bit is held in bit XLEN-1 of the CSR to support checking for illegal values with a branch on the sign bit. If the vill bit is set, then any attempt to execute a vector instruction that depends upon vtype will raise an illegal-instruction exception. When the vill bit is set, the other XLEN-1 bits in vtype shall be zero. It is recommended that at reset, vill is set. | ||||||||||||||||||
ALTFMT | 8 | RO-H | Selects the alternate floating-point format for vector floating-point instructions. When ALTFMT is zero, the hart behaves as though Zvfbfa were not implemented. Setting ALTFMT to one when SEW is greater than or equal to 32 is reserved. Note: Implementations should set VILL when a reserved combination of ALTFMT and SEW is selected. It is recommended that at reset, vill is set, and the remaining bits in vtype are zero. | ||||||||||||||||||
VMA | 7 | RO-H | Vector mask agnostic bit. Modifies the behavior of destination inactive masked-off elements during the execution of vector instructions. A value of 0 means inactive elements are undisturbed, meaning the corresponding set of destination elements in a vector register group retain the value they previously held. A value of 1 means inactive elements are agnostic, meaning the corresponding set of destination elements in any vector destination operand can either retain the value they previously held, or are overwritten with 1s. Within a single vector instruction, each destination element can be either left undisturbed or overwritten with 1s, in any combination, and the pattern of undisturbed or overwritten with 1s is not required to be deterministic when the instruction is executed with the same inputs. It is recommended that at reset, vill is set, and the remaining bits in vtype are zero. | ||||||||||||||||||
VTA | 6 | RO-H | Vector tail agnostic bit. Modifies the bahavior of destination tail elements during the execution of vector instructions. A value of 0 means tail elements are undisturbed, meaning the corresponding set of destination elements in a vector register group retain the value they previously held. A value of 1 means tail elements are agnostic, meaning the corresponding set of destination elements in any vector destination operand can either retain the value they previously held, or are overwritten with 1s. Within a single vector instruction, each destination element can be either left undisturbed or overwritten with 1s, in any combination, and the pattern of undisturbed or overwritten with 1s is not required to be deterministic when the instruction is executed with the same inputs. It is recommended that at reset, vill is set, and the remaining bits in vtype are zero. | ||||||||||||||||||
VSEW | 5-3 | RO-H | The value in vsew sets the dynamic selected element width (SEW).
It is recommended that at reset, vill is set, and the remaining bits in vtype are zero. | ||||||||||||||||||
VLMUL | 2-0 | RO-H | Vector register group multiplier. Multiple vector registers can be grouped together, so that a single vector instruction can operate on multiple vector registers. The term vector register group is used herein to refer to one or more vector registers used as a single operand to a vector instruction. Vector register groups can be used to provide greater execution efficiency for longer application vectors, but the main reason for their inclusion is to allow double-width or larger elements to be operated on with the same vector length as single-width elements. The vector length multiplier, LMUL, when greater than 1, represents the default number of vector registers that are combined to form a vector register group. Implementations must support LMUL integer values of 1, 2, 4, and 8. Note: The vector architecture includes instructions that take multiple source and destination vector operands with different element widths, but the same number of elements. The effective LMUL (EMUL) of each vector operand is determined by the number of registers required to hold the elements. For example, for a widening add operation, such as add 32- bit values to produce 64-bit results, a double-width result requires twice the LMUL of the single-width inputs. LMUL can also be a fractional value, reducing the number of bits used in a single vector register. Fractional LMUL is used to increase the number of effective usable vector register groups when operating on mixed-width values. It is recommended that at reset, vill is set, and the remaining bits in vtype are zero. |
Fields from riscv-unified-db; field types computed by IDL functions there are not shown.
Specification and related pages
- The RISC-V Instruction Set Manual, Volume II: CSR listing (src/priv/csrs.adoc)
- riscv-opcodes csrs.csv
- riscv-unified-db: spec/std/isa/csr/V/vtype.yaml
- csrrw, csrrs, csrrc (Zicsr instructions that access CSRs)