public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/5] sim: mips: always resolve active bfd mach dynamically
@ 2022-12-21  5:13 Mike Frysinger
  2022-12-21  5:13 ` [PATCH 2/5] sim: mips: move subtarget defines to top-level configure Mike Frysinger
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Mike Frysinger @ 2022-12-21  5:13 UTC (permalink / raw)
  To: gdb-patches

Don't assume that the default bfd that we configured for is the one
that is always active when running a program.  We already have access
to the real runtime value, so use it directly.  This simplifies the
code quite a bit, and will make it easier to support multiple mach's
in a single binary.
---
 sim/mips/configure    | 48 -------------------------------------------
 sim/mips/configure.ac | 48 -------------------------------------------
 sim/mips/sim-main.h   | 13 +++---------
 3 files changed, 3 insertions(+), 106 deletions(-)

diff --git a/sim/mips/configure.ac b/sim/mips/configure.ac
index f1d9f3d24100..52e54bc8bceb 100644
--- a/sim/mips/configure.ac
+++ b/sim/mips/configure.ac
@@ -66,7 +66,6 @@ sim_igen_machine="-M mipsIV"
 sim_m16_machine="-M mips16,mipsIII"
 sim_igen_filter="32,64,f"
 sim_m16_filter="16"
-sim_mach_default="mips8000"
 
 case "${target}" in
   mips*tx39*)		sim_gen=IGEN
@@ -75,18 +74,15 @@ case "${target}" in
 			;;
   mips64vr43*-*-*)	sim_gen=IGEN
 			sim_igen_machine="-M mipsIV"
-			sim_mach_default="mips8000"
 			;;
   mips64vr5*-*-*)	sim_gen=IGEN
 			sim_igen_machine="-M vr5000"
-			sim_mach_default="mips5000"
 			;;
   mips64vr41*)		sim_gen=M16
 			sim_igen_machine="-M vr4100"
 			sim_m16_machine="-M vr4100"
 			sim_igen_filter="32,64,f"
 			sim_m16_filter="16"
-			sim_mach_default="mips4100"
                         ;;
   mips64vr-*-* | mips64vrel-*-*)
 			sim_gen=MULTI
@@ -122,42 +118,35 @@ case "${target}" in
   mipsisa32r6*-*-*)	sim_gen=IGEN
 			sim_igen_machine="-M mips32r6"
 			sim_igen_filter="32,f"
-			sim_mach_default="mipsisa32r6"
 			;;
   mipsisa32*-*-*)	sim_gen=M16
 			sim_igen_machine="-M mips32,mips16,mips16e,smartmips"
 			sim_m16_machine="-M mips16,mips16e,mips32"
 			sim_igen_filter="32,f"
-			sim_mach_default="mipsisa32"
 			;;
   mipsisa64r2*-*-*)	sim_gen=M16
 			sim_igen_machine="-M mips64r2,mips3d,mips16,mips16e,mdmx,dsp,dsp2"
 			sim_m16_machine="-M mips16,mips16e,mips64r2"
 			sim_igen_filter="32,64,f"
-			sim_mach_default="mipsisa64r2"
 			;;
   mipsisa64r6*-*-*)	sim_gen=IGEN
 			sim_igen_machine="-M mips64r6"
 			sim_igen_filter="32,64,f"
-			sim_mach_default="mipsisa64r6"
 			;;
   mipsisa64sb1*-*-*)	sim_gen=IGEN
 			sim_igen_machine="-M mips64,mips3d,sb1"
 			sim_igen_filter="32,64,f"
-			sim_mach_default="mips_sb1"
 			;;
   mipsisa64*-*-*)	sim_gen=M16
 			sim_igen_machine="-M mips64,mips3d,mips16,mips16e,mdmx"
 			sim_m16_machine="-M mips16,mips16e,mips64"
 			sim_igen_filter="32,64,f"
-			sim_mach_default="mipsisa64"
 			;;
   mips*lsi*)		sim_gen=M16
 			sim_igen_machine="-M mipsIII,mips16"
 			sim_m16_machine="-M mips16,mipsIII"
 			sim_igen_filter="32,f"
 			sim_m16_filter="16"
-			sim_mach_default="mips4000"
 			;;
   mips*-*-*)		sim_gen=IGEN
 			sim_igen_filter="32,f"
@@ -357,47 +346,10 @@ __EOF__
   cat << __EOF__ >> multi-run.c
     }
 }
-
-int
-mips_mach_multi (SIM_DESC sd)
-{
-  if (STATE_ARCHITECTURE (sd) == NULL)
-    return bfd_mach_${sim_multi_default};
-
-  switch (STATE_ARCHITECTURE (SD)->mach)
-    {
 __EOF__
-
-  # Add case statements for this engine to mips_mach_multi().
-  for fc in ${sim_multi_configs}; do
-
-    # Split up the entry.  ${c} contains the first three elements.
-    # Note: outer sqaure brackets are m4 quotes.
-    c=`echo ${fc} | sed ['s/:[^:]*$//']`
-    bfdmachs=`echo ${fc} | sed 's/.*://'`
-
-    for mach in `echo ${bfdmachs} | sed 's/,/ /g'`; do
-      echo "    case bfd_mach_${mach}:" >> multi-run.c
-    done
-  done
-
-  cat << __EOF__ >> multi-run.c
-      return (STATE_ARCHITECTURE (SD)->mach);
-    default:
-      return bfd_mach_${sim_multi_default};
-    }
-}
-__EOF__
-
-  SIM_SUBTARGET="$SIM_SUBTARGET -DMIPS_MACH_MULTI"
 else
   # For clean-extra
   sim_multi_src=doesnt-exist.c
-
-  if test x"${sim_mach_default}" = x""; then
-    AC_MSG_ERROR(Error in configure.ac: \${sim_mach_default} not defined)
-  fi
-  SIM_SUBTARGET="$SIM_SUBTARGET -DMIPS_MACH_DEFAULT=bfd_mach_${sim_mach_default}"
 fi
 sim_igen_flags="-F ${sim_igen_filter} ${sim_igen_machine} ${sim_igen_smp}"
 sim_m16_flags=" -F ${sim_m16_filter}  ${sim_m16_machine}  ${sim_igen_smp}"
diff --git a/sim/mips/sim-main.h b/sim/mips/sim-main.h
index ea203c4a6886..3868fffef86c 100644
--- a/sim/mips/sim-main.h
+++ b/sim/mips/sim-main.h
@@ -1051,24 +1051,17 @@ void mips_cpu_exception_trigger(SIM_DESC sd, sim_cpu* cpu, address_word pc);
 void mips_cpu_exception_suspend(SIM_DESC sd, sim_cpu* cpu, int exception);
 void mips_cpu_exception_resume(SIM_DESC sd, sim_cpu* cpu, int exception);
 
-#ifdef MIPS_MACH_MULTI
-extern int mips_mach_multi(SIM_DESC sd);
-#define MIPS_MACH(SD)	mips_mach_multi(SD)
-#else
-#define	MIPS_MACH(SD)	MIPS_MACH_DEFAULT
-#endif
-
 /* Macros for determining whether a MIPS IV or MIPS V part is subject
    to the hi/lo restrictions described in mips.igen.  */
 
 #define MIPS_MACH_HAS_MT_HILO_HAZARD(SD) \
-  (MIPS_MACH (SD) != bfd_mach_mips5500)
+  (STATE_ARCHITECTURE (SD)->mach != bfd_mach_mips5500)
 
 #define MIPS_MACH_HAS_MULT_HILO_HAZARD(SD) \
-  (MIPS_MACH (SD) != bfd_mach_mips5500)
+  (STATE_ARCHITECTURE (SD)->mach != bfd_mach_mips5500)
 
 #define MIPS_MACH_HAS_DIV_HILO_HAZARD(SD) \
-  (MIPS_MACH (SD) != bfd_mach_mips5500)
+  (STATE_ARCHITECTURE (SD)->mach != bfd_mach_mips5500)
 
 #if H_REVEALS_MODULE_P (SIM_MAIN_INLINE)
 #include "sim-main.c"
-- 
2.39.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/5] sim: mips: move subtarget defines to top-level configure
  2022-12-21  5:13 [PATCH 1/5] sim: mips: always resolve active bfd mach dynamically Mike Frysinger
@ 2022-12-21  5:13 ` Mike Frysinger
  2022-12-21  5:13 ` [PATCH 3/5] sim: mips: move bitsize " Mike Frysinger
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2022-12-21  5:13 UTC (permalink / raw)
  To: gdb-patches

We want to kill off mips/configure entirely.  Move this small part
out now to get started.
---
 sim/Makefile.in           |  2 ++
 sim/arch-subdir.mk.in     |  3 +++
 sim/configure             | 29 +++++++++++++++++++++++++++--
 sim/configure.ac          |  1 +
 sim/mips/Makefile.in      |  3 +--
 sim/mips/acinclude-top.m4 | 34 ++++++++++++++++++++++++++++++++++
 sim/mips/configure        | 20 --------------------
 sim/mips/configure.ac     | 19 -------------------
 8 files changed, 68 insertions(+), 43 deletions(-)
 create mode 100644 sim/mips/acinclude-top.m4

diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in
index 251a9b684d93..086a5cd80a68 100644
--- a/sim/arch-subdir.mk.in
+++ b/sim/arch-subdir.mk.in
@@ -74,3 +74,6 @@ SIM_HW_CFLAGS = @SIM_HW_CFLAGS@
 SIM_HW_SOCKSER = @SIM_HW_SOCKSER@
 SIM_HW_OBJS = $(SIM_COMMON_HW_OBJS) $(SIM_HW_DEVICES:%=dv-%.o) $(SIM_HW_SOCKSER)
 @SIM_ENABLE_HW_FALSE@SIM_HW_OBJS =
+
+# This can be removed once mips/configure is gone.
+SIM_MIPS_SUBTARGET = @SIM_MIPS_SUBTARGET@
diff --git a/sim/configure.ac b/sim/configure.ac
index 675fa1bb44d6..a631d2b3a222 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -203,6 +203,7 @@ AC_SUBST(sim_float)
 
 dnl Some arches have unique configure flags.
 m4_include([frv/acinclude.m4])
+m4_include([mips/acinclude-top.m4])
 m4_include([riscv/acinclude.m4])
 m4_include([rx/acinclude.m4])
 
diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in
index 75438be5a183..50fa7a8fc27f 100644
--- a/sim/mips/Makefile.in
+++ b/sim/mips/Makefile.in
@@ -67,8 +67,7 @@ SIM_OBJS = \
 SIM_EXTRA_HW_DEVICES = tx3904cpu tx3904irc tx3904tmr tx3904sio
 
 # List of flags to always pass to $(CC).
-SIM_SUBTARGET=@SIM_SUBTARGET@
-SIM_EXTRA_CFLAGS = $(SIM_SUBTARGET)
+SIM_EXTRA_CFLAGS = $(SIM_MIPS_SUBTARGET)
 
 SIM_EXTRA_CLEAN = clean-extra
 SIM_EXTRA_DISTCLEAN = distclean-extra
diff --git a/sim/mips/acinclude-top.m4 b/sim/mips/acinclude-top.m4
new file mode 100644
index 000000000000..4eb6c19f8123
--- /dev/null
+++ b/sim/mips/acinclude-top.m4
@@ -0,0 +1,34 @@
+dnl TODO: Rename this to acinclude.m4 once mips/configure is removed.
+dnl
+dnl Copyright (C) 2005-2022 Free Software Foundation, Inc.
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
+dnl
+dnl NB: This file is included in sim/configure, so keep settings namespaced.
+
+dnl DEPRECATED
+dnl
+dnl Instead of defining a `subtarget' macro, code should be checking the value
+dnl of {STATE,CPU}_ARCHITECTURE to identify the architecture dnl in question.
+AC_MSG_CHECKING([mips subtarget])
+SIM_MIPS_SUBTARGET=
+AS_CASE([${target}],
+  [mips64vr*-*-*],  [SIM_MIPS_SUBTARGET="-DTARGET_ENABLE_FR=1"],
+  [mips*tx39*],     [SIM_MIPS_SUBTARGET="-DSUBTARGET_R3900=1"],
+  [mips*-sde-elf*], [SIM_MIPS_SUBTARGET="-DTARGET_ENABLE_FR=1"],
+  [mips*-mti-elf*], [SIM_MIPS_SUBTARGET="-DTARGET_ENABLE_FR=1"],
+  [mipsisa32*-*-*], [SIM_MIPS_SUBTARGET="-DTARGET_ENABLE_FR=1"],
+  [mipsisa64*-*-*], [SIM_MIPS_SUBTARGET="-DTARGET_ENABLE_FR=1"])
+AC_MSG_RESULT([${SIM_MIPS_SUBTARGET:-none}])
+AC_SUBST(SIM_MIPS_SUBTARGET)
diff --git a/sim/mips/configure.ac b/sim/mips/configure.ac
index 52e54bc8bceb..308b3aefbeb1 100644
--- a/sim/mips/configure.ac
+++ b/sim/mips/configure.ac
@@ -6,25 +6,6 @@ dnl The sim shouldn't be checking $target and changing behavior.  But it is,
 dnl and until we clean that up, we need to expand --target for use below.
 AC_CANONICAL_SYSTEM
 
