From 9bbf6f91c6e85ca916ec2c266009167f20f5ecfd Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 4 Jan 2016 04:06:01 -0500 Subject: sim: punt x86-specific bswap logic The compiler/C library should produce reasonable code for htonl/ntohl, and at least glibc tries pretty hard to always produce good code for them. This logic only had support for 32-bit x86 systems anymore, and it's unlikely people were even opting into this, so drop it all. --- sim/common/ChangeLog | 9 +++++++++ sim/common/Make-common.in | 2 -- sim/common/acinclude.m4 | 15 --------------- sim/common/configure | 23 ++--------------------- sim/common/sim-config.h | 18 +----------------- 5 files changed, 12 insertions(+), 55 deletions(-) (limited to 'sim/common') diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 9de5238..97a170a 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,12 @@ +2016-01-04 Mike Frysinger + + * acinclude.m4 (sim-bswap): Delete. + * configure: Regenerate. + * Make-common.in (SIM_BSWAP): Delete. + (CONFIG_CFLAGS): Delete $(SIM_BSWAP). + * sim-config.h (htonl, ntohl): Delete. + (WITH_BSWAP): Delete. + 2016-01-03 Mike Frysinger * sim-options.c (sim_parse_args): Declare local save_opterr. Save diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index 36497e7..6fdf10f 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -75,7 +75,6 @@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXXFLAGS = @CXXFLAGS@ LDFLAGS = @LDFLAGS@ -SIM_BSWAP = @sim_bswap@ SIM_CFLAGS = @sim_cflags@ SIM_DEBUG = @sim_debug@ SIM_TRACE = @sim_trace@ @@ -234,7 +233,6 @@ CONFIG_CFLAGS = \ $(SIM_DEFAULT_MODEL) \ $(SIM_TRACE) \ $(SIM_PROFILE) \ - $(SIM_BSWAP) \ $(SIM_ASSERT) \ $(SIM_ALIGNMENT) \ $(SIM_BITSIZE) \ diff --git a/sim/common/acinclude.m4 b/sim/common/acinclude.m4 index 9529337..47bc2de 100644 --- a/sim/common/acinclude.m4 +++ b/sim/common/acinclude.m4 @@ -117,21 +117,6 @@ dnl --enable-maintainer-mode. AM_MAINTAINER_MODE -dnl This is a generic option to enable special byte swapping -dnl insns on *any* cpu. -AC_ARG_ENABLE(sim-bswap, -[AS_HELP_STRING([--enable-sim-bswap], [Use Host specific BSWAP instruction])], -[case "${enableval}" in - yes) sim_bswap="-DWITH_BSWAP=1 -DUSE_BSWAP=1";; - no) sim_bswap="-DWITH_BSWAP=0";; - *) AC_MSG_ERROR("--enable-sim-bswap does not take a value"); sim_bswap="";; -esac -if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then - echo "Setting bswap flags = $sim_bswap" 6>&1 -fi],[sim_bswap=""])dnl -AC_SUBST(sim_bswap) - - AC_ARG_ENABLE(sim-cflags, [AS_HELP_STRING([--enable-sim-cflags=opts], [Extra CFLAGS for use in building simulator])], diff --git a/sim/common/configure b/sim/common/configure index 3ab1c63..6f2e492 100755 --- a/sim/common/configure +++ b/sim/common/configure @@ -610,7 +610,6 @@ sim_trace sim_stdio sim_debug sim_cflags -sim_bswap MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE @@ -753,7 +752,6 @@ enable_fast_install with_gnu_ld enable_libtool_lock enable_maintainer_mode -enable_sim_bswap enable_sim_cflags enable_sim_debug enable_sim_stdio @@ -1397,7 +1395,6 @@ Optional Features: --disable-libtool-lock avoid locking (might break parallel builds) --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer - --enable-sim-bswap Use Host specific BSWAP instruction --enable-sim-cflags=opts Extra CFLAGS for use in building simulator --enable-sim-debug=opts Enable debugging flags (for developers of the sim @@ -10785,7 +10782,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10788 "configure" +#line 10785 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10891,7 +10888,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10894 "configure" +#line 10891 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11159,22 +11156,6 @@ fi -# Check whether --enable-sim-bswap was given. -if test "${enable_sim_bswap+set}" = set; then : - enableval=$enable_sim_bswap; case "${enableval}" in - yes) sim_bswap="-DWITH_BSWAP=1 -DUSE_BSWAP=1";; - no) sim_bswap="-DWITH_BSWAP=0";; - *) as_fn_error "\"--enable-sim-bswap does not take a value\"" "$LINENO" 5; sim_bswap="";; -esac -if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then - echo "Setting bswap flags = $sim_bswap" 6>&1 -fi -else - sim_bswap="" -fi - - - # Check whether --enable-sim-cflags was given. if test "${enable_sim_cflags+set}" = set; then : enableval=$enable_sim_cflags; case "${enableval}" in diff --git a/sim/common/sim-config.h b/sim/common/sim-config.h index 4dfc723..4bfcdc9 100644 --- a/sim/common/sim-config.h +++ b/sim/common/sim-config.h @@ -40,13 +40,7 @@ # define HOST_BYTE_ORDER BFD_ENDIAN_LITTLE #endif -#if (defined (__i486__) || defined (__i586__) || defined (__i686__)) && defined(__GNUC__) && WITH_BSWAP -#undef htonl -#undef ntohl -#define htonl(IN) __extension__ ({ int _out; __asm__ ("bswap %0" : "=r" (_out) : "0" (IN)); _out; }) -#define ntohl(IN) __extension__ ({ int _out; __asm__ ("bswap %0" : "=r" (_out) : "0" (IN)); _out; }) -#endif - + /* Until devices and tree properties are sorted out, tell sim-config.c not to call the tree_find_foo fns. */ #define WITH_TREE_PROPERTIES 0 @@ -86,16 +80,6 @@ extern enum bfd_endian current_target_byte_order; -/* Intel host BSWAP support: - - Whether to use bswap on the 486 and pentiums rather than the 386 - sequence that uses xchgb/rorl/xchgb */ -#ifndef WITH_BSWAP -#define WITH_BSWAP 0 -#endif - - - /* SMP support: Sets a limit on the number of processors that can be simulated. If -- cgit v1.1