In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/60d5033292df238895c866316ce2f72eb76e3bb9?hp=f2e32b2c677945ce6a36531a7cd5696dc1ca2cef>
- Log ----------------------------------------------------------------- commit 60d5033292df238895c866316ce2f72eb76e3bb9 Author: Jarkko Hietaniemi <j...@iki.fi> Date: Sun Jul 17 10:53:27 2016 +0300 VAX: perl.h: document the VAX fp better/more M perl.h commit 234b86dfbf86ead1bb11552473feb1a73b654443 Author: Jarkko Hietaniemi <j...@iki.fi> Date: Sun Jul 17 10:48:12 2016 +0300 VAX: Configure: the VAX fp not really little-endian M Configure ----------------------------------------------------------------------- Summary of changes: Configure | 12 ++++++------ perl.h | 37 ++++++++++++++++++++++++++++++++----- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/Configure b/Configure index 944bf66..3a96351 100755 --- a/Configure +++ b/Configure @@ -10145,7 +10145,7 @@ int main() { exit(0); } if (b[0] == 0xCC && b[3] == 0xCC) { - /* VAX format F */ + /* VAX format F, 32-bit PDP-style mixed endian. */ printf("9\n"); exit(0); } @@ -10176,12 +10176,12 @@ int main() { exit(0); } if (b[0] == 0xCC && b[7] == 0xCC) { - /* VAX format D, 64-bit little-endian. */ + /* VAX format D, 64-bit PDP-style mixed endian. */ printf("10\n"); exit(0); } if (b[0] == 0xD9 && b[7] == 0x99) { - /* VAX format G, 64-bit little-endian. */ + /* VAX format G, 64-bit PDP-style mixed endian. */ printf("11\n"); exit(0); } @@ -10219,9 +10219,9 @@ 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 ;; -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 ;; +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 ;; esac $rm_try diff --git a/perl.h b/perl.h index 2702cc1..c6c18db 100644 --- a/perl.h +++ b/perl.h @@ -6771,11 +6771,38 @@ extern void moncontrol(int); # define DOUBLE_MIX_ENDIAN #endif -/* Even though the VAX formats are kind of little-endian, - * they are not really fully little-endian like Intel IEEE, - * but neither are they really IEEE-mixed endian like the - * mixed-endian ARM IEEE formats (with swapped bytes). - * The VAX format ultimately come from PDP. */ +/* 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. + * + * The ordering of the parts in VAX floats is quite vexing. + * In the below the fraction_n are the mantissa bits. + * The fraction_1 is the most significant (numbering as by DEC/Digital), + * and the rightmost bit in each fraction is the least significant. + * This means for example that both the the most and least significant + * bits are in the middle of the floats, not at either end. + * + * F fraction_2:16 sign:1 exp:7 fraction_1:7 + * (exponent bias 128) + * + * D fraction_2:16 sign:1 exp:7 fraction_1:7 + * fraction_4:16 fraction_3:16 + * (exponent bias 128) + * + * G fraction_2:16 sign:1 exp:11 fraction_1:7 + * fraction_4:16 fraction_3:16 + * (exponent bias 1024) + * + * 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) + * + * 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 # define DOUBLE_VAX_ENDIAN -- Perl5 Master Repository