-# DEPRECATED
-#
-# Instead of defining a `subtarget' macro, code should be checking
-# the value of {STATE,CPU}_ARCHITECTURE to identify the architecture
-# in question.
-#
-case "${target}" in
-  mips64vr*-*-*)	SIM_SUBTARGET="-DTARGET_ENABLE_FR=1" ;;
-  mips*tx39*)           SIM_SUBTARGET="-DSUBTARGET_R3900=1";;
-  mips*-sde-elf*)       SIM_SUBTARGET="-DTARGET_ENABLE_FR=1";;
-  mips*-mti-elf*)       SIM_SUBTARGET="-DTARGET_ENABLE_FR=1";;
-  mipsisa32*-*-*)       SIM_SUBTARGET="-DTARGET_ENABLE_FR=1";;
-  mipsisa64*-*-*)       SIM_SUBTARGET="-DTARGET_ENABLE_FR=1";;
-  *)                    SIM_SUBTARGET="";;
-esac
-AC_SUBST(SIM_SUBTARGET)
-
-
-
 #
 # Select the bitsize of the target
 #
-- 
2.39.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 3/5] sim: mips: move bitsize defines to top-level configure
  2022-12-21  5:13 [PATCH 1/5] sim: mips: always resolve active bfd mach dynamically Mike Frysinger
  2022-12-21  5:13 ` [PATCH 2/5] sim: mips: move subtarget defines to top-level configure Mike Frysinger
@ 2022-12-21  5:13 ` Mike Frysinger
  2022-12-21  5:13 ` [PATCH 4/5] sim: mips: move fpu " Mike Frysinger
  2022-12-21  5:13 ` [PATCH 5/5] sim: mips: match target on cpu settings Mike Frysinger
  3 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2022-12-21  5:13 UTC (permalink / raw)
  To: gdb-patches

