Commit c609b12e1f41866b2cf82c6b5a5f871fd6bcd4f6

Authored by aurel32
1 parent 196cfc89

target-ppc: use the new float constants

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6515 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 6 additions and 12 deletions
target-ppc/op_helper.c
... ... @@ -1501,15 +1501,13 @@ uint64_t helper_fsqrt (uint64_t arg)
1501 1501 /* fre - fre. */
1502 1502 uint64_t helper_fre (uint64_t arg)
1503 1503 {
1504   - CPU_DoubleU fone, farg;
1505   - fone.ll = 0x3FF0000000000000ULL; /* 1.0 */
1506   - farg.ll = arg;
  1504 + CPU_DoubleU farg;
1507 1505  
1508 1506 if (unlikely(float64_is_signaling_nan(farg.d))) {
1509 1507 /* sNaN reciprocal */
1510 1508 farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN);
1511 1509 } else {
1512   - farg.d = float64_div(fone.d, farg.d, &env->fp_status);
  1510 + farg.d = float64_div(float64_one, farg.d, &env->fp_status);
1513 1511 }
1514 1512 return farg.d;
1515 1513 }
... ... @@ -1517,16 +1515,14 @@ uint64_t helper_fre (uint64_t arg)
1517 1515 /* fres - fres. */
1518 1516 uint64_t helper_fres (uint64_t arg)
1519 1517 {
1520   - CPU_DoubleU fone, farg;
  1518 + CPU_Double farg;
1521 1519 float32 f32;
1522   - fone.ll = 0x3FF0000000000000ULL; /* 1.0 */
1523   - farg.ll = arg;
1524 1520  
1525 1521 if (unlikely(float64_is_signaling_nan(farg.d))) {
1526 1522 /* sNaN reciprocal */
1527 1523 farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN);
1528 1524 } else {
1529   - farg.d = float64_div(fone.d, farg.d, &env->fp_status);
  1525 + farg.d = float64_div(float64_one, farg.d, &env->fp_status);
1530 1526 f32 = float64_to_float32(farg.d, &env->fp_status);
1531 1527 farg.d = float32_to_float64(f32, &env->fp_status);
1532 1528 }
... ... @@ -1536,10 +1532,8 @@ uint64_t helper_fres (uint64_t arg)
1536 1532 /* frsqrte - frsqrte. */
1537 1533 uint64_t helper_frsqrte (uint64_t arg)
1538 1534 {
1539   - CPU_DoubleU fone, farg;
  1535 + CPU_DoubleU farg;
1540 1536 float32 f32;
1541   - fone.ll = 0x3FF0000000000000ULL; /* 1.0 */
1542   - farg.ll = arg;
1543 1537  
1544 1538 if (unlikely(float64_is_signaling_nan(farg.d))) {
1545 1539 /* sNaN reciprocal square root */
... ... @@ -1549,7 +1543,7 @@ uint64_t helper_frsqrte (uint64_t arg)
1549 1543 farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXSQRT);
1550 1544 } else {
1551 1545 farg.d = float64_sqrt(farg.d, &env->fp_status);
1552   - farg.d = float64_div(fone.d, farg.d, &env->fp_status);
  1546 + farg.d = float64_div(float64_one, farg.d, &env->fp_status);
1553 1547 f32 = float64_to_float32(farg.d, &env->fp_status);
1554 1548 farg.d = float32_to_float64(f32, &env->fp_status);
1555 1549 }
... ...