In metaconfig.git, the branch master has been updated <http://perl5.git.perl.org/metaconfig.git/commitdiff/8dce5ac72a4a9cfba90f538c8864a6507b75e42b?hp=31e612465cf12d1ed2229eb99f900a8c282f4910>
- Log ----------------------------------------------------------------- commit 8dce5ac72a4a9cfba90f538c8864a6507b75e42b Author: H.Merijn Brand - Tux <[email protected]> Date: Sat Oct 22 14:00:06 2016 +0200 Add scan for IBM and Cray mainframe fp formats. Backport of 6e6b38aecfbcb229c8568366e3566d7fe7c8bbc5 For completeness: it's quite unlikely Perl would build in those environments. Though with Cray it's less impossible: Perl used to build in C90 UNICOS, in 5.8-ish timeframe. With IBM, highly unlikely, because there probably never was a UNIXy enough environment where the IBM Floating Point Architecture was used. M U/perl/longdblfio.U commit 8249279e9a3f36746ee0ce13f9bdff09d6ead6b0 Author: H.Merijn Brand - Tux <[email protected]> Date: Sat Oct 22 12:07:00 2016 +0200 signbit scan assuming too much Backport of b76dad153351f50f46ba283bb0da075b93e89838 It was assuming a negative zero, which is an IEEE-754 only concept. There is no need to assume the negative zero for the correct functioning of the signbit, however. M U/perl/d_signbit.U ----------------------------------------------------------------------- Summary of changes: U/perl/d_signbit.U | 2 +- U/perl/longdblfio.U | 32 +++++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/U/perl/d_signbit.U b/U/perl/d_signbit.U index 01c1def..d50a281 100644 --- a/U/perl/d_signbit.U +++ b/U/perl/d_signbit.U @@ -37,7 +37,7 @@ $cat >try.c <<EOCP int main(int argc, char **argv) { NV x = 0.0; - NV y = -0.0; + NV y = -1.0; if ((signbit(x) == 0) && (signbit(y) != 0)) return 0; else diff --git a/U/perl/longdblfio.U b/U/perl/longdblfio.U index 635f8fe..2d8deb3 100644 --- a/U/perl/longdblfio.U +++ b/U/perl/longdblfio.U @@ -25,6 +25,9 @@ ?S: 9 = VAX 32bit little endian F float format ?S: 10 = VAX 64bit little endian D float format ?S: 11 = VAX 64bit little endian G float format +?S: 12 = IBM 32bit format +?S: 13 = IBM 64bit format +?S: 14 = Cray 64bit format ?S: -1 = unknown format. ?S:. ?S:d_PRIfldbl: @@ -136,6 +139,9 @@ ?C: DOUBLE_IS_VAX_F_FLOAT ?C: DOUBLE_IS_VAX_D_FLOAT ?C: DOUBLE_IS_VAX_G_FLOAT +?C: DOUBLE_IS_IBM_SINGLE_32_BIT +?C: DOUBLE_IS_IBM_DOUBLE_64_BIT +?C: DOUBLE_IS_CRAY_SINGLE_64_BIT ?C: DOUBLE_IS_UNKNOWN_FORMAT ?C:. ?LINT:known DOUBLE_IS_IEEE_754_32_BIT_LITTLE_ENDIAN @@ -149,6 +155,9 @@ ?LINT:known DOUBLE_IS_VAX_F_FLOAT ?LINT:known DOUBLE_IS_VAX_D_FLOAT ?LINT:known DOUBLE_IS_VAX_G_FLOAT +?LINT:known DOUBLE_IS_IBM_SINGLE_32_BIT +?LINT:known DOUBLE_IS_IBM_DOUBLE_64_BIT +?LINT:known DOUBLE_IS_CRAY_SINGLE_64_BIT ?LINT:known DOUBLE_IS_UNKNOWN_FORMAT ?H:#define DOUBLEKIND $doublekind /**/ ?H:?DOUBLEKIND:#define DOUBLE_IS_IEEE_754_32_BIT_LITTLE_ENDIAN 1 @@ -162,6 +171,9 @@ ?H:?DOUBLEKIND:#define DOUBLE_IS_VAX_F_FLOAT 9 ?H:?DOUBLEKIND:#define DOUBLE_IS_VAX_D_FLOAT 10 ?H:?DOUBLEKIND:#define DOUBLE_IS_VAX_G_FLOAT 11 +?H:?DOUBLEKIND:#define DOUBLE_IS_IBM_SINGLE_32_BIT 12 +?H:?DOUBLEKIND:#define DOUBLE_IS_IBM_DOUBLE_64_BIT 13 +?H:?DOUBLEKIND:#define DOUBLE_IS_CRAY_SINGLE_64_BIT 14 ?H:?DOUBLEKIND:#define DOUBLE_IS_UNKNOWN_FORMAT -1 ?H:#$d_PRIfldbl PERL_PRIfldbl $sPRIfldbl /**/ ?H:#$d_PRIgldbl PERL_PRIgldbl $sPRIgldbl /**/ @@ -203,6 +215,11 @@ int main() { printf("9\n"); exit(0); } + if (b[0] == 0xC0 && b[3] == 0x9A) { + /* IBM single 32-bit */ + printf("12\n"); + exit(0); + } #endif #if DOUBLESIZE == 8 if (b[0] == 0x9A && b[7] == 0xBF) { @@ -239,6 +256,16 @@ int main() { printf("11\n"); exit(0); } + if (b[0] == 0xC0 && b[7] == 0x9A) { + /* IBM double 64-bit */ + printf("13\n"); + exit(0); + } + if (b[0] == 0xBF && b[7] == 0xCD) { + /* CRAY single 64-bit */ + printf("14\n"); + exit(0); + } #endif #if DOUBLESIZE == 16 if (b[0] == 0x9A && b[15] == 0xBF) { @@ -276,7 +303,10 @@ case "$doublekind" in 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;; 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;; 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;; -*) echo "Cannot figure out your double. You CRAY, or something?" >&4 ;; +12) echo "You have IBM short 32-bit doubles." >&4 ;; +13) echo "You have IBM long 64-bit doubles." >&4 ;; +14) echo "You have Cray single 64-bit doubles." >&4 ;; +*) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;; esac $rm_try -- perl5 metaconfig repository
