[gcc(refs/vendors/riscv/heads/gcc-14-with-riscv-opts)] RISC-V: Fix effective target check.
Jeff Law
law@gcc.gnu.org
Sun Sep 29 16:35:49 GMT 2024
https://gcc.gnu.org/g:c9e63024a36590e2b84f446d0a0c27c95a9d4d56
commit c9e63024a36590e2b84f446d0a0c27c95a9d4d56
Author: Robin Dapp <rdapp@ventanamicro.com>
Date: Fri Aug 30 14:35:08 2024 +0200
RISC-V: Fix effective target check.
The return value is inverted in check_effective_target_rvv_zvl256b_ok
and check_effective_target_rvv_zvl512b_ok. Fix this and also just use
the current march.
gcc/testsuite/ChangeLog:
* lib/target-supports.exp: Fix effective target check.
(cherry picked from commit e45537f56250f19cdf2ec09a744c6b11170c1001)
Diff:
---
gcc/testsuite/lib/target-supports.exp | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index d9210a484121..e17903d8eb45 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1967,15 +1967,15 @@ proc check_effective_target_riscv_v { } {
proc check_effective_target_rvv_zvl256b_ok { } {
# Check if the target has a VLENB of 32.
- set gcc_march [regsub {[[:alnum:]]*} [riscv_get_arch] &v]
+ set gcc_march [riscv_get_arch]
return [check_runtime ${gcc_march}_exec {
int main()
{
int vlenb = 0;
asm ("csrr %0,vlenb" : "=r" (vlenb) : : );
if (vlenb == 32)
- return 1;
- return 0;
+ return 0;
+ return 1;
}
} "-march=${gcc_march}"]
}
@@ -1985,15 +1985,15 @@ proc check_effective_target_rvv_zvl256b_ok { } {
proc check_effective_target_rvv_zvl512b_ok { } {
# Check if the target has a VLENB of 64.
- set gcc_march [regsub {[[:alnum:]]*} [riscv_get_arch] &v]
+ set gcc_march [riscv_get_arch]
return [check_runtime ${gcc_march}_exec {
int main()
{
int vlenb = 0;
asm ("csrr %0,vlenb" : "=r" (vlenb) : : );
if (vlenb == 64)
- return 1;
- return 0;
+ return 0;
+ return 1;
}
} "-march=${gcc_march}"]
}
More information about the Gcc-cvs
mailing list