object.c
/*
 *  toCrayFloat - map IEEE 754 floating point format to Cray format
 */
map IEEE 754 floating point format to Cray format
map IEEE 754 floating point format to Cray format
u64 toCrayFloat(u64 ieee) {
    u64 cray_f;
    long exponent;
    u64 fraction;
    u64 sign;
    if (ieee == 0) return 0;
    sign = ieee & 0x8000000000000000;
    exponent = ((ieee >> 52) & 0x7ff) - 1023; 
    fraction = ieee & 0xfffffffffffff;        
      Normalized value has 1 in most significant bit of fraction, so shift a 1 into the IEEE
      fraction, adjust the exponent accordingly, then add Cray bias to produce 15-bit exponent.
    cray_f = sign | ((((exponent + 1) + 040000) & 0x7fff) << 48) | ((fraction >> 5) | 0x800000000000);
    return cray_f;
}
u64 toCrayFloat ( u64 ieee ) { u64 cray_f ; long exponent ; u64 fraction ; u64 sign ; if ( ieee == 0 ) return 0 ; sign = ieee & 0x8000000000000000 ; exponent = ( ( ieee >> 52 ) & 0x7ff ) - 1023 ; fraction = ieee & 0xfffffffffffff ; cray_f = sign | ( ( ( ( exponent + 1 ) + 040000 ) & 0x7fff ) << 48 ) | ( ( fraction >> 5 ) | 0x800000000000 ) ; return cray_f ; }
toCrayFloat - map IEEE 754 floating point format to Cray format
toCrayFloat - map IEEE 754 floating point format to Cray format
// unbias the 11-bit exponent // 1 implied to left of binary point // //  Normalized value has 1 in most significant bit of fraction, so shift a 1 into the IEEE //  fraction, adjust the exponent accordingly, then add Cray bias to produce 15-bit exponent. //