Changeset 36140 in vbox for trunk/src/recompiler/fpu/softfloat-native.c
- Timestamp:
- Mar 3, 2011 1:48:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler/fpu/softfloat-native.c
r21292 r36140 7 7 { 8 8 STATUS(float_rounding_mode) = val; 9 #if defined(_BSD) && !defined(__APPLE__) || (defined(HOST_SOLARIS) && (HOST_SOLARIS < 10 || HOST_SOLARIS == 11)) 9 #if defined(_BSD) && !defined(__APPLE__) || (defined(HOST_SOLARIS) && (HOST_SOLARIS < 10 || HOST_SOLARIS == 11)) /* VBOX adds sol 11 */ 10 10 fpsetround(val); 11 11 #elif defined(__arm__) … … 61 61 #endif 62 62 63 #if defined(_ ARCH_PPC)63 #if defined(__powerpc__) 64 64 65 65 /* correct (but slow) PowerPC rint() (glibc version is incorrect) */ 66 staticdouble qemu_rint(double x)66 double qemu_rint(double x) 67 67 { 68 68 double y = 4503599627370496.0; … … 230 230 { 231 231 if (a < b) { 232 return float_relation_less;232 return -1; 233 233 } else if (a == b) { 234 return float_relation_equal;234 return 0; 235 235 } else if (a > b) { 236 return float_relation_greater;237 } else { 238 return float_relation_unordered;236 return 1; 237 } else { 238 return 2; 239 239 } 240 240 } … … 242 242 { 243 243 if (isless(a, b)) { 244 return float_relation_less;244 return -1; 245 245 } else if (a == b) { 246 return float_relation_equal;246 return 0; 247 247 } else if (isgreater(a, b)) { 248 return float_relation_greater;249 } else { 250 return float_relation_unordered;248 return 1; 249 } else { 250 return 2; 251 251 } 252 252 } … … 258 258 a = u.i; 259 259 return ( ( ( a>>22 ) & 0x1FF ) == 0x1FE ) && ( a & 0x003FFFFF ); 260 }261 262 int float32_is_nan( float32 a1 )263 {264 float32u u;265 uint64_t a;266 u.f = a1;267 a = u.i;268 return ( 0xFF800000 < ( a<<1 ) );269 260 } 270 261 … … 401 392 { 402 393 if (a < b) { 403 return float_relation_less;394 return -1; 404 395 } else if (a == b) { 405 return float_relation_equal;396 return 0; 406 397 } else if (a > b) { 407 return float_relation_greater;408 } else { 409 return float_relation_unordered;398 return 1; 399 } else { 400 return 2; 410 401 } 411 402 } … … 413 404 { 414 405 if (isless(a, b)) { 415 return float_relation_less;406 return -1; 416 407 } else if (a == b) { 417 return float_relation_equal;408 return 0; 418 409 } else if (isgreater(a, b)) { 419 return float_relation_greater;420 } else { 421 return float_relation_unordered;410 return 1; 411 } else { 412 return 2; 422 413 } 423 414 } … … 441 432 a = u.i; 442 433 443 return ( LIT64( 0xFF F0000000000000 ) < (bits64) ( a<<1 ) );434 return ( LIT64( 0xFFE0000000000000 ) < (bits64) ( a<<1 ) ); 444 435 445 436 } … … 493 484 { 494 485 if (a < b) { 495 return float_relation_less;486 return -1; 496 487 } else if (a == b) { 497 return float_relation_equal;488 return 0; 498 489 } else if (a > b) { 499 return float_relation_greater;500 } else { 501 return float_relation_unordered;490 return 1; 491 } else { 492 return 2; 502 493 } 503 494 } … … 505 496 { 506 497 if (isless(a, b)) { 507 return float_relation_less;498 return -1; 508 499 } else if (a == b) { 509 return float_relation_equal;500 return 0; 510 501 } else if (isgreater(a, b)) { 511 return float_relation_greater;512 } else { 513 return float_relation_unordered;502 return 1; 503 } else { 504 return 2; 514 505 } 515 506 } 516 507 int floatx80_is_signaling_nan( floatx80 a1) 517 {518 floatx80u u;519 uint64_t aLow;520 u.f = a1;521 522 aLow = u.i.low & ~ LIT64( 0x4000000000000000 );523 return524 ( ( u.i.high & 0x7FFF ) == 0x7FFF )525 && (bits64) ( aLow<<1 )526 && ( u.i.low == aLow );527 }528 529 int floatx80_is_nan( floatx80 a1 )530 508 { 531 509 floatx80u u;
Note:
See TracChangeset
for help on using the changeset viewer.