Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #393: tango-ieee.patch

File tango-ieee.patch, 1.6 kB (added by afb, 5 years ago)

tango-ieee.patch

  • tango/math/IEEE.d

    old new  
    8585 * 64 bit Big-endian    (eg PowerPC) 
    8686 * 64 bit Little-endian 
    8787 * 80 bit Little-endian, with implied bit (eg x87, Itanium). 
     88 * There is also an ABI not strictly following IEEE: 
     89 * 128 bit Big-endian (double-double, as used by GDC <= 0.23) 
    8890 */ 
    8991 
    9092version(LittleEndian) { 
    9193    static assert(real.mant_dig == 53 || real.mant_dig==64, 
    92         "Only 64-bit and 80-bit reals are supported"); 
    93 } else static assert(real.mant_dig == 53
    94      "Only 64-bit reals are supported for BigEndian CPUs"); 
     94        "Only 64-bit and 80-bit reals are supported for LittleEndian CPUs"); 
     95} else static assert(real.mant_dig == 53 || real.mant_dig==106
     96     "Only 64-bit and 128-bit reals are supported for BigEndian CPUs"); 
    9597 
    9698/** IEEE exception status flags 
    9799 
     
    352354    version(LittleEndian) 
    353355    static if (real.mant_dig==64) const int EXPONENTPOS = 4; 
    354356                             else const int EXPONENTPOS = 3; 
    355     else const int EXPONENTPOS = 0; 
     357    else // BigEndian 
     358    static if (real.mant_dig==64) const int EXPONENTPOS = 0; 
     359                             else const int EXPONENTPOS = 0; 
    356360 
    357361    ex = vu[EXPONENTPOS] & EXPMASK; 
    358362static if (real.mant_dig == 64) { 
     
    384388        exp = i; 
    385389        vu[EXPONENTPOS] = cast(ushort)((0x8000 & vu[EXPONENTPOS]) | 0x3FFE); 
    386390    } 
     391} else static if (real.mant_dig == 106) { 
     392// 128-bit reals 
     393    //TODO 
     394    assert(0); 
    387395} else { 
    388396// 64-bit reals 
    389397    if (ex) { // If exponent is non-zero