| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <limits.h> | 5 #include <limits.h> |
| 6 #include <stdarg.h> | 6 #include <stdarg.h> |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #if V8_TARGET_ARCH_MIPS | 10 #if V8_TARGET_ARCH_MIPS |
| (...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1434 | 1434 |
| 1435 if (original != rounded) { | 1435 if (original != rounded) { |
| 1436 set_fcsr_bit(kFCSRInexactFlagBit, true); | 1436 set_fcsr_bit(kFCSRInexactFlagBit, true); |
| 1437 } | 1437 } |
| 1438 | 1438 |
| 1439 if (rounded < DBL_MIN && rounded > -DBL_MIN && rounded != 0) { | 1439 if (rounded < DBL_MIN && rounded > -DBL_MIN && rounded != 0) { |
| 1440 set_fcsr_bit(kFCSRUnderflowFlagBit, true); | 1440 set_fcsr_bit(kFCSRUnderflowFlagBit, true); |
| 1441 ret = true; | 1441 ret = true; |
| 1442 } | 1442 } |
| 1443 | 1443 |
| 1444 if (rounded > max_int32 || rounded < min_int32) { | 1444 if (rounded >= max_int32 || rounded < min_int32) { |
| 1445 set_fcsr_bit(kFCSROverflowFlagBit, true); | 1445 set_fcsr_bit(kFCSROverflowFlagBit, true); |
| 1446 // The reference is not really clear but it seems this is required: | 1446 // The reference is not really clear but it seems this is required: |
| 1447 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); | 1447 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); |
| 1448 ret = true; | 1448 ret = true; |
| 1449 } | 1449 } |
| 1450 | 1450 |
| 1451 return ret; | 1451 return ret; |
| 1452 } | 1452 } |
| 1453 | 1453 |
| 1454 | 1454 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1466 | 1466 |
| 1467 if (original != rounded) { | 1467 if (original != rounded) { |
| 1468 set_fcsr_bit(kFCSRInexactFlagBit, true); | 1468 set_fcsr_bit(kFCSRInexactFlagBit, true); |
| 1469 } | 1469 } |
| 1470 | 1470 |
| 1471 if (rounded < DBL_MIN && rounded > -DBL_MIN && rounded != 0) { | 1471 if (rounded < DBL_MIN && rounded > -DBL_MIN && rounded != 0) { |
| 1472 set_fcsr_bit(kFCSRUnderflowFlagBit, true); | 1472 set_fcsr_bit(kFCSRUnderflowFlagBit, true); |
| 1473 ret = true; | 1473 ret = true; |
| 1474 } | 1474 } |
| 1475 | 1475 |
| 1476 if (rounded > max_int64 || rounded < min_int64) { | 1476 if (rounded >= max_int64 || rounded < min_int64) { |
| 1477 set_fcsr_bit(kFCSROverflowFlagBit, true); | 1477 set_fcsr_bit(kFCSROverflowFlagBit, true); |
| 1478 // The reference is not really clear but it seems this is required: | 1478 // The reference is not really clear but it seems this is required: |
| 1479 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); | 1479 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); |
| 1480 ret = true; | 1480 ret = true; |
| 1481 } | 1481 } |
| 1482 | 1482 |
| 1483 return ret; | 1483 return ret; |
| 1484 } | 1484 } |
| 1485 | 1485 |
| 1486 | 1486 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1498 | 1498 |
| 1499 if (original != rounded) { | 1499 if (original != rounded) { |
| 1500 set_fcsr_bit(kFCSRInexactFlagBit, true); | 1500 set_fcsr_bit(kFCSRInexactFlagBit, true); |
| 1501 } | 1501 } |
| 1502 | 1502 |
| 1503 if (rounded < FLT_MIN && rounded > -FLT_MIN && rounded != 0) { | 1503 if (rounded < FLT_MIN && rounded > -FLT_MIN && rounded != 0) { |
| 1504 set_fcsr_bit(kFCSRUnderflowFlagBit, true); | 1504 set_fcsr_bit(kFCSRUnderflowFlagBit, true); |
| 1505 ret = true; | 1505 ret = true; |
| 1506 } | 1506 } |
| 1507 | 1507 |
| 1508 if (rounded > max_int32 || rounded < min_int32) { | 1508 if (rounded >= max_int32 || rounded < min_int32) { |
| 1509 set_fcsr_bit(kFCSROverflowFlagBit, true); | 1509 set_fcsr_bit(kFCSROverflowFlagBit, true); |
| 1510 // The reference is not really clear but it seems this is required: | 1510 // The reference is not really clear but it seems this is required: |
| 1511 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); | 1511 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); |
| 1512 ret = true; | 1512 ret = true; |
| 1513 } | 1513 } |
| 1514 | 1514 |
| 1515 return ret; | 1515 return ret; |
| 1516 } | 1516 } |
| 1517 | 1517 |
| 1518 | 1518 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1530 | 1530 |
| 1531 if (original != rounded) { | 1531 if (original != rounded) { |
| 1532 set_fcsr_bit(kFCSRInexactFlagBit, true); | 1532 set_fcsr_bit(kFCSRInexactFlagBit, true); |
| 1533 } | 1533 } |
| 1534 | 1534 |
| 1535 if (rounded < FLT_MIN && rounded > -FLT_MIN && rounded != 0) { | 1535 if (rounded < FLT_MIN && rounded > -FLT_MIN && rounded != 0) { |
| 1536 set_fcsr_bit(kFCSRUnderflowFlagBit, true); | 1536 set_fcsr_bit(kFCSRUnderflowFlagBit, true); |
| 1537 ret = true; | 1537 ret = true; |
| 1538 } | 1538 } |
| 1539 | 1539 |
| 1540 if (rounded > max_int64 || rounded < min_int64) { | 1540 if (rounded >= max_int64 || rounded < min_int64) { |
| 1541 set_fcsr_bit(kFCSROverflowFlagBit, true); | 1541 set_fcsr_bit(kFCSROverflowFlagBit, true); |
| 1542 // The reference is not really clear but it seems this is required: | 1542 // The reference is not really clear but it seems this is required: |
| 1543 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); | 1543 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); |
| 1544 ret = true; | 1544 ret = true; |
| 1545 } | 1545 } |
| 1546 | 1546 |
| 1547 return ret; | 1547 return ret; |
| 1548 } | 1548 } |
| 1549 | 1549 |
| 1550 | 1550 |
| (...skipping 3022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4573 | 4573 |
| 4574 | 4574 |
| 4575 #undef UNSUPPORTED | 4575 #undef UNSUPPORTED |
| 4576 | 4576 |
| 4577 } // namespace internal | 4577 } // namespace internal |
| 4578 } // namespace v8 | 4578 } // namespace v8 |
| 4579 | 4579 |
| 4580 #endif // USE_SIMULATOR | 4580 #endif // USE_SIMULATOR |
| 4581 | 4581 |
| 4582 #endif // V8_TARGET_ARCH_MIPS | 4582 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |