diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-01-25 06:59:29 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-01-25 06:59:29 -0800 |
commit | 4b789435f8e4bb6ec9ea4bab3d0a109682adafa6 (patch) | |
tree | 65f91721ae512480ea4df6b9f7f493b35eab6660 /configure | |
parent | 4c71a77f2c39a8158c80b40af1a5cc2358251a00 (diff) | |
download | txr-4b789435f8e4bb6ec9ea4bab3d0a109682adafa6.tar.gz txr-4b789435f8e4bb6ec9ea4bab3d0a109682adafa6.tar.bz2 txr-4b789435f8e4bb6ec9ea4bab3d0a109682adafa6.zip |
Extend infrastructure for double_intptr_t.
We support an unsigned version of the type, and add functions
for converting between Lisp values and both types.
* arith.c (bignum_dbl_uipt): New function, unsigned companion
to existing bignum_dbl_ipt.
(c_dbl_num, c_dbl_unum): New functions.
* arith.h (bignum_dbl_uipt, c_dbl_num, c_dbl_unum): Declared.
* configure (superulong_t, SIZEOF_DOUBLE_INTPTR,
DOUBLE_INTPTR_MAX, DOUBLE_INTPTR_MIN, DOUBLE_UINTPTR_MAX,
double_uintptr_t): New definitions going into config.h.
* lib.h (dbl_cnum, dbl_ucnum): New typedefs: double-sized
analogs of cnum and ucnum.
* mpi/mpi.c (mp_set_double_uintptr, mp_get_double_uintptr,
mp_get_double_intptr): New functions.
(s_mp_in_big_range): New static function.
(mp_in_double_intptr_range, mp_in_double_uintptr_range): New
functions.
* mpi/mpi.h (mp_set_double_uintptr,
mp_get_double_intptr, mp_get_double_uintptr,
mp_in_double_intptr_range, mp_in_double_uintptr_range):
Declared.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1102,6 +1102,7 @@ if [ -n "$superlong" ] ; then printf '"%s"\n' "$superlong" printf "#define HAVE_SUPERLONG_T 1\n" >> config.h printf "typedef $superlong superlong_t;\n" >> config.h + printf "typedef $(echo $superlong | sed -e s/int/uint/) superulong_t;\n" >> config.h else printf "none\n" fi @@ -1245,15 +1246,22 @@ intptr_max_expr="((((convert(int_ptr_t, 1) << $((SIZEOF_PTR * SIZEOF_BYTE - 2))) printf "#define INT_PTR_MAX %s\n" "$intptr_max_expr" >> config.h printf "#define INT_PTR_MIN (-INT_PTR_MAX)\n" >> config.h printf "#define UINT_PTR_MAX (convert(uint_ptr_t, -1))\n" >> config.h +double_intptr_max_expr="((((convert(double_intptr_t, 1) << $((2 * SIZEOF_PTR * SIZEOF_BYTE - 2))) - 1) << 1) + 1)" +printf "#define SIZEOF_DOUBLE_INTPTR (2*SIZEOF_PTR)\n" >> config.h +printf "#define DOUBLE_INTPTR_MAX %s\n" "$double_intptr_max_expr" >> config.h +printf "#define DOUBLE_INTPTR_MIN (-DOUBLE_INTPTR_MAX)\n" >> config.h +printf "#define DOUBLE_UINTPTR_MAX (convert(double_uintptr_t, -1))\n" >> config.h if [ -n "$longlong" ] && [ $SIZEOF_LONGLONG_T -eq $(( 2 * SIZEOF_PTR )) ] then printf "#define HAVE_DOUBLE_INTPTR_T 1\n" >> config.h printf "typedef longlong_t double_intptr_t;\n" >> config.h + printf "typedef ulonglong_t double_uintptr_t;\n" >> config.h elif [ -n "$superlong" ] && [ $SIZEOF_SUPERLONG_T -eq $(( 2 * SIZEOF_PTR )) ] then printf "#define HAVE_DOUBLE_INTPTR_T 1\n" >> config.h printf "typedef superlong_t double_intptr_t;\n" >> config.h + printf "typedef superulong_t double_uintptr_t;\n" >> config.h fi #if HAVE_LONGLONG_T && |