| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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> | 5 #include <limits> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 #include "test/cctest/cctest.h" | 8 #include "test/cctest/cctest.h" |
| 9 #include "test/cctest/compiler/graph-builder-tester.h" | 9 #include "test/cctest/compiler/graph-builder-tester.h" |
| 10 #include "test/cctest/compiler/value-helper.h" | 10 #include "test/cctest/compiler/value-helper.h" |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 // Int32,Uint32 <-> Float64 are actually machine conversions. | 422 // Int32,Uint32 <-> Float64 are actually machine conversions. |
| 423 CheckChange(IrOpcode::kChangeInt32ToFloat64, kRepWord32 | kTypeInt32, | 423 CheckChange(IrOpcode::kChangeInt32ToFloat64, kRepWord32 | kTypeInt32, |
| 424 kRepFloat64); | 424 kRepFloat64); |
| 425 CheckChange(IrOpcode::kChangeUint32ToFloat64, kRepWord32 | kTypeUint32, | 425 CheckChange(IrOpcode::kChangeUint32ToFloat64, kRepWord32 | kTypeUint32, |
| 426 kRepFloat64); | 426 kRepFloat64); |
| 427 CheckChange(IrOpcode::kChangeFloat64ToInt32, kRepFloat64 | kTypeInt32, | 427 CheckChange(IrOpcode::kChangeFloat64ToInt32, kRepFloat64 | kTypeInt32, |
| 428 kRepWord32); | 428 kRepWord32); |
| 429 CheckChange(IrOpcode::kChangeFloat64ToUint32, kRepFloat64 | kTypeUint32, | 429 CheckChange(IrOpcode::kChangeFloat64ToUint32, kRepFloat64 | kTypeUint32, |
| 430 kRepWord32); | 430 kRepWord32); |
| 431 | 431 |
| 432 CheckChange(IrOpcode::kTruncateFloat64ToFloat32, kRepFloat64, kRepFloat32); |
| 433 |
| 432 // Int32,Uint32 <-> Float32 require two changes. | 434 // Int32,Uint32 <-> Float32 require two changes. |
| 433 CheckTwoChanges(IrOpcode::kChangeInt32ToFloat64, | 435 CheckTwoChanges(IrOpcode::kChangeInt32ToFloat64, |
| 434 IrOpcode::kTruncateFloat64ToFloat32, kRepWord32 | kTypeInt32, | 436 IrOpcode::kTruncateFloat64ToFloat32, kRepWord32 | kTypeInt32, |
| 435 kRepFloat32); | 437 kRepFloat32); |
| 436 CheckTwoChanges(IrOpcode::kChangeUint32ToFloat64, | 438 CheckTwoChanges(IrOpcode::kChangeUint32ToFloat64, |
| 437 IrOpcode::kTruncateFloat64ToFloat32, kRepWord32 | kTypeUint32, | 439 IrOpcode::kTruncateFloat64ToFloat32, kRepWord32 | kTypeUint32, |
| 438 kRepFloat32); | 440 kRepFloat32); |
| 439 CheckTwoChanges(IrOpcode::kChangeFloat32ToFloat64, | 441 CheckTwoChanges(IrOpcode::kChangeFloat32ToFloat64, |
| 440 IrOpcode::kChangeFloat64ToInt32, kRepFloat32 | kTypeInt32, | 442 IrOpcode::kChangeFloat64ToInt32, kRepFloat32 | kTypeInt32, |
| 441 kRepWord32); | 443 kRepWord32); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 r.CheckTypeError(kRepWord32 | kTypeUint32, kRepWord64); | 542 r.CheckTypeError(kRepWord32 | kTypeUint32, kRepWord64); |
| 541 | 543 |
| 542 for (size_t i = 0; i < arraysize(all_reps); i++) { | 544 for (size_t i = 0; i < arraysize(all_reps); i++) { |
| 543 for (size_t j = 0; j < arraysize(all_reps); j++) { | 545 for (size_t j = 0; j < arraysize(all_reps); j++) { |
| 544 if (i == j) continue; | 546 if (i == j) continue; |
| 545 // Only a single from representation is allowed. | 547 // Only a single from representation is allowed. |
| 546 r.CheckTypeError(all_reps[i] | all_reps[j], kRepTagged); | 548 r.CheckTypeError(all_reps[i] | all_reps[j], kRepTagged); |
| 547 } | 549 } |
| 548 } | 550 } |
| 549 } | 551 } |
| OLD | NEW |