Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
Moved discussion of illegal vtype values into section on configurat…
Browse files Browse the repository at this point in the history
…ion setting instructions, and expanded explanations.
  • Loading branch information
kasanovic committed Nov 14, 2021
1 parent 53a6722 commit 36ba83e
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions v-spec.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Alex Solomatnikov, Steve Wallach, Andrew Waterman, Jim Wilson.

== Changes from v1.0

=== None
=== Moved discussion of illegal `vtype` values into section on configuration setting instructions, and expanded explanations.

:sectnums:

Expand Down Expand Up @@ -318,9 +318,6 @@ storage in a vector register.
For a given supported fractional LMUL setting, implementations must support
SEW settings between SEW~MIN~ and LMUL * ELEN, inclusive.

An attempt to set an unsupported SEW and LMUL configuration sets the
`vill` bit in `vtype`.

The use of `vtype` encodings with LMUL < SEW~MIN~/ELEN is
__reserved__, but implementations can set `vill` if they do not
support these configurations.
Expand Down Expand Up @@ -489,15 +486,6 @@ 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.

All bits of the `vtype` argument must be considered in determining if
the value is supported by the implementation.

NOTE: All bits must be checked to ensure that new code assuming
unsupported vector features in `vtype` traps instead of executing
incorrectly on an older implementation.

A `vtype` value with the `vill` bit set is an unsupported value.

If the `vill` bit is set, then any attempt to execute a vector instruction
that depends upon `vtype` will raise an illegal-instruction exception.

Expand Down Expand Up @@ -1168,8 +1156,8 @@ include::vcfg-format.adoc[]

include::vtype-format.adoc[]

The new `vtype` setting is encoded in the immediate fields of
`vsetvli` and `vsetivli`, and in the `rs2` register for `vsetvl`.
The new `vtype` value is encoded in the immediate fields of `vsetvli`
and `vsetivli`, and in the `rs2` register for `vsetvl`.

----
Suggested assembler names used for vset{i}vli vtypei immediate
Expand All @@ -1196,7 +1184,9 @@ Examples:
The `vsetvl` variant operates similarly to `vsetvli` except that it
takes a `vtype` value from `rs2` and can be used for context restore.

If the `vtype` setting is not supported by the implementation, then
==== Unsupported `vtype` Values

If the `vtype` value is not supported by the implementation, then
the `vill` bit is set in `vtype`, the remaining bits in `vtype` are
set to zero, and the `vl` register is also set to zero.

Expand All @@ -1209,6 +1199,19 @@ forward-compatibility. The current scheme supports light-weight
runtime interrogation of the supported vector unit configurations by
checking if `vill` is clear for a given setting.

A `vtype` value with `vill` set is treated as an unsupported
configuration.

Implementations must consider all bits of the `vtype` value to
determine if the configuration is supported. An unsupported value in
any location within the `vtype` value must result in `vill` being set.

NOTE: In particular, all XLEN bits of the register `vtype` argument to
the `vsetvl` instruction must be checked. Implementations cannot
ignore fields they do not implement. All bits must be checked to
ensure that new code assuming unsupported vector features in `vtype`
traps instead of executing incorrectly on an older implementation.

=== AVL encoding

The new vector
Expand Down

0 comments on commit 36ba83e

Please sign in to comment.