This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add scan for IBM and Cray mainframe fp formats.
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 17 Oct 2016 12:29:35 +0000 (08:29 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 17 Oct 2016 23:29:29 +0000 (19:29 -0400)
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.

Configure
Porting/Glossary
config_h.SH

index 818ab8e..7c598e9 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -10161,6 +10161,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) {
@@ -10197,6 +10202,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) {
@@ -10234,7 +10249,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
 
index 39a17b8..06b80a8 100644 (file)
@@ -2933,6 +2933,9 @@ doublekind (longdblfio.U):
        9 = VAX 32bit little endian F float format
        10 = VAX 64bit little endian D float format
        11 = VAX 64bit little endian G float format
+       12 = IBM 32bit format
+       13 = IBM 64bit format
+       14 = Cray 64bit format
        -1 = unknown format.
 
 doublemantbits (mantbits.U):
index 099f92a..fbf6d32 100755 (executable)
@@ -3982,6 +3982,9 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
  *     DOUBLE_IS_VAX_F_FLOAT
  *     DOUBLE_IS_VAX_D_FLOAT
  *     DOUBLE_IS_VAX_G_FLOAT
+ *     DOUBLE_IS_IBM_SINGLE_32_BIT
+ *     DOUBLE_IS_IBM_DOUBLE_64_BIT
+ *     DOUBLE_IS_CRAY_SINGLE_64_BIT
  *     DOUBLE_IS_UNKNOWN_FORMAT
  */
 #define DOUBLEKIND $doublekind         /**/
@@ -3996,6 +3999,9 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
 #define DOUBLE_IS_VAX_F_FLOAT  9
 #define DOUBLE_IS_VAX_D_FLOAT  10
 #define DOUBLE_IS_VAX_G_FLOAT  11
+#define DOUBLE_IS_IBM_SINGLE_32_BIT    12
+#define DOUBLE_IS_IBM_DOUBLE_64_BIT    13
+#define DOUBLE_IS_CRAY_SINGLE_64_BIT   14
 #define DOUBLE_IS_UNKNOWN_FORMAT               -1
 #$d_PRIfldbl PERL_PRIfldbl     $sPRIfldbl      /**/
 #$d_PRIgldbl PERL_PRIgldbl     $sPRIgldbl      /**/