Since the msb value is always defined as the wordsize-1, stop
hardcoding that value directly, and use a CPP value instead.
---
 sim/Makefile.in           |  1 +
 sim/arch-subdir.mk.in     |  1 +
 sim/configure             | 30 ++++++++++++++-
 sim/mips/Makefile.in      |  2 +
 sim/mips/acinclude-top.m4 | 14 +++++++
 sim/mips/aclocal.m4       |  1 -
 sim/mips/configure        | 81 +--------------------------------------
 sim/mips/configure.ac     | 17 --------
 8 files changed, 48 insertions(+), 99 deletions(-)

diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in
index 086a5cd80a68..38a18a378fd7 100644
--- a/sim/arch-subdir.mk.in
+++ b/sim/arch-subdir.mk.in
@@ -77,3 +77,4 @@ SIM_HW_OBJS = $(SIM_COMMON_HW_OBJS) $(SIM_HW_DEVICES:%=dv-%.o) $(SIM_HW_SOCKSER)
 
 # This can be removed once mips/configure is gone.
 SIM_MIPS_SUBTARGET = @SIM_MIPS_SUBTARGET@
+SIM_MIPS_BITSIZE = -DWITH_TARGET_WORD_BITSIZE=@SIM_MIPS_BITSIZE@ -DWITH_TARGET_WORD_MSB=WITH_TARGET_WORD_BITSIZE-1
diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in
index 50fa7a8fc27f..aa872883ec70 100644
--- a/sim/mips/Makefile.in
+++ b/sim/mips/Makefile.in
@@ -69,6 +69,8 @@ SIM_EXTRA_HW_DEVICES = tx3904cpu tx3904irc tx3904tmr tx3904sio
 # List of flags to always pass to $(CC).
 SIM_EXTRA_CFLAGS = $(SIM_MIPS_SUBTARGET)
 
