aboutsummaryrefslogtreecommitdiff
path: root/sim/mips
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/mips
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/mips')
-rw-r--r--sim/mips/ChangeLog4
-rw-r--r--sim/mips/aclocal.m41
-rwxr-xr-xsim/mips/configure58
-rw-r--r--sim/mips/configure.ac1
4 files changed, 8 insertions, 56 deletions
diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
index 7883bfa..60c5e7a 100644
--- a/sim/mips/ChangeLog
+++ b/sim/mips/ChangeLog
@@ -1,5 +1,9 @@
2021-06-12 Mike Frysinger <vapier@gentoo.org>
+ * configure.ac: Delete call to SIM_AC_OPTION_ALIGNMENT.
+
+2021-06-12 Mike Frysinger <vapier@gentoo.org>
+
* aclocal.m4, config.in, configure: Regenerate.
2021-06-12 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/mips/aclocal.m4 b/sim/mips/aclocal.m4
index 203d14c..b61eb2e 100644
--- a/sim/mips/aclocal.m4
+++ b/sim/mips/aclocal.m4
@@ -110,7 +110,6 @@ m4_include([../../ltsugar.m4])
m4_include([../../ltversion.m4])
m4_include([../../lt~obsolete.m4])
m4_include([../m4/sim_ac_common.m4])
-m4_include([../m4/sim_ac_option_alignment.m4])
m4_include([../m4/sim_ac_option_bitsize.m4])
m4_include([../m4/sim_ac_option_endian.m4])
m4_include([../m4/sim_ac_option_float.m4])
diff --git a/sim/mips/configure b/sim/mips/configure
index 42ee0f8..55ce9af 100755
--- a/sim/mips/configure
+++ b/sim/mips/configure
@@ -633,6 +633,7 @@ ac_subst_vars='LTLIBOBJS
LIBOBJS
sim_default_model
sim_scache
+sim_alignment
cgen_breaks
XMKMF
sim_multi_obj
@@ -764,8 +765,7 @@ sim_hw_objs
sim_hw_cflags
sim_float
sim_endian
-sim_bitsize
-sim_alignment'
+sim_bitsize'
ac_subst_files=''
ac_user_opts='
enable_option_checking
@@ -779,7 +779,6 @@ with_gnu_ld
enable_libtool_lock
enable_maintainer_mode
enable_sim_inline
-enable_sim_alignment
enable_werror
enable_build_warnings
enable_sim_build_warnings
@@ -1432,9 +1431,6 @@ Optional Features:
sometimes confusing) to the casual installer
--enable-sim-inline=inlines
Specify which functions should be inlined
- --enable-sim-alignment=align
- Specify strict, nonstrict or forced alignment of
- memory accesses
--enable-werror treat compile warnings as errors
--enable-build-warnings enable build-time compiler warnings if gcc is used
--enable-sim-build-warnings
@@ -10776,7 +10772,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10779 "configure"
+#line 10775 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10882,7 +10878,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10885 "configure"
+#line 10881 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11179,52 +11175,6 @@ fi
-wire_alignment="NONSTRICT_ALIGNMENT"
-default_alignment=""
-
-# Check whether --enable-sim-alignment was given.
-if test "${enable_sim_alignment+set}" = set; then :
- enableval=$enable_sim_alignment; case "${enableval}" in
- strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
- nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
- forced | FORCED) sim_alignment="-DWITH_ALIGNMENT=FORCED_ALIGNMENT";;
- yes) if test x"$wire_alignment" != x; then
- sim_alignment="-DWITH_ALIGNMENT=${wire_alignment}"
- else
- if test x"$default_alignment" != x; then
- sim_alignment="-DWITH_ALIGNMENT=${default_alignment}"
- else
- echo "No hard-wired alignment for target $target" 1>&6
- sim_alignment="-DWITH_ALIGNMENT=0"
- fi
- fi;;
- no) if test x"$default_alignment" != x; then
- sim_alignment="-DWITH_DEFAULT_ALIGNMENT=${default_alignment}"
- else
- if test x"$wire_alignment" != x; then
- sim_alignment="-DWITH_DEFAULT_ALIGNMENT=${wire_alignment}"
- else
- echo "No default alignment for target $target" 1>&6
- sim_alignment="-DWITH_DEFAULT_ALIGNMENT=0"
- fi
- fi;;
- *) 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
- if test x"$default_alignment" != x; then
- sim_alignment="-DWITH_DEFAULT_ALIGNMENT=${default_alignment}"
-else
- if test x"$wire_alignment" != x; then
- sim_alignment="-DWITH_ALIGNMENT=${wire_alignment}"
- else
- sim_alignment=
- fi
-fi
-fi
-
# Check whether --enable-werror was given.
if test "${enable_werror+set}" = set; then :
diff --git a/sim/mips/configure.ac b/sim/mips/configure.ac
index f4e6737..f0b26b4 100644
--- a/sim/mips/configure.ac
+++ b/sim/mips/configure.ac
@@ -5,7 +5,6 @@ AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
SIM_AC_COMMON
dnl Options available in this module
-SIM_AC_OPTION_ALIGNMENT(NONSTRICT_ALIGNMENT)
SIM_AC_OPTION_WARNINGS(no)
SIM_AC_OPTION_RESERVED_BITS(1)