In metaconfig.git, the branch master has been updated

<http://perl5.git.perl.org/metaconfig.git/commitdiff/49a24870d542425d9f715f5fa1f42a8183485c8e?hp=ef5c19162ce2555ea2fa80432adb0e182ca150e2>

- Log -----------------------------------------------------------------
commit 49a24870d542425d9f715f5fa1f42a8183485c8e
Author: H.Merijn Brand - Tux <[email protected]>
Date:   Fri Nov 11 14:40:53 2016 +0100

    Configure: add defs summarizing doublekind/longdblkind
    
    Backport of 4cb05021f1602b1c29295f791d76ba4b38426f2a
    
    For windows/netware It seems that many of the recent fp definitions
    have not been yet copied over there [1] [2], so went mostly by dead
    reckoning [3].
    
    [1] Note that many of them are not absolutely necessary for building.
    [2] The proper updating involves doing stuff in win32, which I do not have.
    [3] As far as I can tell, Windows CE does not really not have long double.
-----------------------------------------------------------------------

Summary of changes:
 U/modified/d_longdbl.U | 80 ++++++++++++++++++++++++++++++++++++++++++++++++--
 U/perl/infnan.U        | 26 ++++++++++++++++
 U/perl/longdblfio.U    | 60 ++++++++++++++++++++++++++++++++++++-
 3 files changed, 163 insertions(+), 3 deletions(-)

diff --git a/U/modified/d_longdbl.U b/U/modified/d_longdbl.U
index da127d1..314b436 100644
--- a/U/modified/d_longdbl.U
+++ b/U/modified/d_longdbl.U
@@ -7,7 +7,10 @@
 ?RCS:
 ?RCS: $Log: d_longdbl.U,v $
 ?RCS:
-?MAKE:d_longdbl longdblsize d_ldexpl longdblkind: Compile Setvar Myread \
+?MAKE:d_longdbl longdblsize d_ldexpl longdblkind \
+       d_long_double_style_ieee d_long_double_style_ieee_doubledouble \
+       d_long_double_style_ieee_extended d_long_double_style_ieee_std \
+       d_long_double_style_vax: Compile Setvar Myread \
        Inlibc run echo cat rm_try test doublesize i_stdlib i_float
 ?MAKE: -pick add $@ %<
 ?S:d_longdbl:
@@ -38,6 +41,30 @@
 ?S:     9 = 128-bit PDP-style mixed-endian long doubles,
 ?S:    -1 = unknown format.
 ?S:.
+?S:d_long_double_style_ieee:
+?S:    This variable conditionally defines LONG_DOUBLE_STYLE_IEEE
+?S:    if the long double is any of the IEEE 754 style long doubles:
+?S:    LONG_DOUBLE_STYLE_IEEE_STD, LONG_DOUBLE_STYLE_IEEE_EXTENDED,
+?S:    LONG_DOUBLE_STYLE_IEEE_DOUBLEDOUBLE.
+?S:.
+?S:d_long_double_style_ieee_doubledouble:
+?S:    This variable conditionally defines LONG_DOUBLE_STYLE_IEEE_DOUBLEDOUBLE
+?S:    if the long double is the 128-bit IEEE 754 double-double.
+?S:.
+?S:d_long_double_style_ieee_extended:
+?S:    This variable conditionally defines LONG_DOUBLE_STYLE_IEEE_EXTENDED
+?S:    if the long double is the 80-bit IEEE 754 extended precision.
+?S:    Note that despite the 'extended' this is less than the 'std',
+?S:    since thisis an extension of the double precision.
+?S:.
+?S:d_long_double_style_ieee_std:
+?S:    This variable conditionally defines LONG_DOUBLE_STYLE_IEEE_STD
+?S:    if the long double is the 128-bit IEEE 754.
+?S:.
+?S:d_long_double_style_vax:
+?S:    This variable conditionally defines LONG_DOUBLE_STYLE_VAX
+?S:    if the long double is the 128-bit VAX format H.
+?S:.
 ?C:HAS_LONG_DOUBLE:
 ?C:    This symbol will be defined if the C compiler supports long
 ?C:    doubles.
@@ -68,6 +95,30 @@
 ?C:    LONG_DOUBLE_IS_UNKNOWN_FORMAT
 ?C:    It is only defined if the system supports long doubles.
 ?C:.