+SIM_BITSIZE = $(SIM_MIPS_BITSIZE)
+
 SIM_EXTRA_CLEAN = clean-extra
 SIM_EXTRA_DISTCLEAN = distclean-extra
 
diff --git a/sim/mips/acinclude-top.m4 b/sim/mips/acinclude-top.m4
index 4eb6c19f8123..2d53bee13576 100644
--- a/sim/mips/acinclude-top.m4
+++ b/sim/mips/acinclude-top.m4
@@ -32,3 +32,17 @@ AS_CASE([${target}],
   [mipsisa64*-*-*], [SIM_MIPS_SUBTARGET="-DTARGET_ENABLE_FR=1"])
 AC_MSG_RESULT([${SIM_MIPS_SUBTARGET:-none}])
 AC_SUBST(SIM_MIPS_SUBTARGET)
+
+dnl Select the bitsize of the target.
+AC_MSG_CHECKING([mips bitsize])
+SIM_MIPS_BITSIZE=64
+AS_CASE([${target}],
+  [mips*-sde-elf*], [SIM_MIPS_BITSIZE=64],
+  [mips*-mti-elf*], [SIM_MIPS_BITSIZE=64],
+  [mips64*-*-*],    [SIM_MIPS_BITSIZE=64],
+  [mips16*-*-*],    [SIM_MIPS_BITSIZE=64],
+  [mipsisa32*-*-*], [SIM_MIPS_BITSIZE=32],
+  [mipsisa64*-*-*], [SIM_MIPS_BITSIZE=64],
+  [mips*-*-*],      [SIM_MIPS_BITSIZE=32])
+AC_MSG_RESULT([$SIM_MIPS_BITSIZE])
+AC_SUBST(SIM_MIPS_BITSIZE)
diff --git a/sim/mips/configure.ac b/sim/mips/configure.ac
index 308b3aefbeb1..d820b816fe01 100644
--- a/sim/mips/configure.ac
+++ b/sim/mips/configure.ac
@@ -6,23 +6,6 @@ dnl The sim shouldn't be checking $target and changing behavior.  But it is,
 dnl and until we clean that up, we need to expand --target for use below.
 AC_CANONICAL_SYSTEM
 
