[PATCH] MIPS: recoginze mipsisa64 as 64bit CPU
YunQiang Su
yunqiang.su@cipunited.com
Tue Aug 15 10:48:21 GMT 2023
In GCC, mipsisa64* in triples are recoginzed as 64bit CPU.
Let's do the same.
The default ABI is determined by the abi section of triples,
which is same with the `mips64*' CPU:
-gnuabi64 and -openbsd for N64
otherwise, N32.
---
bfd/config.bfd | 8 ++++----
gas/configure | 4 ++--
gas/configure.ac | 4 ++--
gold/configure.tgt | 16 +++++++++++++++-
ld/configure.tgt | 10 ++++++----
5 files changed, 29 insertions(+), 13 deletions(-)
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 3b39ff36c00..972e847788b 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -941,21 +941,21 @@ case "${targ}" in
targ_defvec=mips_elf32_be_vec
targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
;;
- mips64*el-*-linux*-gnuabi64)
+ mips64*el-*-linux*-gnuabi64 | mipsisa64*el-*-linux*-gnuabi64)
targ_defvec=mips_elf64_trad_le_vec
targ_selvecs="mips_elf64_trad_be_vec mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec"
want64=true
;;
- mips64*el-*-linux*)
+ mips64*el-*-linux* | mipsisa64*el-*-linux*)
targ_defvec=mips_elf32_ntrad_le_vec
targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec"
;;
- mips64*-*-linux*-gnuabi64)
+ mips64*-*-linux*-gnuabi64 | mipsisa64*-*-linux*-gnuabi64)
targ_defvec=mips_elf64_trad_be_vec
targ_selvecs="mips_elf64_trad_le_vec mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec"
want64=true
;;
- mips64*-*-linux*)
+ mips64*-*-linux* | mipsisa64*-*-linux*)
targ_defvec=mips_elf32_ntrad_be_vec
targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
;;
diff --git a/gas/configure b/gas/configure
index 1b9bf0f83d5..dc6e1ee5f34 100755
--- a/gas/configure
+++ b/gas/configure
@@ -12256,10 +12256,10 @@ _ACEOF
esac
# Decide which ABI to target by default.
case ${target} in
- mips64*-openbsd* | mips64*-linux-gnuabi64)
+ mips64*-openbsd* | mips64*-linux-gnuabi64 | mipsisa64*-linux-gnuabi64)
mips_default_abi=N64_ABI
;;
- mips64*-linux* | mips-sgi-irix6* | mips64*-freebsd* \
+ mips64*-linux* | mipsisa64*-linux* | mips-sgi-irix6* | mips64*-freebsd* \
| mips64*-kfreebsd*-gnu | mips64*-ps2-elf*)
mips_default_abi=N32_ABI
;;
diff --git a/gas/configure.ac b/gas/configure.ac
index c3bd1178d41..617a5ca1473 100644
--- a/gas/configure.ac
+++ b/gas/configure.ac
@@ -394,10 +394,10 @@ changequote([,])dnl
esac
# Decide which ABI to target by default.
case ${target} in
- mips64*-openbsd* | mips64*-linux-gnuabi64)
+ mips64*-openbsd* | mips64*-linux-gnuabi64 | mipsisa64*-linux-gnuabi64)
mips_default_abi=N64_ABI
;;
- mips64*-linux* | mips-sgi-irix6* | mips64*-freebsd* \
+ mips64*-linux* | mipsisa64*-linux* | mips-sgi-irix6* | mips64*-freebsd* \
| mips64*-kfreebsd*-gnu | mips64*-ps2-elf*)
mips_default_abi=N32_ABI
;;
diff --git a/gold/configure.tgt b/gold/configure.tgt
index 4b54e08d27f..d09bb76ef02 100644
--- a/gold/configure.tgt
+++ b/gold/configure.tgt
@@ -153,13 +153,27 @@ aarch64*-*)
targ_big_endian=false
targ_extra_big_endian=true
;;
-mips*el*-*-*|mips*le*-*-*)
+mips64*el*-*-* | mipsisa64*le*-*-*)
+ targ_obj=mips
+ targ_machine=EM_MIPS_RS3_LE
+ targ_size=64
+ targ_big_endian=false
+ targ_extra_big_endian=true
+ ;;
+mips*el*-*-*)
targ_obj=mips
targ_machine=EM_MIPS_RS3_LE
targ_size=32
targ_big_endian=false
targ_extra_big_endian=true
;;
+mips64*-*-* | mipsisa64*-*-*)
+ targ_obj=mips
+ targ_machine=EM_MIPS
+ targ_size=64
+ targ_big_endian=true
+ targ_extra_big_endian=false
+ ;;
mips*-*-*)
targ_obj=mips
targ_machine=EM_MIPS
diff --git a/ld/configure.tgt b/ld/configure.tgt
index c62b9581d9b..e1ac1b33d4c 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -580,21 +580,23 @@ mips*-*-vxworks*) targ_emul=elf32ebmipvxworks
;;
mips*-*-windiss) targ_emul=elf32mipswindiss
;;
-mips64*el-*-linux-gnuabi64)
+mips64*el-*-linux-gnuabi64 | mipsisa64*el-*-linux-gnuabi64)
targ_emul=elf64ltsmip
targ_extra_emuls="elf64btsmip elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip"
targ_extra_libpath=$targ_extra_emuls
;;
-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32
+mips64*el-*-linux-* | mipsisa64*el-*-linux-*)
+ targ_emul=elf32ltsmipn32
targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
targ_extra_libpath=$targ_extra_emuls
;;
-mips64*-*-linux-gnuabi64)
+mips64*-*-linux-gnuabi64 | mipsisa64*-*-linux-gnuabi64)
targ_emul=elf64btsmip
targ_extra_emuls="elf64ltsmip elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip"
targ_extra_libpath=$targ_extra_emuls
;;
-mips64*-*-linux-*) targ_emul=elf32btsmipn32
+mips64*-*-linux-* | mipsisa64*-*-linux-*)
+ targ_emul=elf32btsmipn32
targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
targ_extra_libpath=$targ_extra_emuls
;;
--
2.30.2
More information about the Binutils
mailing list