From b98e4e9827077e5e74184127324d0b73e0c0a373 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 12 Sep 2022 22:28:52 -0700 Subject: 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. --- configure | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'configure') 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 < -- cgit v1.2.3