-#
-# Select the bitsize of the target
-#
-case "${target}" in
-  mips*-sde-elf*)       mips_bitsize=64 ; mips_msb=63 ;;
-  mips*-mti-elf*)       mips_bitsize=64 ; mips_msb=63 ;;
-  mips64*-*-*)          mips_bitsize=64 ; mips_msb=63 ;;
-  mips16*-*-*)          mips_bitsize=64 ; mips_msb=63 ;;
-  mipsisa32*-*-*)       mips_bitsize=32 ; mips_msb=31 ;;
-  mipsisa64*-*-*)       mips_bitsize=64 ; mips_msb=63 ;;
-  mips*-*-*)            mips_bitsize=32 ; mips_msb=31 ;;
-  *)                    mips_bitsize=64 ; mips_msb=63 ;;
-esac
-SIM_AC_OPTION_BITSIZE($mips_bitsize,$mips_msb)
-
-
-
 #
 # Select the floating hardware support of the target
 #
-- 
2.39.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 4/5] sim: mips: move fpu bitsize defines to top-level configure
  2022-12-21  5:13 [PATCH 1/5] sim: mips: always resolve active bfd mach dynamically Mike Frysinger
  2022-12-21  5:13 ` [PATCH 2/5] sim: mips: move subtarget defines to top-level configure Mike Frysinger
  2022-12-21  5:13 ` [PATCH 3/5] sim: mips: move bitsize " Mike Frysinger
