diff options
author | Mike Frysinger <vapier@gentoo.org> | 2022-11-11 15:57:55 +0700 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2022-12-21 22:27:12 -0500 |
commit | 19b11256a55c86a6871e1a10308ad7b68119a9c4 (patch) | |
tree | 8773c88b1da6f6d00af907c92be735f1d45d6aa5 /sim/mips | |
parent | 2d5700ad4e6e43d76548be5e8148c05f6948aea2 (diff) | |
download | gdb-19b11256a55c86a6871e1a10308ad7b68119a9c4.zip gdb-19b11256a55c86a6871e1a10308ad7b68119a9c4.tar.gz gdb-19b11256a55c86a6871e1a10308ad7b68119a9c4.tar.bz2 |
sim: mips: move bitsize defines to top-level configure
Since the msb value is always defined as the wordsize-1, stop
hardcoding that value directly, and use a CPP value instead.
Diffstat (limited to 'sim/mips')
-rw-r--r-- | sim/mips/Makefile.in | 2 | ||||
-rw-r--r-- | sim/mips/acinclude-top.m4 | 14 | ||||
-rw-r--r-- | sim/mips/aclocal.m4 | 1 | ||||
-rwxr-xr-x | sim/mips/configure | 81 | ||||
-rw-r--r-- | sim/mips/configure.ac | 17 |
5 files changed, 18 insertions, 97 deletions
diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in index d8d50ea..328c191 100644 --- a/sim/mips/Makefile.in +++ b/sim/mips/Makefile.in @@ -69,6 +69,8 @@ SIM_OBJS = \ # List of flags to always pass to $(CC). SIM_EXTRA_CFLAGS = $(SIM_MIPS_SUBTARGET) +SIM_BITSIZE = $(SIM_MIPS_BITSIZE) + SIM_EXTRA_CLEAN = clean-extra SIM_EXTRA_DISTCLEAN = distclean-extra diff --git a/sim/mips/acinclude-top.m4 b/sim/mips/acinclude-top.m4 index 4eb6c19..2d53bee 100644 --- a/sim/mips/acinclude-top.m4 +++ b/sim/mips/acinclude-top.m4 @@ -32,3 +32,17 @@ AS_CASE([${target}], [mipsisa64*-*-*], [SIM_MIPS_SUBTARGET="-DTARGET_ENABLE_FR=1"]) AC_MSG_RESULT([${SIM_MIPS_SUBTARGET:-none}]) AC_SUBST(SIM_MIPS_SUBTARGET) + +dnl Select the bitsize of the target. +AC_MSG_CHECKING([mips bitsize]) +SIM_MIPS_BITSIZE=64 +AS_CASE([${target}], + [mips*-sde-elf*], [SIM_MIPS_BITSIZE=64], + [mips*-mti-elf*], [SIM_MIPS_BITSIZE=64], + [mips64*-*-*], [SIM_MIPS_BITSIZE=64], + [mips16*-*-*], [SIM_MIPS_BITSIZE=64], + [mipsisa32*-*-*], [SIM_MIPS_BITSIZE=32], + [mipsisa64*-*-*], [SIM_MIPS_BITSIZE=64], + [mips*-*-*], [SIM_MIPS_BITSIZE=32]) +AC_MSG_RESULT([$SIM_MIPS_BITSIZE]) +AC_SUBST(SIM_MIPS_BITSIZE) diff --git a/sim/mips/aclocal.m4 b/sim/mips/aclocal.m4 index 247e9db..6d4e93e 100644 --- a/sim/mips/aclocal.m4 +++ b/sim/mips/aclocal.m4 @@ -12,6 +12,5 @@ # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -m4_include([../m4/sim_ac_option_bitsize.m4]) m4_include([../m4/sim_ac_option_float.m4]) m4_include([../m4/sim_ac_output.m4]) diff --git a/sim/mips/configure b/sim/mips/configure index 70939f9..7d80b50 100755 --- a/sim/mips/configure +++ b/sim/mips/configure @@ -586,6 +586,7 @@ ac_subst_vars='LTLIBOBJS LIBOBJS SIM_COMMON_BUILD_FALSE SIM_COMMON_BUILD_TRUE +sim_bitsize sim_multi_obj sim_multi_src sim_multi_igen_configs @@ -645,12 +646,10 @@ PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL -sim_float -sim_bitsize' +sim_float' ac_subst_files='' ac_user_opts=' enable_option_checking -enable_sim_bitsize enable_sim_float ' ac_precious_vars='build_alias @@ -1268,7 +1267,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-bitsize=N Specify target bitsize (32 or 64) --enable-sim-float Specify that the target processor has floating point hardware @@ -1844,81 +1842,6 @@ test -n "$target_alias" && # -# Select the bitsize of the target -# -case "${target}" in - mips*-sde-elf*) mips_bitsize=64 ; mips_msb=63 ;; - mips*-mti-elf*) mips_bitsize=64 ; mips_msb=63 ;; - mips64*-*-*) mips_bitsize=64 ; mips_msb=63 ;; - mips16*-*-*) mips_bitsize=64 ; mips_msb=63 ;; - mipsisa32*-*-*) mips_bitsize=32 ; mips_msb=31 ;; - mipsisa64*-*-*) mips_bitsize=64 ; mips_msb=63 ;; - mips*-*-*) mips_bitsize=32 ; mips_msb=31 ;; - *) mips_bitsize=64 ; mips_msb=63 ;; -esac -wire_word_bitsize="$mips_bitsize" -wire_word_msb="$mips_msb" -wire_address_bitsize="" -wire_cell_bitsize="" -# Check whether --enable-sim-bitsize was given. -if test "${enable_sim_bitsize+set}" = set; then : - enableval=$enable_sim_bitsize; sim_bitsize= -case "${enableval}" in - 64,63 | 64,63,* ) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=64 -DWITH_TARGET_WORD_MSB=63";; - 32,31 | 32,31,* ) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31";; - 64,0 | 64,0,* ) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=0";; - 32,0 | 64,0,* ) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=0";; - 32) if test x"$wire_word_msb" != x -a x"$wire_word_msb" != x0; then - sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31" - else - sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=0" - fi ;; - 64) if test x"$wire_word_msb" != x -a x"$wire_word_msb" != x0; then - sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=64 -DWITH_TARGET_WORD_MSB=63" - else - sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=64 -DWITH_TARGET_WORD_MSB=0" - fi ;; - *) as_fn_error $? "\"--enable-sim-bitsize was given $enableval. Expected 32 or 64\"" "$LINENO" 5 ;; -esac -# address bitsize -tmp=`echo "${enableval}" | sed -e "s/^[0-9]*,*[0-9]*,*//"` -case x"${tmp}" in - x ) ;; - x32 | x32,* ) sim_bitsize="${sim_bitsize} -DWITH_TARGET_ADDRESS_BITSIZE=32" ;; - x64 | x64,* ) sim_bitsize="${sim_bitsize} -DWITH_TARGET_ADDRESS_BITSIZE=64" ;; - * ) as_fn_error $? "\"--enable-sim-bitsize was given address size $enableval. Expected 32 or 64\"" "$LINENO" 5 ;; -esac -# cell bitsize -tmp=`echo "${enableval}" | sed -e "s/^[0-9]*,*[0-9*]*,*[0-9]*,*//"` -case x"${tmp}" in - x ) ;; - x32 | x32,* ) sim_bitsize="${sim_bitsize} -DWITH_TARGET_CELL_BITSIZE=32" ;; - x64 | x64,* ) sim_bitsize="${sim_bitsize} -DWITH_TARGET_CELL_BITSIZE=64" ;; - * ) as_fn_error $? "\"--enable-sim-bitsize was given cell size $enableval. Expected 32 or 64\"" "$LINENO" 5 ;; -esac -if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then - echo "Setting bitsize flags = $sim_bitsize" 6>&1 -fi -else - sim_bitsize="" -if test x"$wire_word_bitsize" != x; then - sim_bitsize="$sim_bitsize -DWITH_TARGET_WORD_BITSIZE=$wire_word_bitsize" -fi -if test x"$wire_word_msb" != x; then - sim_bitsize="$sim_bitsize -DWITH_TARGET_WORD_MSB=$wire_word_msb" -fi -if test x"$wire_address_bitsize" != x; then - sim_bitsize="$sim_bitsize -DWITH_TARGET_ADDRESS_BITSIZE=$wire_address_bitsize" -fi -if test x"$wire_cell_bitsize" != x; then - sim_bitsize="$sim_bitsize -DWITH_TARGET_CELL_BITSIZE=$wire_cell_bitsize" -fi -fi - - - - -# # Select the floating hardware support of the target # mips_fpu_bitsize= diff --git a/sim/mips/configure.ac b/sim/mips/configure.ac index 308b3ae..d820b81 100644 --- a/sim/mips/configure.ac +++ b/sim/mips/configure.ac @@ -7,23 +7,6 @@ dnl and until we clean that up, we need to expand --target for use below. AC_CANONICAL_SYSTEM # -# Select the bitsize of the target -# -case "${target}" in - mips*-sde-elf*) mips_bitsize=64 ; mips_msb=63 ;; - mips*-mti-elf*) mips_bitsize=64 ; mips_msb=63 ;; - mips64*-*-*) mips_bitsize=64 ; mips_msb=63 ;; - mips16*-*-*) mips_bitsize=64 ; mips_msb=63 ;; - mipsisa32*-*-*) mips_bitsize=32 ; mips_msb=31 ;; - mipsisa64*-*-*) mips_bitsize=64 ; mips_msb=63 ;; - mips*-*-*) mips_bitsize=32 ; mips_msb=31 ;; - *) mips_bitsize=64 ; mips_msb=63 ;; -esac -SIM_AC_OPTION_BITSIZE($mips_bitsize,$mips_msb) - - - -# # Select the floating hardware support of the target # mips_fpu_bitsize= |