aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-06-15 19:51:52 -0400
committerMike Frysinger <vapier@gentoo.org>2021-06-17 23:20:13 -0400
commitf9a4d54332f9e1f75701ba43249a03cc631ec736 (patch)
tree2dd0b32c633005ac4378a2282d9726885e09a7b5 /sim/ppc
parent4470708442cef1c818c4322f975d9017307f0243 (diff)
downloadgdb-f9a4d54332f9e1f75701ba43249a03cc631ec736.zip
gdb-f9a4d54332f9e1f75701ba43249a03cc631ec736.tar.gz
gdb-f9a4d54332f9e1f75701ba43249a03cc631ec736.tar.bz2
sim: overhaul & unify endian settings management
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, the arch is expected to support both, and the value will be probed based on the user runtime options or the input program. Only two arches today set the default value (bpf & mips). We can probably let this go as it only shows up in one scenario: the sim is invoked, but with no inputs, and no user endian selection. This means bpf will not behave like the other arches: an error is shown and forces the user to make a choice. If an input program is used though, we'll still switch the default to that. This allows us to remove the WITH_DEFAULT_TARGET_BYTE_ORDER setting. For the ports that set a "wire" endian, move it to the runtime init of the respective sim_open calls. This allows us to change the WITH_TARGET_BYTE_ORDER to purely a user-selected configure setting if they want to force a specific endianness. With all the endian logic moved to runtime selection, we can move the configure call up to the common dir so we only process it once across all ports. The ppc arch was picking the wire endian based on the target used, but since we weren't doing that for other biendian arches, we can let this go too. We'll rely on the input selecting the endian, or make the user decide.
Diffstat (limited to 'sim/ppc')
-rw-r--r--sim/ppc/ChangeLog6
-rw-r--r--sim/ppc/Makefile.in2
-rwxr-xr-xsim/ppc/configure25
-rw-r--r--sim/ppc/configure.ac19
4 files changed, 6 insertions, 46 deletions
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index 280234a..fc3f62f 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,5 +1,11 @@
2021-06-17 Mike Frysinger <vapier@gentoo.org>
+ * Makefile.in (ENDIAN_CFLAGS): Delete.
+ * configure.ac: Delete sim-endian.
+ * configure: Regenerate.
+
+2021-06-17 Mike Frysinger <vapier@gentoo.org>
+
* igen.c (gen_semantics_h): Rename PAGE_SIZE to MPC860C0_PAGE_SIZE.
* ppc-instructions: Likewise.
diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index c1135a3..4446922 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -72,7 +72,6 @@ MAKEINFO = makeinfo
RANLIB = @RANLIB@
INLINE_CFLAGS = @sim_inline@
-ENDIAN_CFLAGS = @sim_endian@
SMP_CFLAGS = @sim_smp@
XOR_ENDIAN_CFLAGS = @sim_xor_endian@
BITSIZE_CFLAGS = @sim_bitsize@
@@ -86,7 +85,6 @@ TERMIO_CFLAGS = @sim_termio@
WARNING_CFLAGS = @sim_warnings@
DEVZERO_CFLAGS = @sim_devzero@
CONFIG_CFLAGS = \
- $(ENDIAN_CFLAGS) \
$(SMP_CFLAGS) \
$(XOR_ENDIAN_CFLAGS) \
$(BITSIZE_CFLAGS) \
diff --git a/sim/ppc/configure b/sim/ppc/configure
index 7927bed..930b24a 100755
--- a/sim/ppc/configure
+++ b/sim/ppc/configure
@@ -639,7 +639,6 @@ sim_bitsize
sim_igen_smp
sim_smp
sim_xor_endian
-sim_endian
sim_inline
sim_pk_obj
sim_pk_src
@@ -745,7 +744,6 @@ enable_sim_config
enable_sim_decode_mechanism
enable_sim_default_model
enable_sim_duplicate
-enable_sim_endian
enable_sim_filter
enable_sim_float
enable_sim_hardware
@@ -1400,7 +1398,6 @@ Optional Features:
--enable-sim-decode-mechanism=which Specify the instruction decode mechanism.
--enable-sim-default-model=which Specify default PowerPC to model.
--enable-sim-duplicate Expand (duplicate) semantic functions.
- --enable-sim-endian=endian Specify target byte endian orientation.
--enable-sim-filter=rule Specify filter rules.
--enable-sim-float Specify whether the target has hard, soft, altivec or e500 floating point.
--enable-sim-hardware=list Specify the hardware to be included in the build.
@@ -3201,27 +3198,6 @@ fi
fi
-# Check whether --enable-sim-endian was given.
-if test "${enable_sim_endian+set}" = set; then :
- enableval=$enable_sim_endian; case "${enableval}" in
- yes) case "$target" in
- *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_BIG";;
- *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_LITTLE";;
- *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_UNKNOWN";;
- esac;;
- no) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_UNKNOWN";;
- b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_BIG";;
- l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_LITTLE";;
- *) as_fn_error $? "\"Unknown value $enableval for --enable-sim-endian\"" "$LINENO" 5; sim_endian="";;
-esac
-if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
- echo "Setting endian flags = $sim_endian" 6>&1
-fi
-else
- sim_endian=""
-fi
-
-
# Check whether --enable-sim-filter was given.
if test "${enable_sim_filter+set}" = set; then :
enableval=$enable_sim_filter; case "${enableval}" in
@@ -4882,7 +4858,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 5867f60..9d294ae 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -93,24 +93,6 @@ if test x"$silent" != x"yes"; then
fi])dnl
-AC_ARG_ENABLE(sim-endian,
-[ --enable-sim-endian=endian Specify target byte endian orientation.],
-[case "${enableval}" in
- yes) case "$target" in
- *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_BIG";;
- *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_LITTLE";;
- *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_UNKNOWN";;
- esac;;
- no) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_UNKNOWN";;
- b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_BIG";;
- l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_LITTLE";;
- *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";;
-esac
-if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
- echo "Setting endian flags = $sim_endian" 6>&1
-fi],[sim_endian=""])dnl
-
-
AC_ARG_ENABLE(sim-filter,
[ --enable-sim-filter=rule Specify filter rules.],
[case "${enableval}" in
@@ -758,7 +740,6 @@ AC_SUBST(sim_hw_obj)
AC_SUBST(sim_pk_src)
AC_SUBST(sim_pk_obj)
AC_SUBST(sim_inline)
-AC_SUBST(sim_endian)
AC_SUBST(sim_xor_endian)
AC_SUBST(sim_smp)
AC_SUBST(sim_igen_smp)