@ 2022-12-21  5:13 ` Mike Frysinger
  2022-12-21  5:13 ` [PATCH 5/5] sim: mips: match target on cpu settings Mike Frysinger
  3 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2022-12-21  5:13 UTC (permalink / raw)
  To: gdb-patches

This drops support for the --enable-sim-float configure option,
but it's not clear anyone ever actually used that.  Eventually
we'll want this to be a runtime option anyways.
---
 sim/Makefile.in           |  1 +
 sim/arch-subdir.mk.in     |  1 +
 sim/configure             | 28 ++++++++++++++++++--
 sim/mips/Makefile.in      |  1 +
 sim/mips/acinclude-top.m4 | 13 ++++++++++
 sim/mips/aclocal.m4       |  1 -
 sim/mips/configure        | 54 ++-------------------------------------
 sim/mips/configure.ac     | 16 ------------
 8 files changed, 44 insertions(+), 71 deletions(-)

diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in
index 38a18a378fd7..6ac9ab8beb52 100644
--- a/sim/arch-subdir.mk.in
+++ b/sim/arch-subdir.mk.in
@@ -78,3 +78,4 @@ SIM_HW_OBJS = $(SIM_COMMON_HW_OBJS) $(SIM_HW_DEVICES:%=dv-%.o) $(SIM_HW_SOCKSER)
 # This can be removed once mips/configure is gone.
 SIM_MIPS_SUBTARGET = @SIM_MIPS_SUBTARGET@
 SIM_MIPS_BITSIZE = -DWITH_TARGET_WORD_BITSIZE=@SIM_MIPS_BITSIZE@ -DWITH_TARGET_WORD_MSB=WITH_TARGET_WORD_BITSIZE-1
+SIM_MIPS_FPU_BITSIZE = @SIM_MIPS_FPU_BITSIZE@
diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in
index aa872883ec70..ff9763b720b1 100644
--- a/sim/mips/Makefile.in
+++ b/sim/mips/Makefile.in
@@ -70,6 +70,7 @@ SIM_EXTRA_HW_DEVICES = tx3904cpu tx3904irc tx3904tmr tx3904sio
 SIM_EXTRA_CFLAGS = $(SIM_MIPS_SUBTARGET)
 
 SIM_BITSIZE = $(SIM_MIPS_BITSIZE)
+SIM_FLOAT = -DWITH_FLOATING_POINT=HARD_FLOATING_POINT -DWITH_TARGET_FLOATING_POINT_BITSIZE=$(SIM_MIPS_FPU_BITSIZE)
 
 SIM_EXTRA_CLEAN = clean-extra
 SIM_EXTRA_DISTCLEAN = distclean-extra
diff --git a/sim/mips/acinclude-top.m4 b/sim/mips/acinclude-top.m4
index 2d53bee13576..612aa92a2b80 100644
--- a/sim/mips/acinclude-top.m4
+++ b/sim/mips/acinclude-top.m4
@@ -46,3 +46,16 @@ AS_CASE([${target}],
   [mips*-*-*],      [SIM_MIPS_BITSIZE=32])
 AC_MSG_RESULT([$SIM_MIPS_BITSIZE])
 AC_SUBST(SIM_MIPS_BITSIZE)
