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