+?C:LONG_DOUBLE_STYLE_IEEE:
+?C:    This symbol, if defined, indicates that the long double
+?C:    is any of the IEEE 754 style long doubles:
+?C:    LONG_DOUBLE_STYLE_IEEE_STD, LONG_DOUBLE_STYLE_IEEE_EXTENDED,
+?C:    LONG_DOUBLE_STYLE_IEEE_DOUBLEDOUBLE.
+?C:.
+?C:LONG_DOUBLE_STYLE_IEEE_DOUBLEDOUBLE:
+?C:    This symbol, if defined, indicates that the long double is
+?C:    the 128-bit double-double.
+?C:.
+?C:LONG_DOUBLE_STYLE_IEEE_EXTENDED:
+?C:    This symbol, if defined, indicates that the long double is
+?C:    the 80-bit IEEE 754. Note that despite the 'extended' this
+?C:    is less than the 'std', since this is an extension of
+?C:    the double precision.
+?C:.
+?C:LONG_DOUBLE_STYLE_IEEE_STD:
+?C:    This symbol, if defined, indicates that the long double is
+?C:    the 128-bit IEEE 754.
+?C:.
+?C:LONG_DOUBLE_STYLE_VAX:
+?C:    This symbol, if defined, indicates that the long double is
+?C:    the 128-bit VAX format H.
+?C:.
 ?H:#$d_ldexpl  HAS_LDEXPL              /**/
 ?H:#$d_longdbl HAS_LONG_DOUBLE         /**/
 ?H:?LONG_DOUBLESIZE:#ifdef HAS_LONG_DOUBLE
@@ -86,6 +137,11 @@
 ?H:?LONG_DOUBLESIZE:#define LONG_DOUBLE_IS_UNKNOWN_FORMAT                      
-1
 ?H:?LONG_DOUBLESIZE:#define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LITTLE_ENDIAN  
LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_LE /* back-compat */
 ?H:?LONG_DOUBLESIZE:#define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BIG_ENDIAN     
LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_BE /* back-compat */
+?H:?LONG_DOUBLESIZE:#$d_long_double_style_ieee LONG_DOUBLE_STYLE_IEEE
+?H:?LONG_DOUBLESIZE:#$d_long_double_style_ieee_doubledouble 
LONG_DOUBLE_STYLE_IEEE_DOUBLEDOUBLE
+?H:?LONG_DOUBLESIZE:#$d_long_double_style_ieee_extended 
LONG_DOUBLE_STYLE_IEEE_EXTENDED
+?H:?LONG_DOUBLESIZE:#$d_long_double_style_ieee_std LONG_DOUBLE_STYLE_IEEE_STD
+?H:?LONG_DOUBLESIZE:#$d_long_double_style_vax LONG_DOUBLE_STYLE_VAX
 ?H:?LONG_DOUBLESIZE:#endif
 ?H:.
 ?F:!try
@@ -285,8 +341,28 @@ case "$longdblkind" in
 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit 
BEs in BE)." >& 4 ;;
 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs 
in BE)." >& 4 ;;
 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs 
in LE)." >& 4 ;;
-9) echo "You have 128-bit PDP-style mixed-endian long doubles." >& 4 ;;
+9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." 
>& 4 ;;
 *) echo "Cannot figure out your long double." >&4 ;;
 esac
+d_long_double_style_ieee=$undef
+d_long_double_style_ieee_std=$undef
+d_long_double_style_ieee_extended=$undef
+d_long_double_style_ieee_doubledouble=$undef
+d_long_double_style_vax=$undef
+case "$longdblkind" in
+1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
+esac
+case "$longdblkind" in
+1|2) d_long_double_style_ieee_std=$define ;;
+esac
+case "$longdblkind" in
+3|4) d_long_double_style_ieee_extended=$define ;;
+esac
+case "$longdblkind" in
+5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
+esac
+case "$longdblkind" in
+9) d_long_double_style_vax=$define ;;
+esac
 $rm_try
 
diff --git a/U/perl/infnan.U b/U/perl/infnan.U
index 0a1e759..b09e1f0 100644
--- a/U/perl/infnan.U
+++ b/U/perl/infnan.U
@@ -71,6 +71,11 @@ $cat >try.c <<EOP
  * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
  * (respectively) as opposed to the more usual
  * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ *
+ * Pre-IEEE-754 floating point format do not even have inf/nan support
+ * at all.  They might have a "max" value (DBL_MAX), which may be deadly
+ * to even mention, causing immediate SIGFPE or equivalent: this is
+ * the case with VAX floating point, for example.
  */
 static void bytes(unsigned char *p, unsigned int n) {
   int i;
@@ -150,6 +155,10 @@ else
        doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
        doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
        ;;
+    9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
+       doubleinfbytes=$undef
+       doublenanbytes=$undef
+       ;;
     *) # No idea.
        doubleinfbytes=$undef
        doublenanbytes=$undef
@@ -212,11 +221,28 @@ else
        longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 
0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
        longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 
0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
        ;;
