In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/f525b3584353df90f0280edfb22b296ae7fdaa65?hp=3a34ca0bce7835211b45e070373cf653c253636a>
- Log ----------------------------------------------------------------- commit f525b3584353df90f0280edfb22b296ae7fdaa65 Author: Jarkko Hietaniemi <j...@iki.fi> Date: Wed Jul 27 07:04:02 2016 -0400 Configure: note that the infnan tests may crash. (And in VAX, that is exactly what happens with the infinities.) M Configure commit 2c7d988316b685b95a349750a1487f7473c5a179 Author: Jarkko Hietaniemi <j...@iki.fi> Date: Tue Jul 26 22:10:30 2016 -0400 VAX: VAX format H M perl.h commit 86ea01eb2de6e15e79ff54031d7fabfb5f628d4e Author: Jarkko Hietaniemi <j...@iki.fi> Date: Tue Jul 26 22:10:42 2016 -0400 Configure: VAX format H M Configure M config_h.SH M uconfig.h commit a0cc6aaf62d581814737e0f0869cd9ee9d8f88ef Author: Jarkko Hietaniemi <j...@iki.fi> Date: Mon Jul 25 21:50:32 2016 -0400 VAX: catch vax floats beyond VMS or Ultrix M t/op/sprintf.t commit e90f85309441678b2b41bb1acd37873f9443bb67 Author: Jarkko Hietaniemi <j...@iki.fi> Date: Mon Jul 25 18:57:41 2016 -0400 VAX: document also formats S/T/X, and hidden bits Though S, T, and X are not really pure VAX formats per se. M perl.h commit dbdc20d774da8ae76ef23ff9daa4aa4211e23fc2 Author: Jarkko Hietaniemi <j...@iki.fi> Date: Mon Jul 25 21:30:34 2016 -0400 [perl #128630] follow-up on 6151d433 - test explicitly for $^O equivalence (faster, simpler), as suggested in #126380 - allow also \b-/i match of archname - however, do not explicitly anchor the archname, as suggested in #126380, since if the regexp needs that, it can do so - \Q-\E-protect the $^O, for paranoia - for skip, use test.pl skip() instead of ok(1), pointed out privately by Dan Collins - drop the newly added /xxx/ functionality to simplify things M t/op/sprintf.t ----------------------------------------------------------------------- Summary of changes: Configure | 16 ++++++++++++++-- config_h.SH | 1 + perl.h | 33 ++++++++++++++++++++++++++------- t/op/sprintf.t | 32 ++++++++++++++++---------------- uconfig.h | 3 ++- 5 files changed, 59 insertions(+), 26 deletions(-) diff --git a/Configure b/Configure index 3a96351..bd7e022 100755 --- a/Configure +++ b/Configure @@ -7044,6 +7044,16 @@ int main() { exit(0); } #endif +/* We are largely making this up because it may well be + * that the VAX format H was never made available to C, + * only to Fortran. */ +#if LONGDBLSIZE == 16 && defined(__vax__) + if (b[0] == 0xFD && b[15] == 0x99) { + /* VAX format H, PDP-11 mixed endian. */ + printf("9\n"); + exit(0); + } +#endif printf("-1\n"); /* unknown */ exit(0); } @@ -7065,8 +7075,9 @@ case "$longdblkind" in 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;; 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;; 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 double-double long doubles (64-bit LEs in BE)." >& 4 ;; -8) echo "You have 128-bit mixed double-double long doubles (64-bit BEs in LE)." >& 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 ;; *) echo "Cannot figure out your long double." >&4 ;; esac $rm_try @@ -20512,6 +20523,7 @@ esac : Check what kind of inf/nan your system has $echo "Checking the kind of infinities and nans you have..." >&4 +$echo "(The following tests may crash. That's okay.)" >&4 $cat >try.c <<EOP #define DOUBLESIZE $doublesize #$d_longdbl HAS_LONG_DOUBLE diff --git a/config_h.SH b/config_h.SH index 9d3b5d8..2aa37c3 100755 --- a/config_h.SH +++ b/config_h.SH @@ -1959,6 +1959,7 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un #define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_BE 6 #define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_BE 7 #define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_LE 8 +#define LONG_DOUBLE_IS_VAX_H_FLOAT 9 #define LONG_DOUBLE_IS_UNKNOWN_FORMAT -1 #define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LITTLE_ENDIAN LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_LE /* back-compat */ #define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BIG_ENDIAN LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_BE /* back-compat */ diff --git a/perl.h b/perl.h index 0cd2e2a..2735b52 100644 --- a/perl.h +++ b/perl.h @@ -6770,7 +6770,7 @@ extern void moncontrol(int); /* The VAX fp formats are neither consistently little-endian nor * big-endian, and neither are they really IEEE-mixed endian like * the mixed-endian ARM IEEE formats (with swapped bytes). - * Ultimately, the VAX format ultimately came from the PDP. + * Ultimately, the VAX format came from the PDP-11. * * The ordering of the parts in VAX floats is quite vexing. * In the below the fraction_n are the mantissa bits. @@ -6793,24 +6793,36 @@ extern void moncontrol(int); * (somebody at HP should be fired for the URLs) * * F fraction_2:16 sign:1 exp:8 fraction_1:7 - * (exponent bias 128) + * (exponent bias 128, hidden first one-bit) * * D fraction_2:16 sign:1 exp:8 fraction_1:7 * fraction_4:16 fraction_3:16 - * (exponent bias 128) + * (exponent bias 128, hidden first one-bit) * * G fraction_2:16 sign:1 exp:11 fraction_1:4 * fraction_4:16 fraction_3:16 - * (exponent bias 1024) + * (exponent bias 1024, hidden first one-bit) * * H fraction_1:16 sign:1 exp:15 * fraction_3:16 fraction_2:16 * fraction_5:16 fraction_4:16 * fraction_7:16 fraction_6:16 - * (exponent bias 16384) + * (exponent bias 16384, hidden first one-bit) + * (available only on VAX, and only on Fortran?) + * + * The formats S, T and X are available on the Alpha (and Itanium, + * also known as I64/IA64) and are equivalent with the IEEE-754 formats + * binary32, binary64, and binary128 (commonly: float, double, long double). + * + * S sign:1 exp:8 mantissa:23 + * (exponent bias 127, hidden first one-bit) + * + * T sign:1 exp:11 mantissa:52 + * (exponent bias 1022, hidden first one-bit) + * + * X sign:1 exp:15 mantissa:112 + * (exponent bias 16382, hidden first one-bit) * - * The formats T and X are available on the Alpha (and IA64?) - * and are equivalent with the IEEE 754 64 and 128 bit formats. */ #ifdef DOUBLE_IS_VAX_FLOAT @@ -6857,6 +6869,10 @@ extern void moncontrol(int); # define LONGDOUBLE_DOUBLEDOUBLE # endif +# if LONG_DOUBLEKIND == LONG_DOUBLE_IS_VAX_H_FLOAT +# define LONGDOUBLE_VAX_ENDIAN +# endif + #endif /* LONG_DOUBLEKIND */ #ifdef USE_QUADMATH /* assume quadmath endianness == native double endianness */ @@ -6890,6 +6906,9 @@ extern void moncontrol(int); # ifdef LONGDOUBLE_MIX_ENDIAN # define NV_MIX_ENDIAN # endif +# ifdef LONGDOUBLE_VAX_ENDIAN +# define NV_VAX_ENDIAN +# endif #endif #ifdef DOUBLE_IS_IEEE_FORMAT diff --git a/t/op/sprintf.t b/t/op/sprintf.t index 04fc4ce..2fd91c7 100644 --- a/t/op/sprintf.t +++ b/t/op/sprintf.t @@ -32,6 +32,9 @@ if ($^O eq 'VMS') { # No %Config. my $Is_Ultrix_VAX = $^O eq 'ultrix' && `uname -m` =~ /^VAX$/; +# The most generic VAX catcher. +my $Is_VAX_Float = (pack("d", 1) =~ /^[\x80\x10]\x40/); + our $IS_EBCDIC = $::IS_EBCDIC; # Solely to avoid the 'used once' warning our $IS_ASCII = $::IS_ASCII; # Solely to avoid the 'used once' warning @@ -51,7 +54,7 @@ while (<DATA>) { $data =~ s/([eE])\-101$/${1}-56/; # larger exponents $result =~ s/([eE])\-102$/${1}-57/; # " " } - if ($Is_VMS_VAX || $Is_Ultrix_VAX) { + if ($Is_VMS_VAX || $Is_Ultrix_VAX || $Is_VAX_Float) { # VAX DEC C 5.3 at least since there is no # ccflags =~ /float=ieee/ on VAX. # AXP is unaffected whether or not it is using ieee. @@ -113,23 +116,20 @@ for (@tests) { my $osv = exists $Config{osvers} ? $Config{osvers} : "0"; my $archname = $Config{archname}; # >comment skip: all< - if ($os =~ /\ball\b/i) { - $skip = 1; - } elsif ($os =~ /\b$^O(?::(\S+))?\b/i) { + # >comment skip: solaris< + # >comment skip: x86_64-linux-ld< + if ($os =~ /\b(?:all|\Q$^O\E|\Q$archname\E)\b/i) { + $skip = 1; + } elsif ($os =~ /\b\Q$^O\E(?::(\S+))\b/i) { # We can have the $^O followed by an optional condition. # The condition, if present, can be one of: - # (1) a regex between slashes... - # tested as a regex against $Config{archname} - # (2) starts with a digit... + # (1) starts with a digit... # the first pair of dot-separated digits is - # tested against $Config{osvers} - # (3) tested as literal string against $Config{archname} + # tested numerically against $Config{osvers} + # (2) otherwise... + # tested as a \b/i regex against $Config{archname} my $cond = $1; - if ($cond =~ m{^/(.+)/$}) { - # >comment skip: solaris:/86/< - my $vsr = $1; - $skip = $archname =~ /$vsr/; - } elsif ($cond =~ /^\d/) { + if ($cond =~ /^\d/) { # >comment skip: hpux:10.20< my $vsn = $cond; # Only compare on the the first pair of digits, as numeric @@ -138,7 +138,7 @@ for (@tests) { $skip = $vsn ? ($osv <= $vsn ? 1 : 0) : 1; } else { # >comment skip: netbsd:vax-netbsd< - $skip = $cond eq $archname; + $skip = $archname =~ /\b\Q$cond\E\b/i; } } $skip and $comment =~ s/$/, failure expected on $^O $osv $archname/; @@ -148,7 +148,7 @@ for (@tests) { ok(1, join ' ', grep length, ">$result<", $comment); } elsif ($skip) { - ok(1, "skip $comment"); + SKIP: { skip($comment, 1) } } elsif ($y eq ">$result<") # Some C libraries always give { # three-digit exponent diff --git a/uconfig.h b/uconfig.h index 415ec7c..3f38508 100644 --- a/uconfig.h +++ b/uconfig.h @@ -1924,6 +1924,7 @@ #define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_BE 6 #define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_BE 7 #define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_LE 8 +#define LONG_DOUBLE_IS_VAX_H_FLOAT 9 #define LONG_DOUBLE_IS_UNKNOWN_FORMAT -1 #define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LITTLE_ENDIAN LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_LE /* back-compat */ #define LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BIG_ENDIAN LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_BE /* back-compat */ @@ -5259,6 +5260,6 @@ #endif /* Generated from: - * 8559c6ec4e935f6478ac3149c106aed3eacfd60544281f97fd1383110d8a5cce config_h.SH + * 6ebf4d7bc0bc6e96ef5cba3f8321c118c457d80034521b13e3086ef8ee1c850d config_h.SH * 3b14c76342a834042da506e8c3b4269f7d545453079733cb740970ab9cc4294e uconfig.sh * ex: set ro: */ -- Perl5 Master Repository