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_MIPS64 | 10 #if V8_TARGET_ARCH_MIPS64 |
(...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1239 | 1239 |
1240 if (original != rounded) { | 1240 if (original != rounded) { |
1241 set_fcsr_bit(kFCSRInexactFlagBit, true); | 1241 set_fcsr_bit(kFCSRInexactFlagBit, true); |
1242 } | 1242 } |
1243 | 1243 |
1244 if (rounded < DBL_MIN && rounded > -DBL_MIN && rounded != 0) { | 1244 if (rounded < DBL_MIN && rounded > -DBL_MIN && rounded != 0) { |
1245 set_fcsr_bit(kFCSRUnderflowFlagBit, true); | 1245 set_fcsr_bit(kFCSRUnderflowFlagBit, true); |
1246 ret = true; | 1246 ret = true; |
1247 } | 1247 } |
1248 | 1248 |
1249 if (rounded >= max_int32 || rounded < min_int32) { | 1249 if (rounded > max_int32 || rounded < min_int32) { |
1250 set_fcsr_bit(kFCSROverflowFlagBit, true); | 1250 set_fcsr_bit(kFCSROverflowFlagBit, true); |
1251 // The reference is not really clear but it seems this is required: | 1251 // The reference is not really clear but it seems this is required: |
1252 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); | 1252 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); |
1253 ret = true; | 1253 ret = true; |
1254 } | 1254 } |
1255 | 1255 |
1256 return ret; | 1256 return ret; |
1257 } | 1257 } |
1258 | 1258 |
1259 | 1259 |
(...skipping 11 matching lines...) Expand all Loading... |
1271 | 1271 |
1272 if (original != rounded) { | 1272 if (original != rounded) { |
1273 set_fcsr_bit(kFCSRInexactFlagBit, true); | 1273 set_fcsr_bit(kFCSRInexactFlagBit, true); |
1274 } | 1274 } |
1275 | 1275 |
1276 if (rounded < DBL_MIN && rounded > -DBL_MIN && rounded != 0) { | 1276 if (rounded < DBL_MIN && rounded > -DBL_MIN && rounded != 0) { |
1277 set_fcsr_bit(kFCSRUnderflowFlagBit, true); | 1277 set_fcsr_bit(kFCSRUnderflowFlagBit, true); |
1278 ret = true; | 1278 ret = true; |
1279 } | 1279 } |
1280 | 1280 |
1281 if (rounded >= max_int64 || rounded < min_int64) { | 1281 if (rounded > max_int64 || rounded < min_int64) { |
1282 set_fcsr_bit(kFCSROverflowFlagBit, true); | 1282 set_fcsr_bit(kFCSROverflowFlagBit, true); |
1283 // The reference is not really clear but it seems this is required: | 1283 // The reference is not really clear but it seems this is required: |
1284 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); | 1284 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); |
1285 ret = true; | 1285 ret = true; |
1286 } | 1286 } |
1287 | 1287 |
1288 return ret; | 1288 return ret; |
1289 } | 1289 } |
1290 | 1290 |
1291 | 1291 |
(...skipping 11 matching lines...) Expand all Loading... |
1303 | 1303 |
1304 if (original != rounded) { | 1304 if (original != rounded) { |
1305 set_fcsr_bit(kFCSRInexactFlagBit, true); | 1305 set_fcsr_bit(kFCSRInexactFlagBit, true); |
1306 } | 1306 } |
1307 | 1307 |
1308 if (rounded < FLT_MIN && rounded > -FLT_MIN && rounded != 0) { | 1308 if (rounded < FLT_MIN && rounded > -FLT_MIN && rounded != 0) { |
1309 set_fcsr_bit(kFCSRUnderflowFlagBit, true); | 1309 set_fcsr_bit(kFCSRUnderflowFlagBit, true); |
1310 ret = true; | 1310 ret = true; |
1311 } | 1311 } |
1312 | 1312 |
1313 if (rounded >= max_int32 || rounded < min_int32) { | 1313 if (rounded > max_int32 || rounded < min_int32) { |
1314 set_fcsr_bit(kFCSROverflowFlagBit, true); | 1314 set_fcsr_bit(kFCSROverflowFlagBit, true); |
1315 // The reference is not really clear but it seems this is required: | 1315 // The reference is not really clear but it seems this is required: |
1316 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); | 1316 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); |
1317 ret = true; | 1317 ret = true; |
1318 } | 1318 } |
1319 | 1319 |
1320 return ret; | 1320 return ret; |
1321 } | 1321 } |
1322 | 1322 |
1323 void Simulator::set_fpu_register_word_invalid_result(float original, | 1323 void Simulator::set_fpu_register_word_invalid_result(float original, |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 | 1453 |
1454 if (original != rounded) { | 1454 if (original != rounded) { |
1455 set_fcsr_bit(kFCSRInexactFlagBit, true); | 1455 set_fcsr_bit(kFCSRInexactFlagBit, true); |
1456 } | 1456 } |
1457 | 1457 |
1458 if (rounded < FLT_MIN && rounded > -FLT_MIN && rounded != 0) { | 1458 if (rounded < FLT_MIN && rounded > -FLT_MIN && rounded != 0) { |
1459 set_fcsr_bit(kFCSRUnderflowFlagBit, true); | 1459 set_fcsr_bit(kFCSRUnderflowFlagBit, true); |
1460 ret = true; | 1460 ret = true; |
1461 } | 1461 } |
1462 | 1462 |
1463 if (rounded >= max_int64 || rounded < min_int64) { | 1463 if (rounded > max_int64 || rounded < min_int64) { |
1464 set_fcsr_bit(kFCSROverflowFlagBit, true); | 1464 set_fcsr_bit(kFCSROverflowFlagBit, true); |
1465 // The reference is not really clear but it seems this is required: | 1465 // The reference is not really clear but it seems this is required: |
1466 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); | 1466 set_fcsr_bit(kFCSRInvalidOpFlagBit, true); |
1467 ret = true; | 1467 ret = true; |
1468 } | 1468 } |
1469 | 1469 |
1470 return ret; | 1470 return ret; |
1471 } | 1471 } |
1472 | 1472 |
1473 | 1473 |
(...skipping 3258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4732 } | 4732 } |
4733 | 4733 |
4734 | 4734 |
4735 #undef UNSUPPORTED | 4735 #undef UNSUPPORTED |
4736 } // namespace internal | 4736 } // namespace internal |
4737 } // namespace v8 | 4737 } // namespace v8 |
4738 | 4738 |
4739 #endif // USE_SIMULATOR | 4739 #endif // USE_SIMULATOR |
4740 | 4740 |
4741 #endif // V8_TARGET_ARCH_MIPS64 | 4741 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |