Changeset 36170 in vbox for trunk/src/recompiler/fpu/softfloat-native.c
- Timestamp:
- Mar 4, 2011 12:49:02 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler/fpu/softfloat-native.c
r36140 r36170 61 61 #endif 62 62 63 #if defined(_ _powerpc__)63 #if defined(_ARCH_PPC) 64 64 65 65 /* correct (but slow) PowerPC rint() (glibc version is incorrect) */ 66 double qemu_rint(double x)66 static double qemu_rint(double x) 67 67 { 68 68 double y = 4503599627370496.0; … … 230 230 { 231 231 if (a < b) { 232 return -1;232 return float_relation_less; 233 233 } else if (a == b) { 234 return 0;234 return float_relation_equal; 235 235 } else if (a > b) { 236 return 1;237 } else { 238 return 2;236 return float_relation_greater; 237 } else { 238 return float_relation_unordered; 239 239 } 240 240 } … … 242 242 { 243 243 if (isless(a, b)) { 244 return -1;244 return float_relation_less; 245 245 } else if (a == b) { 246 return 0;246 return float_relation_equal; 247 247 } else if (isgreater(a, b)) { 248 return 1;249 } else { 250 return 2;248 return float_relation_greater; 249 } else { 250 return float_relation_unordered; 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 ) ); 260 269 } 261 270 … … 392 401 { 393 402 if (a < b) { 394 return -1;403 return float_relation_less; 395 404 } else if (a == b) { 396 return 0;405 return float_relation_equal; 397 406 } else if (a > b) { 398 return 1;399 } else { 400 return 2;407 return float_relation_greater; 408 } else { 409 return float_relation_unordered; 401 410 } 402 411 } … … 404 413 { 405 414 if (isless(a, b)) { 406 return -1;415 return float_relation_less; 407 416 } else if (a == b) { 408 return 0;417 return float_relation_equal; 409 418 } else if (isgreater(a, b)) { 410 return 1;411 } else { 412 return 2;419 return float_relation_greater; 420 } else { 421 return float_relation_unordered; 413 422 } 414 423 } … … 432 441 a = u.i; 433 442 434 return ( LIT64( 0xFF E0000000000000 ) < (bits64) ( a<<1 ) );443 return ( LIT64( 0xFFF0000000000000 ) < (bits64) ( a<<1 ) ); 435 444 436 445 } … … 484 493 { 485 494 if (a < b) { 486 return -1;495 return float_relation_less; 487 496 } else if (a == b) { 488 return 0;497 return float_relation_equal; 489 498 } else if (a > b) { 490 return 1;491 } else { 492 return 2;499 return float_relation_greater; 500 } else { 501 return float_relation_unordered; 493 502 } 494 503 } … … 496 505 { 497 506 if (isless(a, b)) { 498 return -1;507 return float_relation_less; 499 508 } else if (a == b) { 500 return 0;509 return float_relation_equal; 501 510 } else if (isgreater(a, b)) { 502 return 1;503 } else { 504 return 2;511 return float_relation_greater; 512 } else { 513 return float_relation_unordered; 505 514 } 506 515 } 507 516 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 return 524 ( ( u.i.high & 0x7FFF ) == 0x7FFF ) 525 && (bits64) ( aLow<<1 ) 526 && ( u.i.low == aLow ); 527 } 528 529 int floatx80_is_nan( floatx80 a1 ) 508 530 { 509 531 floatx80u u;
Note:
See TracChangeset
for help on using the changeset viewer.