+    9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
+       longdblinfbytes=$undef
+       longdblnanbytes=$undef
+       ;;
     *) # No idea.
        longdblinfbytes=$undef
        longdblnanbytes=$undef
        ;;
     esac
 fi
+# In case the program crashed the values are empty, turn them undef.
+case "$doubleinfbytes" in
+'') doubleinfbytes=$undef ;;
+esac
+case "$doublenanbytes" in
+'') doublenanbytes=$undef ;;
+esac
+case "$longdblinfbytes" in
+'') longdblinfbytes=$undef ;;
+esac
+case "$longdblnanbytes" in
+'') longdblnanbytes=$undef ;;
+esac
 $rm_try
 
diff --git a/U/perl/longdblfio.U b/U/perl/longdblfio.U
index 2d8deb3..bea14b9 100644
--- a/U/perl/longdblfio.U
+++ b/U/perl/longdblfio.U
@@ -7,7 +7,9 @@
 ?RCS:
 ?MAKE:d_PRIfldbl sPRIfldbl d_PRIgldbl d_PRIFUldbl sPRIGUldbl d_PRIEUldbl \
        sPRIgldbl d_PRIeldbl sPRIeldbl sPRIFUldbl d_PRIGUldbl sPRIEUldbl \
-       d_SCNfldbl \
+       d_SCNfldbl  d_double_style_vax d_double_style_ieee \
+       d_double_style_ibm d_double_style_cray d_double_has_subnormals \
+       d_double_has_inf d_double_has_nan d_double_has_negative_zero \
        sSCNfldbl doublekind: \
        d_longdbl longdblsize doublesize uselongdouble test echo cat rm_try \
        Setvar Compile run i_stdlib osname gccversion ccflags
@@ -98,6 +100,38 @@
 ?S:    This variable, if defined, contains the string used by stdio to
 ?S:    format long doubles (format 'f') for input.
 ?S:.
+?S:d_double_has_inf:
+?S:    This variable conditionally defines the symbol DOUBLE_HAS_INF
+?S:    which indicates that the double type has an infinity.
+?S:.
+?S:d_double_has_nan:
+?S:    This variable conditionally defines the symbol DOUBLE_HAS_INF
+?S:    which indicates that the double type has a not-a-number.
+?S:.
+?S:d_double_has_negative_zero:
+?S:    This variable conditionally defines the symbol DOUBLE_HAS_NEGATIVE_ZERO
+?S:    which indicates that the double type has a negative zero.
+?S:.
+?S:d_double_has_subnormals:
+?S:    This variable conditionally defines the symbol DOUBLE_HAS_SUBNORMALS
+?S:    which indicates that the double type has subnormals (denormals).
+?S:.
+?S:d_double_style_cray:
+?S:    This variable conditionally defines the symbol DOUBLE_STYLE_CRAY
+?S:    which indicates that the double is the 64-bit CRAY mainframe format.
+?S:.
+?S:d_double_style_ibm:
+?S:    This variable conditionally defines the symbol DOUBLE_STYLE_IBM,
+?S:    which indicates that the double is the 64-bit IBM mainframe format.
+?S:.
+?S:d_double_style_ieee:
+?S:    This variable conditionally defines the symbol DOUBLE_STYLE_IEEE,
+?S:    which indicates that the double is the 64-bit IEEE 754.
+?S:.
+?S:d_double_style_vax:
+?S:    This variable conditionally defines the symbol DOUBLE_STYLE_VAX,
+?S:    which indicates that the double is the 64-bit VAX format D or G.
+?S:.
 ?C:PERL_PRIfldbl:
 ?C:    This symbol, if defined, contains the string used by stdio to
 ?C:    format long doubles (format 'f') for output.
@@ -308,6 +342,30 @@ case "$doublekind" in
 14) echo "You have Cray single 64-bit doubles." >&4 ;;
 *) echo "Cannot figure out your double.  You Cyber, or something?" >&4 ;;
 esac
+d_double_style_ieee=$undef
+d_double_style_vax=$undef
+d_double_style_ibm=$undef
+d_double_style_cray=$undef
+case "$doublekind" in
+1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
+9|10|11) d_double_style_vax=$define ;;
+12|13) d_double_style_ibm=$define ;;
+14) d_double_style_cray=$define ;;
+esac
+case "$d_double_style_ieee" in
+$define)
+    d_double_has_inf=$define
+    d_double_has_nan=$define
+    d_double_has_negative_zero=$define
+    d_double_has_subnormals=$define
+    ;;
+*)
+    d_double_has_inf=$undef
+    d_double_has_nan=$undef
+    d_double_has_negative_zero=$undef
+    d_double_has_subnormals=$undef
+    ;;
+esac
 $rm_try
 
 : Check print/scan long double stuff

--
perl5 metaconfig repository

Reply via email to