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 #include "src/v8.h" | 10 #include "src/v8.h" |
(...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1281 | 1281 |
1282 if (!std::isfinite(original) || !std::isfinite(rounded)) { | 1282 if (!std::isfinite(original) || !std::isfinite(rounded)) { |
1283 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); | 1283 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); |
1284 ret = true; | 1284 ret = true; |
1285 } | 1285 } |
1286 | 1286 |
1287 if (original != rounded) { | 1287 if (original != rounded) { |
1288 set_fcsr_bit(kFCSRInexactFlagBit, true); | 1288 set_fcsr_bit(kFCSRInexactFlagBit, true); |
1289 } | 1289 } |
1290 | 1290 |
1291 if (rounded < DBL_MIN && rounded > -DBL_MIN && rounded != 0) { | 1291 if (rounded < std::numeric_limits<double>::min() && |
| 1292 rounded > -std::numeric_limits<double>::min() && rounded != 0) { |
1292 set_fcsr_bit(kFCSRUnderflowFlagBit, true); | 1293 set_fcsr_bit(kFCSRUnderflowFlagBit, true); |
1293 ret = true; | 1294 ret = true; |
1294 } | 1295 } |
1295 | 1296 |
1296 if (rounded > max_int32 || rounded < min_int32) { | 1297 if (rounded > max_int32 || rounded < min_int32) { |
1297 set_fcsr_bit(kFCSROverflowFlagBit, true); | 1298 set_fcsr_bit(kFCSROverflowFlagBit, true); |
1298 // The reference is not really clear but it seems this is required: | 1299 // The reference is not really clear but it seems this is required: |
1299 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); | 1300 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); |
1300 ret = true; | 1301 ret = true; |
1301 } | 1302 } |
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3259 } | 3260 } |
3260 | 3261 |
3261 | 3262 |
3262 #undef UNSUPPORTED | 3263 #undef UNSUPPORTED |
3263 | 3264 |
3264 } } // namespace v8::internal | 3265 } } // namespace v8::internal |
3265 | 3266 |
3266 #endif // USE_SIMULATOR | 3267 #endif // USE_SIMULATOR |
3267 | 3268 |
3268 #endif // V8_TARGET_ARCH_MIPS | 3269 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |