diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2015-06-10 22:05:48 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2015-06-12 09:57:16 -0400 |
commit | ed3917fd69b234bb5614cb9aed93d62238e3dcb8 (patch) | |
tree | b0af6a15d9b39773de1a885aa623d3dcc7d8766e | |
parent | 44521f3a1782026b7d25cc55af459c3e28cc9bdd (diff) | |
download | perl-ed3917fd69b234bb5614cb9aed93d62238e3dcb8.tar.gz |
infnan: Configure scan for fp mantissa bytes
-rwxr-xr-x | Configure | 75 | ||||
-rw-r--r-- | Cross/config.sh-arm-linux | 2 | ||||
-rw-r--r-- | NetWare/config.wc | 4 | ||||
-rw-r--r-- | NetWare/config_H.wc | 19 | ||||
-rw-r--r-- | Porting/Glossary | 15 | ||||
-rw-r--r-- | Porting/config.sh | 2 | ||||
-rwxr-xr-x | config_h.SH | 19 | ||||
-rw-r--r-- | configure.com | 4 | ||||
-rw-r--r-- | plan9/config_sh.sample | 2 | ||||
-rw-r--r-- | symbian/config.sh | 2 | ||||
-rw-r--r-- | uconfig.sh | 2 | ||||
-rw-r--r-- | uconfig64.sh | 2 | ||||
-rw-r--r-- | win32/config.ce | 2 | ||||
-rw-r--r-- | win32/config.gc | 2 | ||||
-rw-r--r-- | win32/config.vc | 2 | ||||
-rw-r--r-- | win32/config_H.ce | 19 | ||||
-rw-r--r-- | win32/config_H.gc | 19 | ||||
-rw-r--r-- | win32/config_H.vc | 19 |
18 files changed, 210 insertions, 1 deletions
@@ -633,6 +633,7 @@ d_ldexpl='' d_longdbl='' longdblinfbytes='' longdblkind='' +longdblmantbits='' longdblnanbytes='' longdblsize='' d_longlong='' @@ -1099,6 +1100,7 @@ d_PRIgldbl='' d_SCNfldbl='' doublekind='' doubleinfbytes='' +doublemantbits='' doublenanbytes='' sPRIEUldbl='' sPRIFUldbl='' @@ -18759,6 +18761,79 @@ set d_signbit eval $setvar $rm_try +$echo "Checking how many mantissa bits your doubles have..." >&4 +$cat >try.c <<EOP +#$i_float I_FLOAT +#$i_sunmath I_SUNMATH +#ifdef I_FLOAT +# include <float.h> +#endif +#ifdef I_SUNMATH +# include <sunmath.h> +#endif +#ifdef DBL_MANT_DIG +# define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */ +#endif +#include <stdio.h> +int main(int argc, char *argv[]) { +#ifdef BITS + printf("%d\n", BITS); +#endif + return 0; +} +EOP +set try +if eval $compile; then + doublemantbits=`$run ./try` +else + doublemantbits="$undef" +fi +$rm_try + +$echo "Checking how many mantissa bits your long doubles have..." >&4 +$cat >try.c <<EOP +#$i_float I_FLOAT +#$i_sunmath I_SUNMATH +#ifdef I_FLOAT +# include <float.h> +#endif +#ifdef I_SUNMATH +# include <sunmath.h> +#endif +#$d_longdbl HAS_LONG_DOUBLE +#if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG) +# if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */ +/* This format has no implicit bit. Beware, however, that for + * this format the bare LDBL_MANT_DIG is misleading for inf/nan: + * the top three bits are used for inf (100) / qnan (11x) / snan (101), + * and the top bit must have been one since 387, zero is plain invalid. + * For normal fp values, the LDBL_MANT_DIG is fine, though. */ +# define BITS LDBL_MANT_DIG +# elif ($longdblkind == 5 || $longdblkind == 6) /* double double */ +/* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some + * reason e.g. Irix thinks 107. But in any case, we want only + * the number of real bits, the implicit bits are of no interest. */ +# define BITS 2 * (DBL_MANT_DIG - 1) +# else +# define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */ +# endif +#endif +#include <stdio.h> +int main(int argc, char *argv[]) { +#ifdef BITS + printf("%d\n", BITS); +#endif + return 0; +} +EOP +set try +if eval $compile; then + longdblmantbits=`$run ./try` +else + longdblmantbits="$undef" +fi +$rm_try + : see if sigprocmask exists set sigprocmask d_sigprocmask eval $inlibc diff --git a/Cross/config.sh-arm-linux b/Cross/config.sh-arm-linux index 8762282661..544efd1f94 100644 --- a/Cross/config.sh-arm-linux +++ b/Cross/config.sh-arm-linux @@ -614,6 +614,7 @@ dlext='so' dlsrc='dl_dlopen.xs' doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f' doublekind='3' +doublemantbits='52' doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f' doublesize='8' drand01='Perl_drand48()' @@ -857,6 +858,7 @@ locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/inclu loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib' longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' longdblkind='0' +longdblmantbits='64' longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' longdblsize='8' longlongsize='8' diff --git a/NetWare/config.wc b/NetWare/config.wc index 08abe4c589..0e7a6826dd 100644 --- a/NetWare/config.wc +++ b/NetWare/config.wc @@ -605,6 +605,7 @@ dlext='nlm' dlsrc='dl_netware.xs' doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f' doublekind='3' +doublemantbits='52' doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f' doublesize='8' drand01='Perl_drand48()' @@ -831,7 +832,8 @@ locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/inclu loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib' longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f' longdblkind='3' -longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f' +longdblmantbits='64' +longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' longdblsize='10' longlongsize='8' longsize='4' diff --git a/NetWare/config_H.wc b/NetWare/config_H.wc index e24560f883..4ebd1a0019 100644 --- a/NetWare/config_H.wc +++ b/NetWare/config_H.wc @@ -2354,6 +2354,25 @@ #define LONGDBLINFBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f /**/ #define LONGDBLNANBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f /**/ +/* DOUBLEMANTBITS: + * This symbol, if defined, tells how many mantissa bits + * there are in double precision floating point format. + * Note that this is usually DBL_MANT_DIG minus one, since + * with the standard IEEE 754 formats DBL_MANT_DIG includes + * the implicit bit, which doesn't really exist. + */ +#define DOUBLEMANTBITS 52 + +/* LONGDBLMANTBITS: + * This symbol, if defined, tells how many mantissa bits + * there are in long double precision floating point format. + * Note that this can be LDBL_MANT_DIG minus one, + * since LDBL_MANT_DIG can include the IEEE 754 implicit bit. + * The common x86-style 80-bit long double does not have + * an implicit bit. + */ +#define LONGDBLMANTBITS 52 + /* EBCDIC: * This symbol, if defined, indicates that this system uses * EBCDIC encoding. diff --git a/Porting/Glossary b/Porting/Glossary index d59290f3dd..ab63d53a0a 100644 --- a/Porting/Glossary +++ b/Porting/Glossary @@ -2856,6 +2856,13 @@ doublekind (longdblfio.U): 8 = IEEE 754 64-bit big mixed endian be-le, -1 = unknown format. +doublemantbits (mantbits.U): + This symbol, if defined, tells how many mantissa bits + there are in double precision floating point format. + Note that this is usually DBL_MANT_DIG minus one, since + with the standard IEEE 754 formats DBL_MANT_DIG includes + the implicit bit which doesn't really exist. + doublenanbytes (infnan.U): This variable contains comma-separated list of hexadecimal bytes for the double precision not-a-number. @@ -4095,6 +4102,14 @@ longdblkind (d_longdbl.U): 4 = x86 80-bit big endian, 5 = double-double 128-bit little endian, 6 = double-double 128-bit big endian, -1 = unknown format. +longdblmantbits (longdblmant.U): + This symbol, if defined, tells how many mantissa bits + there are in long double precision floating point format. + Note that this can be LDBL_MANT_DIG minus one, + since LDBL_MANT_DIG can include the IEEE 754 implicit bit. + The common x86-style 80-bit long double does not have + an implicit bit. + longdblnanbytes (infnan.U): This variable contains comma-separated list of hexadecimal bytes for the long double precision not-a-number. diff --git a/Porting/config.sh b/Porting/config.sh index 2af760e173..88b0b815e3 100644 --- a/Porting/config.sh +++ b/Porting/config.sh @@ -625,6 +625,7 @@ dlext='so' dlsrc='dl_dlopen.xs' doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f' doublekind='3' +doublemantbits='52' doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f' doublesize='8' drand01='Perl_drand48()' @@ -875,6 +876,7 @@ locincpth='/pro/local/include' loclibpth='/pro/local/lib' longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' longdblkind='3' +longdblmantbits='64' longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' longdblsize='12' longlongsize='8' diff --git a/config_h.SH b/config_h.SH index 11603a7c9f..6ae8fe2394 100755 --- a/config_h.SH +++ b/config_h.SH @@ -4858,6 +4858,25 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un #define LONGDBLINFBYTES $longdblinfbytes /**/ #define LONGDBLNANBYTES $longdblnanbytes /**/ +/* DOUBLEMANTBITS: + * This symbol, if defined, tells how many mantissa bits + * there are in double precision floating point format. + * Note that this is usually DBL_MANT_DIG minus one, since + * with the standard IEEE 754 formats DBL_MANT_DIG includes + * the implicit bit, which doesn't really exist. + */ +#define DOUBLEMANTBITS $doublemantbits + +/* LONGDBLMANTBITS: + * This symbol, if defined, tells how many mantissa bits + * there are in long double precision floating point format. + * Note that this can be LDBL_MANT_DIG minus one, + * since LDBL_MANT_DIG can include the IEEE 754 implicit bit. + * The common x86-style 80-bit long double does not have + * an implicit bit. + */ +#define LONGDBLMANTBITS $longdblmantbits + /* NEED_VA_COPY: * This symbol, if defined, indicates that the system stores * the variable argument list datatype, va_list, in a format diff --git a/configure.com b/configure.com index 9600757523..6e05e90ddb 100644 --- a/configure.com +++ b/configure.com @@ -3663,6 +3663,7 @@ $ longdblsize="0" $ longdblkind="0" $ longdblinfbytes="undef" $ longdblnanbytes="undef" +$ longdblmantbits="undef" $ d_longdbl="undef" $ echo "You do not have long double." $ ELSE @@ -3673,6 +3674,7 @@ $ longdblsize = tmp $ longdblkind = "1" $ longdblinfbytes="0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f" $ longdblnanbytes="0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff" +$ longdblmantbits="112" $ d_longdbl = "define" $ echo "Your long doubles are ''longdblsize' bytes long." $ ENDIF @@ -5573,6 +5575,7 @@ $ i64size="undef" $ u64size="undef" $ ENDIF $! +$ doublemantbits = "52" $ IF uselongdouble .OR. uselongdouble .EQS. "define" $ THEN $ nvtype="long double" @@ -6478,6 +6481,7 @@ $ WC "dlsrc='dl_vms.xs'" $ WC "doublekind='3'" $ WC "doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'" $ WC "doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'" +$ WC "doublemantbits='" + doublemantbits + "'" $ WC "doublesize='" + doublesize + "'" $ WC "drand01='" + drand01 + "'" $ WC "dtrace='" + "'" diff --git a/plan9/config_sh.sample b/plan9/config_sh.sample index 7171878e30..7dce0deb06 100644 --- a/plan9/config_sh.sample +++ b/plan9/config_sh.sample @@ -613,6 +613,7 @@ dlext='none' dlsrc='dl_none.xs' doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f' doublekind='3' +doublemantbits='52' doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f' doublesize='8' drand01='(rand() / (double) ((unsigned long)1 << 15))' @@ -839,6 +840,7 @@ locincpth='' loclibpth='' longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' longdblkind='0' +longdblmantbits='64' longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' longdblsize='8' longlongsize='8' diff --git a/symbian/config.sh b/symbian/config.sh index 86cc080ffa..27f2e588af 100644 --- a/symbian/config.sh +++ b/symbian/config.sh @@ -560,6 +560,7 @@ dlext='dll' dlsrc='dl_symbian.xs' doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f' doublekind='4' +doublemantbits='52' doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f' doublesize='8' drand01="((rand() & 0x7FFF) / (double) ((unsigned long)1 << 15))" @@ -734,6 +735,7 @@ libperl='libperl.a' localtime_r_proto='0' longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' longdblkind=0 +longdblmantbits='64' longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' longdblsize=8 longlongsize=8 diff --git a/uconfig.sh b/uconfig.sh index 77b638c8ee..0278020ddf 100644 --- a/uconfig.sh +++ b/uconfig.sh @@ -549,6 +549,7 @@ db_version_patch='0' direntrytype='struct dirent' doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f' doublekind='3' +doublemantbits='52' doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f' doublesize='8' drand01="Perl_drand48()" @@ -710,6 +711,7 @@ lib_ext='.a' localtime_r_proto='0' longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' longdblkind=0 +longdblmantbits='64' longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' longdblsize=8 longlongsize=8 diff --git a/uconfig64.sh b/uconfig64.sh index 99d371dbda..2fefaff234 100644 --- a/uconfig64.sh +++ b/uconfig64.sh @@ -550,6 +550,7 @@ db_version_patch='0' direntrytype='struct dirent' doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f' doublekind='3' +doublemantbits='52' doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f' doublesize='8' drand01="((rand() & 0x7FFF) / (double) ((unsigned long)1 << 15))" @@ -710,6 +711,7 @@ lib_ext='.a' localtime_r_proto='0' longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' longdblkind=0 +longdblmantbits='64' longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' longdblsize=8 longlongsize=8 diff --git a/win32/config.ce b/win32/config.ce index f6fe8e5af5..7ee16c6ef9 100644 --- a/win32/config.ce +++ b/win32/config.ce @@ -601,6 +601,7 @@ dlext='dll' dlsrc='dl_win32.xs' doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f' doublekind='3' +doublemantbits='52' doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f' doublesize='8' drand01='Perl_drand48()' @@ -823,6 +824,7 @@ locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/inclu loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib' longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f' longdblkind='3' +longdblmantbits='64' longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f' longdblsize='10' longlongsize='8' diff --git a/win32/config.gc b/win32/config.gc index 185d96b478..f34d8ec4f7 100644 --- a/win32/config.gc +++ b/win32/config.gc @@ -603,6 +603,7 @@ dlltool='~ARCHPREFIX~dlltool' dlsrc='dl_win32.xs' doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f' doublekind='3' +doublemantbits='52' doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f' doublesize='8' drand01='Perl_drand48()' @@ -850,6 +851,7 @@ locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/inclu loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib' longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00' longdblkind='3' +longdblmantbits='64' longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00' longdblsize='12' longlongsize='8' diff --git a/win32/config.vc b/win32/config.vc index 26898446c8..549c14097b 100644 --- a/win32/config.vc +++ b/win32/config.vc @@ -602,6 +602,7 @@ dlext='dll' dlsrc='dl_win32.xs' doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f' doublekind='3' +doublemantbits='52' doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f' doublesize='8' drand01='Perl_drand48()' @@ -849,6 +850,7 @@ locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/inclu loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib' longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f' longdblkind='0' +longdblmantbits='52' longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f' longdblsize='8' longlongsize='8' diff --git a/win32/config_H.ce b/win32/config_H.ce index c4de904e5d..1766a958f0 100644 --- a/win32/config_H.ce +++ b/win32/config_H.ce @@ -2737,6 +2737,25 @@ #define LONGDBLINFBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f /**/ #define LONGDBLNANBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f /**/ +/* DOUBLEMANTBITS: + * This symbol, if defined, tells how many mantissa bits + * there are in double precision floating point format. + * Note that this is usually DBL_MANT_DIG minus one, since + * with the standard IEEE 754 formats DBL_MANT_DIG includes + * the implicit bit, which doesn't really exist. + */ +#define DOUBLEMANTBITS 52 + +/* LONGDBLMANTBITS: + * This symbol, if defined, tells how many mantissa bits + * there are in long double precision floating point format. + * Note that this can be LDBL_MANT_DIG minus one, + * since LDBL_MANT_DIG can include the IEEE 754 implicit bit. + * The common x86-style 80-bit long double does not have + * an implicit bit. + */ +#define LONGDBLMANTBITS 52 + /* EBCDIC: * This symbol, if defined, indicates that this system uses * EBCDIC encoding. diff --git a/win32/config_H.gc b/win32/config_H.gc index a442cd0573..a9c61629a8 100644 --- a/win32/config_H.gc +++ b/win32/config_H.gc @@ -2692,6 +2692,25 @@ #define LONGDBLINFBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00 /**/ #define LONGDBLNANBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00 /**/ +/* DOUBLEMANTBITS: + * This symbol, if defined, tells how many mantissa bits + * there are in double precision floating point format. + * Note that this is usually DBL_MANT_DIG minus one, since + * with the standard IEEE 754 formats DBL_MANT_DIG includes + * the implicit bit, which doesn't really exist. + */ +#define DOUBLEMANTBITS 52 + +/* LONGDBLMANTBITS: + * This symbol, if defined, tells how many mantissa bits + * there are in long double precision floating point format. + * Note that this can be LDBL_MANT_DIG minus one, + * since LDBL_MANT_DIG can include the IEEE 754 implicit bit. + * The common x86-style 80-bit long double does not have + * an implicit bit. + */ +#define LONGDBLMANTBITS 64 + /* EBCDIC: * This symbol, if defined, indicates that this system uses * EBCDIC encoding. diff --git a/win32/config_H.vc b/win32/config_H.vc index 77e38f8a74..e945b3f42d 100644 --- a/win32/config_H.vc +++ b/win32/config_H.vc @@ -2684,6 +2684,25 @@ #define LONGDBLINFBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f /**/ #define LONGDBLNANBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f /**/ +/* DOUBLEMANTBITS: + * This symbol, if defined, tells how many mantissa bits + * there are in double precision floating point format. + * Note that this is usually DBL_MANT_DIG minus one, since + * with the standard IEEE 754 formats DBL_MANT_DIG includes + * the implicit bit, which doesn't really exist. + */ +#define DOUBLEMANTBITS 52 + +/* LONGDBLMANTBITS: + * This symbol, if defined, tells how many mantissa bits + * there are in long double precision floating point format. + * Note that this can be LDBL_MANT_DIG minus one, + * since LDBL_MANT_DIG can include the IEEE 754 implicit bit. + * The common x86-style 80-bit long double does not have + * an implicit bit. + */ +#define LONGDBLMANTBITS 52 + /* EBCDIC: * This symbol, if defined, indicates that this system uses * EBCDIC encoding. |