+
+dnl Select the floating hardware support of the target.
+AC_MSG_CHECKING([mips fpu bitsize])
+SIM_MIPS_FPU_BITSIZE=64
+AS_CASE([${target}],
+  [mips*tx39*],     [SIM_MIPS_FPU_BITSIZE=32],
+  [mips*-sde-elf*], [SIM_MIPS_FPU_BITSIZE=64],
+  [mips*-mti-elf*], [SIM_MIPS_FPU_BITSIZE=64],
+  [mipsisa32*-*-*], [SIM_MIPS_FPU_BITSIZE=64],
+  [mipsisa64*-*-*], [SIM_MIPS_FPU_BITSIZE=64],
+  [mips*-*-*],      [SIM_MIPS_FPU_BITSIZE=32])
+AC_MSG_RESULT([$SIM_MIPS_FPU_BITSIZE])
+AC_SUBST(SIM_MIPS_FPU_BITSIZE)
diff --git a/sim/mips/configure.ac b/sim/mips/configure.ac
index d820b816fe01..6d158d7b0559 100644
--- a/sim/mips/configure.ac
+++ b/sim/mips/configure.ac
@@ -6,22 +6,6 @@ dnl The sim shouldn't be checking $target and changing behavior.  But it is,
 dnl and until we clean that up, we need to expand --target for use below.
 AC_CANONICAL_SYSTEM
 
-#
-# Select the floating hardware support of the target
-#
-mips_fpu_bitsize=
-case "${target}" in
-  mips*tx39*)           mips_fpu_bitsize=32 ;;
-  mips*-sde-elf*)       mips_fpu_bitsize=64 ;;
-  mips*-mti-elf*)       mips_fpu_bitsize=64 ;;
-  mipsisa32*-*-*)       mips_fpu_bitsize=64 ;;
-  mipsisa64*-*-*)       mips_fpu_bitsize=64 ;;
-  mips*-*-*)            mips_fpu_bitsize=32 ;;
-esac
-SIM_AC_OPTION_FLOAT(HARD_FLOATING_POINT,$mips_fpu_bitsize)
-
-
-
 #
 # Select the IGEN architecture
 #
-- 
2.39.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 5/5] sim: mips: match target on cpu settings
  2022-12-21  5:13 [PATCH 1/5] sim: mips: always resolve active bfd mach dynamically Mike Frysinger
                   ` (2 preceding siblings ...)
  2022-12-21  5:13 ` [PATCH 4/5] sim: mips: move fpu " Mike Frysinger
