* [PATCH] sim: unify reserved instruction bits settings
@ 2021-07-01 5:28 Mike Frysinger
0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2021-07-01 5:28 UTC (permalink / raw)
To: gdb-patches
Move these options up to the common dir so we only test & export
them once across all ports.
The setting only affects igen based ports, and they were turning
this on by default, so keep the default in place.
---
sim/Makefile.in | 2 +-
sim/aclocal.m4 | 1 +
sim/bpf/configure | 2 --
sim/common/Make-common.in | 2 --
sim/config.h.in | 3 +++
sim/configure | 35 ++++++++++++++++++++++++---
sim/configure.ac | 2 +-
sim/m4/sim_ac_option_reserved_bits.m4 | 23 ++++++++++--------
sim/m4/sim_ac_output.m4 | 1 -
sim/mips/aclocal.m4 | 1 -
sim/mips/configure | 23 ------------------
sim/mips/configure.ac | 3 ---
sim/mn10300/aclocal.m4 | 1 -
sim/mn10300/configure | 22 -----------------
sim/mn10300/configure.ac | 1 -
sim/or1k/configure | 2 --
sim/ppc/Makefile.in | 2 --
sim/ppc/configure | 19 ---------------
sim/ppc/configure.ac | 13 ----------
sim/ppc/std-config.h | 6 -----
sim/riscv/configure | 2 --
sim/v850/aclocal.m4 | 1 -
sim/v850/configure | 22 -----------------
sim/v850/configure.ac | 1 -
24 files changed, 50 insertions(+), 140 deletions(-)
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index e7c1cce46f41..0048c3e8eed3 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -74,7 +74,6 @@ SHELL = @SHELL@
SIM_BITSIZE = @sim_bitsize@
SIM_FLOAT = @sim_float@
-SIM_RESERVED_BITS = @sim_reserved_bits@
SIM_WARN_CFLAGS = $(WARN_CFLAGS)
SIM_WERROR_CFLAGS = $(WERROR_CFLAGS)
@@ -197,7 +196,6 @@ CONFIG_CFLAGS = \
$(SIM_FLOAT) \
$(SIM_HW_CFLAGS) \
$(SIM_INLINE) \
- $(SIM_RESERVED_BITS) \
$(SIM_WARN_CFLAGS) \
$(SIM_WERROR_CFLAGS) \
$(SIM_HARDWARE)
diff --git a/sim/configure.ac b/sim/configure.ac
index febedfc7a0e8..098d88bc01ef 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -161,6 +161,7 @@ SIM_AC_OPTION_ENVIRONMENT
SIM_AC_OPTION_HARDWARE
SIM_AC_OPTION_INLINE
SIM_AC_OPTION_PROFILE
+SIM_AC_OPTION_RESERVED_BITS
SIM_AC_OPTION_SCACHE
SIM_AC_OPTION_STDIO
SIM_AC_OPTION_TRACE
@@ -172,7 +173,6 @@ dnl when the rest of the code is in the respective macros. Once we merge the
dnl respective SIM_AC_OPTION_xxx call above, we can drop these.
AC_SUBST(sim_bitsize)
AC_SUBST(sim_float)
-AC_SUBST(sim_reserved_bits)
dnl Some arches have unique configure flags.
m4_include([frv/acinclude.m4])
diff --git a/sim/m4/sim_ac_option_reserved_bits.m4 b/sim/m4/sim_ac_option_reserved_bits.m4
index 8147ed8bfdd0..c65f87b5acb5 100644
--- a/sim/m4/sim_ac_option_reserved_bits.m4
+++ b/sim/m4/sim_ac_option_reserved_bits.m4
@@ -13,18 +13,21 @@ 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/>.
AC_DEFUN([SIM_AC_OPTION_RESERVED_BITS],
-[
-default_sim_reserved_bits="ifelse([$1],,1,[$1])"
+[dnl
+AC_MSG_CHECKING([whether to check reserved bits in instruction])
AC_ARG_ENABLE(sim-reserved-bits,
[AS_HELP_STRING([--enable-sim-reserved-bits],
[Specify whether to check reserved bits in instruction])],
[case "${enableval}" in
- yes) sim_reserved_bits="-DWITH_RESERVED_BITS=1";;
- no) sim_reserved_bits="-DWITH_RESERVED_BITS=0";;
- *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved_bits="";;
-esac
-if test x"$silent" != x"yes" && test x"$sim_reserved_bits" != x""; then
- echo "Setting reserved flags = $sim_reserved_bits" 6>&1
-fi],[sim_reserved_bits="-DWITH_RESERVED_BITS=${default_sim_reserved_bits}"])dnl
+yes|no) ;;
+*) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value");;
+esac])
+if test "x${enable_sim_reserved_bits}" != xno; then
+ sim_reserved_bits=1
+ AC_MSG_RESULT([yes])
+else
+ sim_reserved_bits=0
+ AC_MSG_RESULT([no])
+fi
+AC_DEFINE_UNQUOTED([WITH_RESERVED_BITS], [$sim_reserved_bits], [Sim reserved bits setting])
])
-AC_SUBST(sim_reserved_bits)
diff --git a/sim/m4/sim_ac_output.m4 b/sim/m4/sim_ac_output.m4
index 3866213b91fe..256187dc3baa 100644
--- a/sim/m4/sim_ac_output.m4
+++ b/sim/m4/sim_ac_output.m4
@@ -47,7 +47,6 @@ dnl but always used by common/Make-common.in. So we have to subst here even
dnl when the rest of the code is in the respective macros.
AC_SUBST(sim_bitsize)
AC_SUBST(sim_float)
-AC_SUBST(sim_reserved_bits)
dnl Used by common/Make-common.in to see which configure script created it.
SIM_COMMON_BUILD_TRUE='#'
diff --git a/sim/mips/configure.ac b/sim/mips/configure.ac
index e3a44a0055fa..9430923d89a1 100644
--- a/sim/mips/configure.ac
+++ b/sim/mips/configure.ac
@@ -2,9 +2,6 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(Makefile.in)
AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
-dnl Options available in this module
-SIM_AC_OPTION_RESERVED_BITS(1)
-
# DEPRECATED
#
# Instead of defining a `subtarget' macro, code should be checking
diff --git a/sim/mn10300/configure.ac b/sim/mn10300/configure.ac
index 74eb1fa54685..1fa7c0ef7c9f 100644
--- a/sim/mn10300/configure.ac
+++ b/sim/mn10300/configure.ac
@@ -2,7 +2,6 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(Makefile.in)
AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
-SIM_AC_OPTION_RESERVED_BITS
SIM_AC_OPTION_BITSIZE(32,31)
SIM_AC_OUTPUT
diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 964d667d99d5..3a5d43cad6ca 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -65,7 +65,6 @@ BITSIZE_CFLAGS = @sim_bitsize@
HOSTBITSIZE_CFLAGS = @sim_hostbitsize@
TIMEBASE_CFLAGS = @sim_timebase@
FLOAT_CFLAGS = @sim_float@
-RESERVED_CFLAGS = @sim_reserved@
MONITOR_CFLAGS = @sim_monitor@
MODEL_CFLAGS = @sim_model@ @sim_default_model@ @sim_model_issue@
TERMIO_CFLAGS = @sim_termio@
@@ -78,7 +77,6 @@ CONFIG_CFLAGS = \
$(HOSTBITSIZE_CFLAGS) \
$(TIMEBASE_CFLAGS) \
$(FLOAT_CFLAGS) \
- $(RESERVED_CFLAGS) \
$(MONITOR_CFLAGS) \
$(MODEL_CFLAGS) \
$(TERMIO_CFLAGS) \
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index a7d226df5cf6..42ccda3811a5 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -376,18 +376,6 @@ if test x"$silent" != x"yes"; then
fi])dnl
-AC_ARG_ENABLE(sim-reserved-bits,
-[ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
-[case "${enableval}" in
- yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
- no) sim_reserved="-DWITH_RESERVED_BITS=0";;
- *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
-esac
-if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
- echo "Setting reserved flags = $sim_reserved" 6>&1
-fi],[sim_reserved=""])dnl
-
-
AC_ARG_ENABLE(sim-smp,
[ --enable-sim-smp=n Specify number of processors to configure for.],
[case "${enableval}" in
@@ -690,7 +678,6 @@ AC_SUBST(sim_bitsize)
AC_SUBST(sim_hostbitsize)
AC_SUBST(sim_timebase)
AC_SUBST(sim_float)
-AC_SUBST(sim_reserved)
AC_SUBST(sim_monitor)
AC_SUBST(sim_model)
AC_SUBST(sim_default_model)
diff --git a/sim/ppc/std-config.h b/sim/ppc/std-config.h
index 75aaa5881566..0619d1dff191 100644
--- a/sim/ppc/std-config.h
+++ b/sim/ppc/std-config.h
@@ -220,12 +220,6 @@ extern int current_floating_point;
Control the inclusion of debugging code. */
-/* Whether to check instructions for reserved bits being set */
-
-#ifndef WITH_RESERVED_BITS
-#define WITH_RESERVED_BITS 1
-#endif
-
/* include monitoring code */
#define MONITOR_INSTRUCTION_ISSUE 1
diff --git a/sim/v850/configure.ac b/sim/v850/configure.ac
index 74eb1fa54685..1fa7c0ef7c9f 100644
--- a/sim/v850/configure.ac
+++ b/sim/v850/configure.ac
@@ -2,7 +2,6 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(Makefile.in)
AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
-SIM_AC_OPTION_RESERVED_BITS
SIM_AC_OPTION_BITSIZE(32,31)
SIM_AC_OUTPUT
--
2.31.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-07-01 5:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-01 5:28 [PATCH] sim: unify reserved instruction bits 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).