]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Fix effective target check.
authorRobin Dapp <rdapp@ventanamicro.com>
Fri, 30 Aug 2024 12:35:08 +0000 (14:35 +0200)
committerRobin Dapp <rdapp@ventanamicro.com>
Tue, 24 Sep 2024 12:30:28 +0000 (14:30 +0200)
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.

gcc/testsuite/lib/target-supports.exp

index 8f2afe866c7cea3e9c5bd71dd491d283506ca12d..05a63c4e9a551116457ff1c12498f29bbfc27711 100644 (file)
@@ -1978,15 +1978,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}"]
 }
@@ -1996,15 +1996,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}"]
 }