From: Tsukasa OI Date: Mon, 5 Sep 2022 07:54:51 +0000 (+0000) Subject: RISC-V: Fix vector CSR requirements X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1daabcc746e7d2f04ab190b49aec9abb020f29aa;p=binutils-gdb.git RISC-V: Fix vector CSR requirements Vector CSRs are also required on smaller vector subsets. Not only that the most of vector CSRs are general purpose (and must be accessible for every vector subsets), current minimum vector subset 'Zve32x' requires fixed point arithmetic, making remaining non-general purpose (fixed point arithmetic only) CSRs mandatory for such subsets. So, those CSRs must be accessible from 'Zve32x', not just from 'V'. This commit fixes this issue which caused CSR accessibility warnings. gas/ChangeLog: * config/tc-riscv.c (riscv_csr_address): Change vector CSR requirement from 'V' to 'Zve32x'. * testsuite/gas/riscv/csr-version-1p9p1.l: Change vector CSR requirement from 'V' to 'Zve32x'. * testsuite/gas/riscv/csr-version-1p10.l: Likewise. * testsuite/gas/riscv/csr-version-1p11.l: Likewise. * testsuite/gas/riscv/csr-version-1p12.l: Likewise. --- diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index 34ce68e8252..df2e201fb74 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -935,7 +935,7 @@ riscv_csr_address (const char *csr_name, extension = "zkr"; break; case CSR_CLASS_V: - extension = "v"; + extension = "zve32x"; break; case CSR_CLASS_SMSTATEEN: case CSR_CLASS_SMSTATEEN_AND_H: diff --git a/gas/testsuite/gas/riscv/csr-version-1p10.l b/gas/testsuite/gas/riscv/csr-version-1p10.l index b778453b556..999e9af1520 100644 --- a/gas/testsuite/gas/riscv/csr-version-1p10.l +++ b/gas/testsuite/gas/riscv/csr-version-1p10.l @@ -652,20 +652,20 @@ .*Warning: invalid CSR `fcsr', needs `f' extension .*Warning: invalid CSR `seed', needs `zkr' extension .*Warning: invalid CSR `seed', needs `zkr' extension -.*Warning: invalid CSR `vstart', needs `v' extension -.*Warning: invalid CSR `vstart', needs `v' extension -.*Warning: invalid CSR `vxsat', needs `v' extension -.*Warning: invalid CSR `vxsat', needs `v' extension -.*Warning: invalid CSR `vxrm', needs `v' extension -.*Warning: invalid CSR `vxrm', needs `v' extension -.*Warning: invalid CSR `vcsr', needs `v' extension -.*Warning: invalid CSR `vcsr', needs `v' extension -.*Warning: invalid CSR `vl', needs `v' extension -.*Warning: invalid CSR `vl', needs `v' extension +.*Warning: invalid CSR `vstart', needs `zve32x' extension +.*Warning: invalid CSR `vstart', needs `zve32x' extension +.*Warning: invalid CSR `vxsat', needs `zve32x' extension +.*Warning: invalid CSR `vxsat', needs `zve32x' extension +.*Warning: invalid CSR `vxrm', needs `zve32x' extension +.*Warning: invalid CSR `vxrm', needs `zve32x' extension +.*Warning: invalid CSR `vcsr', needs `zve32x' extension +.*Warning: invalid CSR `vcsr', needs `zve32x' extension +.*Warning: invalid CSR `vl', needs `zve32x' extension +.*Warning: invalid CSR `vl', needs `zve32x' extension .*Warning: read-only CSR is written `csrw vl,a1' -.*Warning: invalid CSR `vtype', needs `v' extension -.*Warning: invalid CSR `vtype', needs `v' extension +.*Warning: invalid CSR `vtype', needs `zve32x' extension +.*Warning: invalid CSR `vtype', needs `zve32x' extension .*Warning: read-only CSR is written `csrw vtype,a1' -.*Warning: invalid CSR `vlenb', needs `v' extension -.*Warning: invalid CSR `vlenb', needs `v' extension +.*Warning: invalid CSR `vlenb', needs `zve32x' extension +.*Warning: invalid CSR `vlenb', needs `zve32x' extension .*Warning: read-only CSR is written `csrw vlenb,a1' diff --git a/gas/testsuite/gas/riscv/csr-version-1p11.l b/gas/testsuite/gas/riscv/csr-version-1p11.l index 78bae817470..a099e4ecc93 100644 --- a/gas/testsuite/gas/riscv/csr-version-1p11.l +++ b/gas/testsuite/gas/riscv/csr-version-1p11.l @@ -650,20 +650,20 @@ .*Warning: invalid CSR `fcsr', needs `f' extension .*Warning: invalid CSR `seed', needs `zkr' extension .*Warning: invalid CSR `seed', needs `zkr' extension -.*Warning: invalid CSR `vstart', needs `v' extension -.*Warning: invalid CSR `vstart', needs `v' extension -.*Warning: invalid CSR `vxsat', needs `v' extension -.*Warning: invalid CSR `vxsat', needs `v' extension -.*Warning: invalid CSR `vxrm', needs `v' extension -.*Warning: invalid CSR `vxrm', needs `v' extension -.*Warning: invalid CSR `vcsr', needs `v' extension -.*Warning: invalid CSR `vcsr', needs `v' extension -.*Warning: invalid CSR `vl', needs `v' extension -.*Warning: invalid CSR `vl', needs `v' extension +.*Warning: invalid CSR `vstart', needs `zve32x' extension +.*Warning: invalid CSR `vstart', needs `zve32x' extension +.*Warning: invalid CSR `vxsat', needs `zve32x' extension +.*Warning: invalid CSR `vxsat', needs `zve32x' extension +.*Warning: invalid CSR `vxrm', needs `zve32x' extension +.*Warning: invalid CSR `vxrm', needs `zve32x' extension +.*Warning: invalid CSR `vcsr', needs `zve32x' extension +.*Warning: invalid CSR `vcsr', needs `zve32x' extension +.*Warning: invalid CSR `vl', needs `zve32x' extension +.*Warning: invalid CSR `vl', needs `zve32x' extension .*Warning: read-only CSR is written `csrw vl,a1' -.*Warning: invalid CSR `vtype', needs `v' extension -.*Warning: invalid CSR `vtype', needs `v' extension +.*Warning: invalid CSR `vtype', needs `zve32x' extension +.*Warning: invalid CSR `vtype', needs `zve32x' extension .*Warning: read-only CSR is written `csrw vtype,a1' -.*Warning: invalid CSR `vlenb', needs `v' extension -.*Warning: invalid CSR `vlenb', needs `v' extension +.*Warning: invalid CSR `vlenb', needs `zve32x' extension +.*Warning: invalid CSR `vlenb', needs `zve32x' extension .*Warning: read-only CSR is written `csrw vlenb,a1' diff --git a/gas/testsuite/gas/riscv/csr-version-1p12.l b/gas/testsuite/gas/riscv/csr-version-1p12.l index cb026bb55e0..cf8f2e25634 100644 --- a/gas/testsuite/gas/riscv/csr-version-1p12.l +++ b/gas/testsuite/gas/riscv/csr-version-1p12.l @@ -532,20 +532,20 @@ .*Warning: invalid CSR `fcsr', needs `f' extension .*Warning: invalid CSR `seed', needs `zkr' extension .*Warning: invalid CSR `seed', needs `zkr' extension -.*Warning: invalid CSR `vstart', needs `v' extension -.*Warning: invalid CSR `vstart', needs `v' extension -.*Warning: invalid CSR `vxsat', needs `v' extension -.*Warning: invalid CSR `vxsat', needs `v' extension -.*Warning: invalid CSR `vxrm', needs `v' extension -.*Warning: invalid CSR `vxrm', needs `v' extension -.*Warning: invalid CSR `vcsr', needs `v' extension -.*Warning: invalid CSR `vcsr', needs `v' extension -.*Warning: invalid CSR `vl', needs `v' extension -.*Warning: invalid CSR `vl', needs `v' extension +.*Warning: invalid CSR `vstart', needs `zve32x' extension +.*Warning: invalid CSR `vstart', needs `zve32x' extension +.*Warning: invalid CSR `vxsat', needs `zve32x' extension +.*Warning: invalid CSR `vxsat', needs `zve32x' extension +.*Warning: invalid CSR `vxrm', needs `zve32x' extension +.*Warning: invalid CSR `vxrm', needs `zve32x' extension +.*Warning: invalid CSR `vcsr', needs `zve32x' extension +.*Warning: invalid CSR `vcsr', needs `zve32x' extension +.*Warning: invalid CSR `vl', needs `zve32x' extension +.*Warning: invalid CSR `vl', needs `zve32x' extension .*Warning: read-only CSR is written `csrw vl,a1' -.*Warning: invalid CSR `vtype', needs `v' extension -.*Warning: invalid CSR `vtype', needs `v' extension +.*Warning: invalid CSR `vtype', needs `zve32x' extension +.*Warning: invalid CSR `vtype', needs `zve32x' extension .*Warning: read-only CSR is written `csrw vtype,a1' -.*Warning: invalid CSR `vlenb', needs `v' extension -.*Warning: invalid CSR `vlenb', needs `v' extension +.*Warning: invalid CSR `vlenb', needs `zve32x' extension +.*Warning: invalid CSR `vlenb', needs `zve32x' extension .*Warning: read-only CSR is written `csrw vlenb,a1' diff --git a/gas/testsuite/gas/riscv/csr-version-1p9p1.l b/gas/testsuite/gas/riscv/csr-version-1p9p1.l index 4fac40fb589..5f298c1dda9 100644 --- a/gas/testsuite/gas/riscv/csr-version-1p9p1.l +++ b/gas/testsuite/gas/riscv/csr-version-1p9p1.l @@ -678,20 +678,20 @@ .*Warning: invalid CSR `fcsr', needs `f' extension .*Warning: invalid CSR `seed', needs `zkr' extension .*Warning: invalid CSR `seed', needs `zkr' extension -.*Warning: invalid CSR `vstart', needs `v' extension -.*Warning: invalid CSR `vstart', needs `v' extension -.*Warning: invalid CSR `vxsat', needs `v' extension -.*Warning: invalid CSR `vxsat', needs `v' extension -.*Warning: invalid CSR `vxrm', needs `v' extension -.*Warning: invalid CSR `vxrm', needs `v' extension -.*Warning: invalid CSR `vcsr', needs `v' extension -.*Warning: invalid CSR `vcsr', needs `v' extension -.*Warning: invalid CSR `vl', needs `v' extension -.*Warning: invalid CSR `vl', needs `v' extension +.*Warning: invalid CSR `vstart', needs `zve32x' extension +.*Warning: invalid CSR `vstart', needs `zve32x' extension +.*Warning: invalid CSR `vxsat', needs `zve32x' extension +.*Warning: invalid CSR `vxsat', needs `zve32x' extension +.*Warning: invalid CSR `vxrm', needs `zve32x' extension +.*Warning: invalid CSR `vxrm', needs `zve32x' extension +.*Warning: invalid CSR `vcsr', needs `zve32x' extension +.*Warning: invalid CSR `vcsr', needs `zve32x' extension +.*Warning: invalid CSR `vl', needs `zve32x' extension +.*Warning: invalid CSR `vl', needs `zve32x' extension .*Warning: read-only CSR is written `csrw vl,a1' -.*Warning: invalid CSR `vtype', needs `v' extension -.*Warning: invalid CSR `vtype', needs `v' extension +.*Warning: invalid CSR `vtype', needs `zve32x' extension +.*Warning: invalid CSR `vtype', needs `zve32x' extension .*Warning: read-only CSR is written `csrw vtype,a1' -.*Warning: invalid CSR `vlenb', needs `v' extension -.*Warning: invalid CSR `vlenb', needs `v' extension +.*Warning: invalid CSR `vlenb', needs `zve32x' extension +.*Warning: invalid CSR `vlenb', needs `zve32x' extension .*Warning: read-only CSR is written `csrw vlenb,a1'