diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2016-07-17 10:53:27 +0300 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2016-07-17 11:01:37 +0300 |
commit | 60d5033292df238895c866316ce2f72eb76e3bb9 (patch) | |
tree | 2e289ff43c21efde43fc7ed6c4f849e2b2b0677b | |
parent | 234b86dfbf86ead1bb11552473feb1a73b654443 (diff) | |
download | perl-60d5033292df238895c866316ce2f72eb76e3bb9.tar.gz |
VAX: perl.h: document the VAX fp better/more
-rw-r--r-- | perl.h | 37 |
1 files changed, 32 insertions, 5 deletions
@@ -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 |