summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-09-12 22:28:52 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-09-12 22:28:52 -0700
commitb98e4e9827077e5e74184127324d0b73e0c0a373 (patch)
tree5d39575b38093259c1f43dff569086effbbba97c /configure
parent90f65b562215710c26dbc1138bb05f841ea64d71 (diff)
downloadtxr-b98e4e9827077e5e74184127324d0b73e0c0a373.tar.gz
txr-b98e4e9827077e5e74184127324d0b73e0c0a373.tar.bz2
txr-b98e4e9827077e5e74184127324d0b73e0c0a373.zip
configure: config groundwork for NaN boxing
* configure (nan_boxing, nan_boxing_given): New variables. New help text for nan-boxing option. New test which sets nan-boxing if pointers are 64 bits, and also checks for nan-boxing wrongly being forced on a 32 bit target. Generate CONFIG_NAN_BOXING symbol in config.h.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure28
1 files changed, 28 insertions, 0 deletions
diff --git a/configure b/configure
index eed091aa..671fcfe4 100755
--- a/configure
+++ b/configure
@@ -218,6 +218,8 @@ libffi_cflags=
darwin_target=
solaris_target=
build_id=
+nan_boxing=
+nan_boxing_given=
#
# Parse configuration variables
@@ -591,6 +593,14 @@ build-id [$build_id]
The build_id variable can be overridden from the make command line.
+nan-boxing [$nan_boxing]
+
+ This option specifies whether NaN-boxing representation is used
+ for Lisp values. This is good for floating-point work because
+ floating-point values do not require heap allocation.
+ It is enabled automatically on targets with 64 bit pointers,
+ and is not supported on targets with 32 bit pointers.
+ Disable it to select the regular tagged pointer representation.
!
exit 1
fi
@@ -1573,6 +1583,24 @@ then
printf "typedef superulong_t double_uintptr_t;\n" >> config.h
fi
+if ! [ $nan_boxing_given ] ; then
+ printf "Checking whether to use NaN boxing ... "
+
+ if [ $SIZEOF_PTR -eq 8 ] ; then
+ nan_boxing=y
+ printf "yes\n"
+ else
+ printf "no\n"
+ fi
+fi
+
+if [ -n "$nan_boxing" ] ; then
+ if [ $SIZEOF_PTR -ne 8 ] ; then
+ printf "Warning: NaN boxing disabled: it requires 32 bit pointers\n"
+ fi
+ printf "#define CONFIG_NAN_BOXING 1\n" >> config.h
+fi
+
printf "Checking for intmax_t ... "
cat > conftest.c <<!
#include <inttypes.h>