ivtype=''
nv_overflows_integers_at=''
nv_preserves_uv_bits=''
+nvmantbits=''
nvsize=''
nvtype=''
u16size=''
fi
$rm_try
+$echo "Checking how many mantissa bits your NVs have..." >&4
+if test "X$usequadmath" = "X$define"; then
+ nvmantbits=112 # 128-1-15
+else
+ if test "X$nvsize" = "X$doublesize"; then
+ nvmantbits="$doublemantbits"
+ else
+ if test "X$nvsize" = "X$longdblsize"; then
+ nvmantbits="$longdblmantbits"
+ else
+ nvmantbits="$undef"
+ fi
+ fi
+fi
+
: see if sigprocmask exists
set sigprocmask d_sigprocmask
eval $inlibc
nveformat='$nveformat'
nvfformat='$nvfformat'
nvgformat='$nvgformat'
+nvmantbits='$nvmantbits'
nvsize='$nvsize'
nvtype='$nvtype'
o_nonblock='$o_nonblock'
*/
#define LONGDBLMANTBITS $longdblmantbits
+/* NVMANTBITS:
+ * This symbol, if defined, tells how many mantissa bits
+ * (not including implicit bit) there are in a Perl NV.
+ * This depends on which floating point type was chosen.
+ */
+#define NVMANTBITS $nvmantbits /**/
+
/* NEED_VA_COPY:
* This symbol, if defined, indicates that the system stores
* the variable argument list datatype, va_list, in a format
$ IF uselongdouble .OR. uselongdouble .EQS. "define"
$ THEN
$ nvtype="long double"
+$ nvmantbits = longdblmantbits
+$ ELSE
+$ nvmantbits = doublemantbits
$ ENDIF
$!
$ tmp = "''ivtype'"
$ WC "longdblkind='" + longdblkind + "'"
$ WC "longdblinfbytes='" + longdblinfbytes + "'"
$ WC "longdblnanbytes='" + longdblnanbytes + "'"
+$ WC "longdblmantbits='" + longdblmantbits + "'"
$ WC "longlongsize='" + longlongsize + "'"
$ WC "longsize='" + longsize + "'"
$ IF uselargefiles .OR. uselargefiles .EQS. "define"
$ WC "nvFUformat='" + nvFUformat + "'"
$ WC "nvgformat='" + nvgformat + "'"
$ WC "nvGUformat='" + nvGUformat + "'"
+$ WC "nvmantbits='" + nvmantbits + "'"
$ WC "nvsize='" + nvsize + "'"
$ WC "nvtype='" + nvtype + "'"
$ WC "o_nonblock=' '"
# endif
#endif
-/* NV_MANT_BITS is the number of _real_ mantissa bits in an NV.
- * For the standard IEEE 754 fp this number is usually one less that
- * *DBL_MANT_DIG because of the implicit (aka hidden) bit, which isn't
- * real. For the 80-bit extended precision formats (x86*), the number
- * of mantissa bits... depends. For normal floats, it's 64. But for
- * the inf/nan, it's different (zero for inf, 61 for nan).
- * NV_MANT_BITS works for normal floats. */
-#ifdef USE_QUADMATH /* IEEE 754 128-bit */
-# define NV_MANT_BITS (FLT128_MANT_DIG - 1)
-#elif NVSIZE == DOUBLESIZE
-# define NV_MANT_BITS DOUBLEMANTBITS
-#elif NVSIZE == LONG_DOUBLESIZE
-# define NV_MANT_BITS LONGDBLMANTBITS
-#endif
-
/* NaNs (not-a-numbers) can carry payload bits, in addition to
* "nan-ness". Part of the payload is the quiet/signaling bit.
* To back up a bit (harhar):
* This means that in this format there are 61 bits available
* for the nan payload.
*
- * NV_NAN_PAYLOAD_BITS tells how many bits there are available for
- * the nan payload, *not* including the quiet/signaling bit. */
-#if defined(USE_LONG_DOUBLE) && NVSIZE > DOUBLESIZE && \
- (LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN || \
- LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN)
-# define NV_NAN_PAYLOAD_BITS 61
-#else
-# define NV_NAN_PAYLOAD_BITS (NV_MANT_BITS - 1)
-#endif
+ * NVMANTBITS is the number of _real_ mantissa bits in an NV.
+ * For the standard IEEE 754 fp this number is usually one less that
+ * *DBL_MANT_DIG because of the implicit (aka hidden) bit, which isn't
+ * real. For the 80-bit extended precision formats (x86*), the number
+ * of mantissa bits... depends. For normal floats, it's 64. But for
+ * the inf/nan, it's different (zero for inf, 61 for nan).
+ * NVMANTBITS works for normal floats. */
+
+/* We do not want to include the quiet/signaling bit. */
+#define NV_NAN_BITS (NVMANTBITS - 1)
#if defined(USE_LONG_DOUBLE) && NVSIZE > DOUBLESIZE
# if LONG_DOUBLEKIND == LONG_DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN
#elif defined(USE_LONG_DOUBLE) && \
(LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LITTLE_ENDIAN || \
LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BIG_ENDIAN)
-# define NV_NAN_QS_BIT_SHIFT 3 /* 0x08, but not via NV_NAN_PAYLOAD_BITS */
+# define NV_NAN_QS_BIT_SHIFT 3 /* 0x08, but not via NV_NAN_BITS */
#else
-# define NV_NAN_QS_BIT_SHIFT \
- ((NV_NAN_PAYLOAD_BITS) % 8) /* usually 3, or 0x08 */
+# define NV_NAN_QS_BIT_SHIFT ((NV_NAN_BITS) % 8) /* usually 3, or 0x08 */
#endif
#define NV_NAN_QS_BIT (1 << (NV_NAN_QS_BIT_SHIFT))
/* NV_NAN_QS_BIT_OFFSET is the bit offset from the beginning of a NV