-
Notifications
You must be signed in to change notification settings - Fork 1
riscv_fix_csr_access_on_vector
- Status: Merged for Binutils 2.40 (except some tests that are considered vector implication tests)
- Branch:
riscv-fix-csr-access-on-vector
- Tracking PR: #46 (view Pull Request and Diff)
- Mailing List:
- PATCH v1 (2022-09-08)
-
RISC-V: Fix CSR accessibility and implications
This is accessibility subset.
On the current version of GNU Binutils, CSRs with CSR_CLASS_V
means they require the V
extension. However, there are a few vector subextensions that implement vector subsets (intended for embedded processors).
-
Zve64d
(superset ofZve64f
) -
Zve64f
(superset ofZve32f
andZve64x
) -
Zve64x
(superset ofZve32x
) -
Zve32f
(superset ofZve32x
) Zve32x
+-------> D ---+----> F -----> Zicsr
| ^ | ^
| | / |
V ---> Zve64d ---> Zve64f ---> Zve64x
\ | |
| V V
+-- Zve32f ---> Zve32x
|
|
+---> (Zicsr [should be added?])
They also require general purpose vector CSRs (vstart
, vl
, vtype
and vlenb
).
So, corresponding CSR_CLASS_V
with the V
extension is inappropriate (they should require Zve32x
instead, the minimum vector subset).
Remaining CSRs are:
vxsat
vxrm
vcsr
They are related to fixed-point arithmetic and 18.2 "Zve*
: Vector Extensions for Embedded Processors" says:
All
Zve*
extensions support all vector fixed-point arithmetic instructions (Vector Fixed-Point Arithmetic Instructions), except thatvsmul.vv
andvsmul.vx
are not supported forEEW=64
inZve64*
.
So, their minimum requirement shall be also Zve32x
, not V
.
As a consequence, we can conclude that changing requirements of CSR_CLASS_V
from V
to Zve32x
is sufficient to avoid CSR accessibility warnings.
I didn't rename CSR_CLASS_V
to CSR_CLASS_ZVE32X
because the name gets difficult and there's already INSN_CLASS_V
(effectively requires Zve32x
with some exceptions).