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 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 break; | 1034 break; |
1035 case kArm64Float64ToInt32: | 1035 case kArm64Float64ToInt32: |
1036 __ Fcvtzs(i.OutputRegister32(), i.InputDoubleRegister(0)); | 1036 __ Fcvtzs(i.OutputRegister32(), i.InputDoubleRegister(0)); |
1037 break; | 1037 break; |
1038 case kArm64Float64ToUint32: | 1038 case kArm64Float64ToUint32: |
1039 __ Fcvtzu(i.OutputRegister32(), i.InputDoubleRegister(0)); | 1039 __ Fcvtzu(i.OutputRegister32(), i.InputDoubleRegister(0)); |
1040 break; | 1040 break; |
1041 case kArm64Float32ToInt64: | 1041 case kArm64Float32ToInt64: |
1042 __ Fcvtzs(i.OutputRegister64(), i.InputFloat32Register(0)); | 1042 __ Fcvtzs(i.OutputRegister64(), i.InputFloat32Register(0)); |
1043 if (i.OutputCount() > 1) { | 1043 if (i.OutputCount() > 1) { |
| 1044 __ Mov(i.OutputRegister(1), 1); |
| 1045 Label done; |
1044 __ Cmp(i.OutputRegister(0), 1); | 1046 __ Cmp(i.OutputRegister(0), 1); |
1045 __ Ccmp(i.OutputRegister(0), -1, VFlag, vc); | 1047 __ Ccmp(i.OutputRegister(0), -1, VFlag, vc); |
1046 __ Fccmp(i.InputFloat32Register(0), i.InputFloat32Register(0), VFlag, | 1048 __ Fccmp(i.InputFloat32Register(0), i.InputFloat32Register(0), VFlag, |
1047 vc); | 1049 vc); |
1048 __ Cset(i.OutputRegister(1), vc); | 1050 __ B(vc, &done); |
| 1051 __ Fcmp(i.InputFloat32Register(0), static_cast<float>(INT64_MIN)); |
| 1052 __ Cset(i.OutputRegister(1), eq); |
| 1053 __ Bind(&done); |
1049 } | 1054 } |
1050 break; | 1055 break; |
1051 case kArm64Float64ToInt64: | 1056 case kArm64Float64ToInt64: |
1052 __ Fcvtzs(i.OutputRegister(0), i.InputDoubleRegister(0)); | 1057 __ Fcvtzs(i.OutputRegister(0), i.InputDoubleRegister(0)); |
1053 if (i.OutputCount() > 1) { | 1058 if (i.OutputCount() > 1) { |
| 1059 __ Mov(i.OutputRegister(1), 1); |
| 1060 Label done; |
1054 __ Cmp(i.OutputRegister(0), 1); | 1061 __ Cmp(i.OutputRegister(0), 1); |
1055 __ Ccmp(i.OutputRegister(0), -1, VFlag, vc); | 1062 __ Ccmp(i.OutputRegister(0), -1, VFlag, vc); |
1056 __ Fccmp(i.InputDoubleRegister(0), i.InputDoubleRegister(0), VFlag, vc); | 1063 __ Fccmp(i.InputDoubleRegister(0), i.InputDoubleRegister(0), VFlag, vc); |
1057 __ Cset(i.OutputRegister(1), vc); | 1064 __ B(vc, &done); |
| 1065 __ Fcmp(i.InputDoubleRegister(0), static_cast<double>(INT64_MIN)); |
| 1066 __ Cset(i.OutputRegister(1), eq); |
| 1067 __ Bind(&done); |
1058 } | 1068 } |
1059 break; | 1069 break; |
1060 case kArm64Float32ToUint64: | 1070 case kArm64Float32ToUint64: |
1061 __ Fcvtzu(i.OutputRegister64(), i.InputFloat32Register(0)); | 1071 __ Fcvtzu(i.OutputRegister64(), i.InputFloat32Register(0)); |
1062 if (i.OutputCount() > 1) { | 1072 if (i.OutputCount() > 1) { |
1063 __ Fcmp(i.InputFloat32Register(0), 0.0); | 1073 __ Fcmp(i.InputFloat32Register(0), 0.0); |
1064 __ Ccmp(i.OutputRegister(0), -1, ZFlag, ge); | 1074 __ Ccmp(i.OutputRegister(0), -1, ZFlag, ge); |
1065 __ Cset(i.OutputRegister(1), ne); | 1075 __ Cset(i.OutputRegister(1), ne); |
1066 } | 1076 } |
1067 break; | 1077 break; |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1621 padding_size -= kInstructionSize; | 1631 padding_size -= kInstructionSize; |
1622 } | 1632 } |
1623 } | 1633 } |
1624 } | 1634 } |
1625 | 1635 |
1626 #undef __ | 1636 #undef __ |
1627 | 1637 |
1628 } // namespace compiler | 1638 } // namespace compiler |
1629 } // namespace internal | 1639 } // namespace internal |
1630 } // namespace v8 | 1640 } // namespace v8 |
OLD | NEW |