]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - sim/m4/sim_ac_option_float.m4
sim: overhaul & unify endian settings management
[thirdparty/binutils-gdb.git] / sim / m4 / sim_ac_option_float.m4
CommitLineData
760b3e8b
MF
1dnl Copyright (C) 1997-2021 Free Software Foundation, Inc.
2dnl
3dnl This program is free software; you can redistribute it and/or modify
4dnl it under the terms of the GNU General Public License as published by
5dnl the Free Software Foundation; either version 3 of the License, or
6dnl (at your option) any later version.
7dnl
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11dnl GNU General Public License for more details.
12dnl
13dnl You should have received a copy of the GNU General Public License
14dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
15dnl
16dnl --enable-sim-float is for developers of the simulator
17dnl It specifies the presence of hardware floating point
18dnl And optionally the bitsize of the floating point register.
19dnl arg[1] specifies the presence (or absence) of floating point hardware
20dnl arg[2] specifies the number of bits in a floating point register
21AC_DEFUN([SIM_AC_OPTION_FLOAT],
22[
23default_sim_float="[$1]"
24default_sim_float_bitsize="[$2]"
25AC_ARG_ENABLE(sim-float,
26[AS_HELP_STRING([--enable-sim-float],
27 [Specify that the target processor has floating point hardware])],
28[case "${enableval}" in
29 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
30 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
31 32) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT -DWITH_TARGET_FLOATING_POINT_BITSIZE=32";;
32 64) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT -DWITH_TARGET_FLOATING_POINT_BITSIZE=64";;
33 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
34esac
35if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
36 echo "Setting float flags = $sim_float" 6>&1
37fi],[
38sim_float=
39if test x"${default_sim_float}" != x""; then
40 sim_float="-DWITH_FLOATING_POINT=${default_sim_float}"
41fi
42if test x"${default_sim_float_bitsize}" != x""; then
43 sim_float="$sim_float -DWITH_TARGET_FLOATING_POINT_BITSIZE=${default_sim_float_bitsize}"
44fi
45])dnl
46])
47AC_SUBST(sim_float)