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 "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/arm64/macro-assembler-arm64.h" | 8 #include "src/arm64/macro-assembler-arm64.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/compiler/code-generator-impl.h" | 10 #include "src/compiler/code-generator-impl.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 : InstructionOperandConverter(gen, instr) {} | 26 : InstructionOperandConverter(gen, instr) {} |
27 | 27 |
28 DoubleRegister InputFloat32Register(size_t index) { | 28 DoubleRegister InputFloat32Register(size_t index) { |
29 return InputDoubleRegister(index).S(); | 29 return InputDoubleRegister(index).S(); |
30 } | 30 } |
31 | 31 |
32 DoubleRegister InputFloat64Register(size_t index) { | 32 DoubleRegister InputFloat64Register(size_t index) { |
33 return InputDoubleRegister(index); | 33 return InputDoubleRegister(index); |
34 } | 34 } |
35 | 35 |
| 36 size_t OutputCount() { return instr_->OutputCount(); } |
| 37 |
36 DoubleRegister OutputFloat32Register() { return OutputDoubleRegister().S(); } | 38 DoubleRegister OutputFloat32Register() { return OutputDoubleRegister().S(); } |
37 | 39 |
38 DoubleRegister OutputFloat64Register() { return OutputDoubleRegister(); } | 40 DoubleRegister OutputFloat64Register() { return OutputDoubleRegister(); } |
39 | 41 |
40 Register InputRegister32(size_t index) { | 42 Register InputRegister32(size_t index) { |
41 return ToRegister(instr_->InputAt(index)).W(); | 43 return ToRegister(instr_->InputAt(index)).W(); |
42 } | 44 } |
43 | 45 |
44 Register InputOrZeroRegister32(size_t index) { | 46 Register InputOrZeroRegister32(size_t index) { |
45 DCHECK(instr_->InputAt(index)->IsRegister() || | 47 DCHECK(instr_->InputAt(index)->IsRegister() || |
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 case kArm64Float64ToInt32: | 1032 case kArm64Float64ToInt32: |
1031 __ Fcvtzs(i.OutputRegister32(), i.InputDoubleRegister(0)); | 1033 __ Fcvtzs(i.OutputRegister32(), i.InputDoubleRegister(0)); |
1032 break; | 1034 break; |
1033 case kArm64Float64ToUint32: | 1035 case kArm64Float64ToUint32: |
1034 __ Fcvtzu(i.OutputRegister32(), i.InputDoubleRegister(0)); | 1036 __ Fcvtzu(i.OutputRegister32(), i.InputDoubleRegister(0)); |
1035 break; | 1037 break; |
1036 case kArm64Float32ToInt64: | 1038 case kArm64Float32ToInt64: |
1037 __ Fcvtzs(i.OutputRegister64(), i.InputFloat32Register(0)); | 1039 __ Fcvtzs(i.OutputRegister64(), i.InputFloat32Register(0)); |
1038 break; | 1040 break; |
1039 case kArm64Float64ToInt64: | 1041 case kArm64Float64ToInt64: |
1040 __ Fcvtzs(i.OutputRegister64(), i.InputDoubleRegister(0)); | 1042 __ Fcvtzs(i.OutputRegister(0), i.InputDoubleRegister(0)); |
| 1043 if (i.OutputCount() > 1) { |
| 1044 __ Cmp(i.OutputRegister(0), 1); |
| 1045 __ Ccmp(i.OutputRegister(0), -1, VFlag, vc); |
| 1046 __ Fccmp(i.InputDoubleRegister(0), i.InputDoubleRegister(0), VFlag, vc); |
| 1047 __ Cset(i.OutputRegister(1), vc); |
| 1048 } |
1041 break; | 1049 break; |
1042 case kArm64Float32ToUint64: | 1050 case kArm64Float32ToUint64: |
1043 __ Fcvtzu(i.OutputRegister64(), i.InputFloat32Register(0)); | 1051 __ Fcvtzu(i.OutputRegister64(), i.InputFloat32Register(0)); |
1044 break; | 1052 break; |
1045 case kArm64Float64ToUint64: | 1053 case kArm64Float64ToUint64: |
1046 __ Fcvtzu(i.OutputRegister64(), i.InputDoubleRegister(0)); | 1054 __ Fcvtzu(i.OutputRegister64(), i.InputDoubleRegister(0)); |
1047 break; | 1055 break; |
1048 case kArm64Int32ToFloat64: | 1056 case kArm64Int32ToFloat64: |
1049 __ Scvtf(i.OutputDoubleRegister(), i.InputRegister32(0)); | 1057 __ Scvtf(i.OutputDoubleRegister(), i.InputRegister32(0)); |
1050 break; | 1058 break; |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1593 padding_size -= kInstructionSize; | 1601 padding_size -= kInstructionSize; |
1594 } | 1602 } |
1595 } | 1603 } |
1596 } | 1604 } |
1597 | 1605 |
1598 #undef __ | 1606 #undef __ |
1599 | 1607 |
1600 } // namespace compiler | 1608 } // namespace compiler |
1601 } // namespace internal | 1609 } // namespace internal |
1602 } // namespace v8 | 1610 } // namespace v8 |
OLD | NEW |