aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-06-07 00:54:20 -0400
committerMike Frysinger <vapier@gentoo.org>2021-06-12 21:14:50 -0400
commitba307cddcf7e42c5099632dcbad598d8f96044f4 (patch)
tree4e47888728073d7d203ecc10effb1cff3d59f794 /sim/ppc
parent6dd65fc048dbe167b809f687acc6228eb07ecec6 (diff)
downloadfsf-binutils-gdb-ba307cddcf7e42c5099632dcbad598d8f96044f4.zip
fsf-binutils-gdb-ba307cddcf7e42c5099632dcbad598d8f96044f4.tar.gz
fsf-binutils-gdb-ba307cddcf7e42c5099632dcbad598d8f96044f4.tar.bz2
sim: overhaul alignment settings management
Currently, the sim-config module will abort if alignment settings haven't been specified by the port's configure.ac. This is a bit weird when we've allowed SIM_AC_OPTION_ALIGNMENT to seem like it's optional to use. Thus everyone invokes it. There are 4 alignment settings, but really only 2 matters: strict and nonstrict. The "mixed" setting is just the default ("unset"), and "forced" isn't used directly by anyone (it's available as a runtime option for some ports). The m4 macro has 2 args: the "wire" settings (which represents the hardwired port behavior), and the default settings (which are used if nothing else is specified). If none are specified, then the build won't work (see above as if SIM_AC_OPTION_ALIGNMENT wasn't called). If default settings are provided, then that is used, but we allow the user to override at runtime. Otherwise, the "wire" settings are used and user runtime options to change are ignored. Most ports specify a default, or set the "wire" to nonstrict. A few set "wire" to strict, but it's not clear that's necessary as it doesn't make the code behavior, by default, any different. It might make things a little faster, but we should provide the user the choice of the compromises to make: force a specific mode at compile time for faster runtime, or allow the choice at runtime. More likely it seems like an oversight when these ports were initially created, and/or copied & pasted from existing ports. With all that backstory, let's get to what this commit does. First kill off the idea of a compile-time default alignment and set it to nonstrict in the common code. For any ports that want strict alignment by default, that code is moved to sim_open while initializing the sim. That means WITH_DEFAULT_ALIGNMENT can be completely removed. Moving the default alignment to the runtime also allows removal of setting the "wire" settings at configure time. Which allows removing of all arguments to SIM_AC_OPTION_ALIGNMENT and moving that call to common code. The macro logic can be reworked to not pass WITH_ALIGNMENT as -D CPPFLAG and instead move it to config.h. All of these taken together mean we can hoist the macro up to the top level and share it among all sims so behavior is consistent among all the ports.
Diffstat (limited to 'sim/ppc')
-rw-r--r--sim/ppc/ChangeLog6
-rw-r--r--sim/ppc/Makefile.in2
-rwxr-xr-xsim/ppc/configure20
-rw-r--r--sim/ppc/configure.ac14
4 files changed, 6 insertions, 36 deletions
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index 3926430..49b3e66 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,5 +1,11 @@
2021-06-12 Mike Frysinger <vapier@gentoo.org>
+ * Makefile.in: Delete ALIGNMENT_CFLAGS.
+ * configure.ac: Delete sim-alignment.
+ * configure: Regenerate.
+
+2021-06-12 Mike Frysinger <vapier@gentoo.org>
+
* configure.ac: Delete calls to ACX_PKGVERSION & ACX_BUGURL.
* aclocal.m4, config.in, configure: Regenerate.
diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 1996e13..5d0dd74 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -79,7 +79,6 @@ XOR_ENDIAN_CFLAGS = @sim_xor_endian@
BITSIZE_CFLAGS = @sim_bitsize@
HOSTBITSIZE_CFLAGS = @sim_hostbitsize@
TIMEBASE_CFLAGS = @sim_timebase@
-ALIGNMENT_CFLAGS = @sim_alignment@
FLOAT_CFLAGS = @sim_float@
RESERVED_CFLAGS = @sim_reserved@
MONITOR_CFLAGS = @sim_monitor@
@@ -95,7 +94,6 @@ CONFIG_CFLAGS = \
$(BITSIZE_CFLAGS) \
$(HOSTBITSIZE_CFLAGS) \
$(TIMEBASE_CFLAGS) \
- $(ALIGNMENT_CFLAGS) \
$(FLOAT_CFLAGS) \
$(RESERVED_CFLAGS) \
$(MONITOR_CFLAGS) \
diff --git a/sim/ppc/configure b/sim/ppc/configure
index 5f0f779..c7dd1b4 100755
--- a/sim/ppc/configure
+++ b/sim/ppc/configure
@@ -633,7 +633,6 @@ sim_model
sim_monitor
sim_reserved
sim_float
-sim_alignment
sim_timebase
sim_hostbitsize
sim_bitsize
@@ -742,7 +741,6 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
-enable_sim_alignment
enable_sim_assert
enable_sim_bitsize
enable_sim_config
@@ -1400,7 +1398,6 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-sim-alignment=align Specify strict or nonstrict alignment.
--enable-sim-assert Specify whether to perform random assertions.
--enable-sim-bitsize=n Specify target bitsize (32 or 64).
--enable-sim-config=file Override default config file
@@ -3120,22 +3117,6 @@ $as_echo "$LINGUAS" >&6; }
fi
-# Check whether --enable-sim-alignment was given.
-if test "${enable_sim_alignment+set}" = set; then :
- enableval=$enable_sim_alignment; case "${enableval}" in
- yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
- no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
- 0 | default | DEFAULT) sim_alignment="-DWITH_ALIGNMENT=0";;
- *) as_fn_error $? "\"Unknown value $enableval passed to --enable-sim-alignment\"" "$LINENO" 5; sim_alignment="";;
-esac
-if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
- echo "Setting alignment flags = $sim_alignment" 6>&1
-fi
-else
- sim_alignment=""
-fi
-
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable sim asserts" >&5
$as_echo_n "checking whether to enable sim asserts... " >&6; }
sim_assert="1"
@@ -5179,7 +5160,6 @@ fi
-
ac_config_files="$ac_config_files Makefile"
ac_config_commands="$ac_config_commands default"
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index 5697345..3b93bee 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -19,19 +19,6 @@ ALL_LINGUAS=
ZW_GNU_GETTEXT_SISTER_DIR(../../intl)
-AC_ARG_ENABLE(sim-alignment,
-[ --enable-sim-alignment=align Specify strict or nonstrict alignment.],
-[case "${enableval}" in
- yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
- no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
- 0 | default | DEFAULT) sim_alignment="-DWITH_ALIGNMENT=0";;
- *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
-esac
-if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
- echo "Setting alignment flags = $sim_alignment" 6>&1
-fi],[sim_alignment=""])dnl
-
-
AC_MSG_CHECKING([whether to enable sim asserts])
sim_assert="1"
AC_ARG_ENABLE(sim-assert,
@@ -818,7 +805,6 @@ AC_SUBST(sim_igen_smp)
AC_SUBST(sim_bitsize)
AC_SUBST(sim_hostbitsize)
AC_SUBST(sim_timebase)
-AC_SUBST(sim_alignment)
AC_SUBST(sim_float)
AC_SUBST(sim_reserved)
AC_SUBST(sim_monitor)