[RFC,1/4] RISC-V : Remove checking when -march=rv64XX and -mabi=ilp32X

Message ID 20230519034835.664-2-shihua@iscas.ac.cn
State Accepted
Headers
Series RISC-V : Support ilp32 abi on rv64 isa |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

Liao Shihua May 19, 2023, 3:48 a.m. UTC
  This patch remove check in riscv_set_abi_by_arch() when -march=rv64XX and -mabi=ilp32X


gas/ChangeLog:

        * config/tc-riscv.c (riscv_set_abi_by_arch): Remove check.
        * testsuite/gas/riscv/mabi-fail-rv64iq-ilp32.d: Removed.
        * testsuite/gas/riscv/mabi-fail-rv64iq-ilp32.l: Removed.

---
 gas/config/tc-riscv.c                            | 2 +-
 gas/testsuite/gas/riscv/mabi-fail-rv64iq-ilp32.d | 3 ---
 gas/testsuite/gas/riscv/mabi-fail-rv64iq-ilp32.l | 2 --
 3 files changed, 1 insertion(+), 6 deletions(-)
 delete mode 100644 gas/testsuite/gas/riscv/mabi-fail-rv64iq-ilp32.d
 delete mode 100644 gas/testsuite/gas/riscv/mabi-fail-rv64iq-ilp32.l
  

Comments

Jan Beulich May 19, 2023, 6:25 a.m. UTC | #1
On 19.05.2023 05:48, Liao Shihua wrote:
> --- a/gas/config/tc-riscv.c
> +++ b/gas/config/tc-riscv.c
> @@ -379,7 +379,7 @@ riscv_set_abi_by_arch (void)
>        gas_assert (abi_xlen != 0 && xlen != 0 && float_abi != FLOAT_ABI_DEFAULT);
>        if (abi_xlen > xlen)
>  	as_bad ("can't have %d-bit ABI on %d-bit ISA", abi_xlen, xlen);
> -      else if (abi_xlen < xlen)
> +      else if (abi_xlen < xlen && (abi_xlen != 32 && xlen != 64))
>  	as_bad ("%d-bit ABI not yet supported on %d-bit ISA", abi_xlen, xlen);

Did you mean || as the inner operator of the condition you add?

Also I think this change ought to come after patch 2, not first.

Jan
  

Patch

diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
index 0cc2484b049..99903deccec 100644
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -379,7 +379,7 @@  riscv_set_abi_by_arch (void)
       gas_assert (abi_xlen != 0 && xlen != 0 && float_abi != FLOAT_ABI_DEFAULT);
       if (abi_xlen > xlen)
 	as_bad ("can't have %d-bit ABI on %d-bit ISA", abi_xlen, xlen);
-      else if (abi_xlen < xlen)
+      else if (abi_xlen < xlen && (abi_xlen != 32 && xlen != 64))
 	as_bad ("%d-bit ABI not yet supported on %d-bit ISA", abi_xlen, xlen);
 
       if (riscv_subset_supports (&riscv_rps_as, "e") && !rve_abi)
diff --git a/gas/testsuite/gas/riscv/mabi-fail-rv64iq-ilp32.d b/gas/testsuite/gas/riscv/mabi-fail-rv64iq-ilp32.d
deleted file mode 100644
index e3155f48956..00000000000
--- a/gas/testsuite/gas/riscv/mabi-fail-rv64iq-ilp32.d
+++ /dev/null
@@ -1,3 +0,0 @@ 
-#as: -march-attr -mabi=ilp32
-#source: mabi-attr-rv64iq.s
-#error_output: mabi-fail-rv64iq-ilp32.l
diff --git a/gas/testsuite/gas/riscv/mabi-fail-rv64iq-ilp32.l b/gas/testsuite/gas/riscv/mabi-fail-rv64iq-ilp32.l
deleted file mode 100644
index 8d45a07fd36..00000000000
--- a/gas/testsuite/gas/riscv/mabi-fail-rv64iq-ilp32.l
+++ /dev/null
@@ -1,2 +0,0 @@ 
-.*Assembler messages:
-.*Error: 32-bit ABI not yet supported on 64-bit ISA