From: Jarkko Hietaniemi Date: Sun, 26 Jun 2016 01:57:55 +0000 (-0400) Subject: VAX: Configure changes for VAX floats X-Git-Tag: v5.25.3~103 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/c183cd86045c09fcbba056a606ae50f11c9c5b5a VAX: Configure changes for VAX floats Detect the VAX floating point formats D and G. And the F float, but that is float (duh), never likely to be the double, but do it for consistency (we detect IEEE single precision floats, too). The T float and X float are the IEEE 64-bit and 128-bit, but those were available only on the Alpha. Tested on vax-netbsd. --- diff --git a/Configure b/Configure index 2b2cd07..89585f1 100755 --- a/Configure +++ b/Configure @@ -10127,6 +10127,11 @@ int main() { printf("2\n"); exit(0); } + if (b[0] == 0xCC && b[3] == 0xCC) { + /* VAX format F */ + printf("9\n"); + exit(0); + } #endif #if DOUBLESIZE == 8 if (b[0] == 0x9A && b[7] == 0xBF) { @@ -10153,6 +10158,16 @@ int main() { printf("8\n"); exit(0); } + if (b[0] == 0xCC && b[7] == 0xCC) { + /* VAX format D, 64-bit little-endian. */ + printf("10\n"); + exit(0); + } + if (b[0] == 0xD9 && b[7] == 0x99) { + /* VAX format G, 64-bit little-endian. */ + printf("11\n"); + exit(0); + } #endif #if DOUBLESIZE == 16 if (b[0] == 0x9A && b[15] == 0xBF) { @@ -10166,7 +10181,7 @@ int main() { exit(0); } #endif - /* Then there are old mainframe/miniframe formats like VAX, IBM, and CRAY. + /* Then there are old mainframe/miniframe formats like IBM, and CRAY. * Whether those environments can still build Perl is debatable. */ printf("-1\n"); /* unknown */ exit(0); @@ -10187,7 +10202,10 @@ case "$doublekind" in 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;; 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;; 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;; -*) echo "Cannot figure out your double. You VAX, or something?" >&4 ;; +9) echo "You have VAX format F 32-bit little-endian doubles." >&4 ;; +10) echo "You have VAX format D 64-bit little-endian doubles." >&4 ;; +11) echo "You have VAX format G 64-bit little-endian doubles." >&4 ;; +*) echo "Cannot figure out your double. You CRAY, or something?" >&4 ;; esac $rm_try diff --git a/config_h.SH b/config_h.SH index 6e8cd3b..9d3b5d8 100755 --- a/config_h.SH +++ b/config_h.SH @@ -3965,6 +3965,9 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un * DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN * DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_LE_BE * DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_BE_LE + * DOUBLE_IS_VAX_F_FLOAT + * DOUBLE_IS_VAX_D_FLOAT + * DOUBLE_IS_VAX_G_FLOAT * DOUBLE_IS_UNKNOWN_FORMAT */ #define DOUBLEKIND $doublekind /**/ @@ -3976,6 +3979,9 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un #define DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN 6 #define DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_LE_BE 7 #define DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_BE_LE 8 +#define DOUBLE_IS_VAX_F_FLOAT 9 +#define DOUBLE_IS_VAX_D_FLOAT 10 +#define DOUBLE_IS_VAX_G_FLOAT 11 #define DOUBLE_IS_UNKNOWN_FORMAT -1 #$d_PRIfldbl PERL_PRIfldbl $sPRIfldbl /**/ #$d_PRIgldbl PERL_PRIgldbl $sPRIgldbl /**/ diff --git a/uconfig.h b/uconfig.h index 9c008fe..415ec7c 100644 --- a/uconfig.h +++ b/uconfig.h @@ -3930,6 +3930,9 @@ * DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN * DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_LE_BE * DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_BE_LE + * DOUBLE_IS_VAX_F_FLOAT + * DOUBLE_IS_VAX_D_FLOAT + * DOUBLE_IS_VAX_G_FLOAT * DOUBLE_IS_UNKNOWN_FORMAT */ #define DOUBLEKIND 3 /**/ @@ -3941,6 +3944,9 @@ #define DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN 6 #define DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_LE_BE 7 #define DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_BE_LE 8 +#define DOUBLE_IS_VAX_F_FLOAT 9 +#define DOUBLE_IS_VAX_D_FLOAT 10 +#define DOUBLE_IS_VAX_G_FLOAT 11 #define DOUBLE_IS_UNKNOWN_FORMAT -1 /*#define PERL_PRIfldbl "llf" / **/ /*#define PERL_PRIgldbl "llg" / **/ @@ -5253,6 +5259,6 @@ #endif /* Generated from: - * c14530f7567d861ce42d42446fc2ee9cd3625763f65867d5f42849c337bbc361 config_h.SH + * 8559c6ec4e935f6478ac3149c106aed3eacfd60544281f97fd1383110d8a5cce config_h.SH * 3b14c76342a834042da506e8c3b4269f7d545453079733cb740970ab9cc4294e uconfig.sh * ex: set ro: */