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 85 85 * 64 bit Big-endian (eg PowerPC) 86 86 * 64 bit Little-endian 87 87 * 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) 88 90 */ 89 91 90 92 version(LittleEndian) { 91 93 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"); 95 97 96 98 /** IEEE exception status flags 97 99 … … 352 354 version(LittleEndian) 353 355 static if (real.mant_dig==64) const int EXPONENTPOS = 4; 354 356 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; 356 360 357 361 ex = vu[EXPONENTPOS] & EXPMASK; 358 362 static if (real.mant_dig == 64) { … … 384 388 exp = i; 385 389 vu[EXPONENTPOS] = cast(ushort)((0x8000 & vu[EXPONENTPOS]) | 0x3FFE); 386 390 } 391 } else static if (real.mant_dig == 106) { 392 // 128-bit reals 393 //TODO 394 assert(0); 387 395 } else { 388 396 // 64-bit reals 389 397 if (ex) { // If exponent is non-zero