@ 2022-12-21  5:13 ` Mike Frysinger
  3 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2022-12-21  5:13 UTC (permalink / raw)
  To: gdb-patches

We don't need to enforce larger target settings when the only thing
the sim should care about is the CPU target.  So reduce most of the
target matches to only check the CPU.
---
 sim/mips/configure    | 26 +++++++++++++-------------
 sim/mips/configure.ac | 26 +++++++++++++-------------
 2 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/sim/mips/configure.ac b/sim/mips/configure.ac
index 6d158d7b0559..bdea84e821cd 100644
--- a/sim/mips/configure.ac
+++ b/sim/mips/configure.ac
@@ -20,10 +20,10 @@ case "${target}" in
 			sim_igen_filter="32,f"
 			sim_igen_machine="-M r3900"
 			;;
-  mips64vr43*-*-*)	sim_gen=IGEN
+  mips64vr43*)		sim_gen=IGEN
 			sim_igen_machine="-M mipsIV"
 			;;
-  mips64vr5*-*-*)	sim_gen=IGEN
+  mips64vr5*)		sim_gen=IGEN
 			sim_igen_machine="-M vr5000"
 			;;
   mips64vr41*)		sim_gen=M16
@@ -32,7 +32,7 @@ case "${target}" in
 			sim_igen_filter="32,64,f"
 			sim_m16_filter="16"
                         ;;
-  mips64vr-*-* | mips64vrel-*-*)
+  mips64vr-* | mips64vrel-*)
 			sim_gen=MULTI
 			sim_multi_configs="\
 			  vr4100:mipsIII,mips16,vr4100:32,64:mips4100,mips4111\
@@ -50,42 +50,42 @@ case "${target}" in
 			  mipsisa64r6:mips64r6:32,64,f:mipsisa32r6,mipsisa64r6"
 			sim_multi_default=mipsisa64r2
 			;;
-  mips64*-*-*)		sim_igen_filter="32,64,f"
+  mips64*)		sim_igen_filter="32,64,f"
 			sim_gen=IGEN
 			;;
-  mips16*-*-*)		sim_gen=M16
+  mips16*)		sim_gen=M16
 			sim_igen_filter="32,64,f"
 			sim_m16_filter="16"
 			;;
-  mipsisa32r2*-*-*)	sim_gen=MULTI
+  mipsisa32r2*)		sim_gen=MULTI
 			sim_multi_configs="\
 			  micromips:micromips32,micromipsdsp:32,f:mips_micromips\
 			  mips32r2:mips32r2,mips3d,mips16,mips16e,mdmx,dsp,dsp2,smartmips:32,f:mipsisa32r2"
 			sim_multi_default=mipsisa32r2
 			;;
-  mipsisa32r6*-*-*)	sim_gen=IGEN
+  mipsisa32r6*)		sim_gen=IGEN
 			sim_igen_machine="-M mips32r6"
 			sim_igen_filter="32,f"
 			;;
-  mipsisa32*-*-*)	sim_gen=M16
+  mipsisa32*)		sim_gen=M16
 			sim_igen_machine="-M mips32,mips16,mips16e,smartmips"
 			sim_m16_machine="-M mips16,mips16e,mips32"
 			sim_igen_filter="32,f"
 			;;
-  mipsisa64r2*-*-*)	sim_gen=M16
+  mipsisa64r2*)		sim_gen=M16
 			sim_igen_machine="-M mips64r2,mips3d,mips16,mips16e,mdmx,dsp,dsp2"
 			sim_m16_machine="-M mips16,mips16e,mips64r2"
 			sim_igen_filter="32,64,f"
 			;;
-  mipsisa64r6*-*-*)	sim_gen=IGEN
+  mipsisa64r6*)		sim_gen=IGEN
 			sim_igen_machine="-M mips64r6"
 			sim_igen_filter="32,64,f"
 			;;
-  mipsisa64sb1*-*-*)	sim_gen=IGEN
+  mipsisa64sb1*)	sim_gen=IGEN
 			sim_igen_machine="-M mips64,mips3d,sb1"
 			sim_igen_filter="32,64,f"
 			;;
-  mipsisa64*-*-*)	sim_gen=M16
+  mipsisa64*)		sim_gen=M16
 			sim_igen_machine="-M mips64,mips3d,mips16,mips16e,mdmx"
 			sim_m16_machine="-M mips16,mips16e,mips64"
 			sim_igen_filter="32,64,f"
@@ -96,7 +96,7 @@ case "${target}" in
 			sim_igen_filter="32,f"
 			sim_m16_filter="16"
 			;;
-  mips*-*-*)		sim_gen=IGEN
+  mips*)		sim_gen=IGEN
 			sim_igen_filter="32,f"
 			;;
 esac
-- 
2.39.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-21  5:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-21  5:13 [PATCH 1/5] sim: mips: always resolve active bfd mach dynamically Mike Frysinger
2022-12-21  5:13 ` [PATCH 2/5] sim: mips: move subtarget defines to top-level configure Mike Frysinger
2022-12-21  5:13 ` [PATCH 3/5] sim: mips: move bitsize " Mike Frysinger
2022-12-21  5:13 ` [PATCH 4/5] sim: mips: move fpu " Mike Frysinger
2022-12-21  5:13 ` [PATCH 5/5] sim: mips: match target on cpu settings Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).