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/arm/macro-assembler-arm.h" | 7 #include "src/arm/macro-assembler-arm.h" |
8 #include "src/compilation-info.h" | 8 #include "src/compilation-info.h" |
9 #include "src/compiler/code-generator-impl.h" | 9 #include "src/compiler/code-generator-impl.h" |
10 #include "src/compiler/gap-resolver.h" | 10 #include "src/compiler/gap-resolver.h" |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 // i.InputRegister(1) ... left high word. | 1077 // i.InputRegister(1) ... left high word. |
1078 // i.InputRegister(2) ... right low word. | 1078 // i.InputRegister(2) ... right low word. |
1079 // i.InputRegister(3) ... right high word. | 1079 // i.InputRegister(3) ... right high word. |
1080 __ umull(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0), | 1080 __ umull(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0), |
1081 i.InputRegister(2)); | 1081 i.InputRegister(2)); |
1082 __ mla(i.OutputRegister(1), i.InputRegister(0), i.InputRegister(3), | 1082 __ mla(i.OutputRegister(1), i.InputRegister(0), i.InputRegister(3), |
1083 i.OutputRegister(1)); | 1083 i.OutputRegister(1)); |
1084 __ mla(i.OutputRegister(1), i.InputRegister(2), i.InputRegister(1), | 1084 __ mla(i.OutputRegister(1), i.InputRegister(2), i.InputRegister(1), |
1085 i.OutputRegister(1)); | 1085 i.OutputRegister(1)); |
1086 break; | 1086 break; |
1087 case kArmLslPair: | 1087 case kArmLslPair: { |
| 1088 Register second_output = |
| 1089 instr->OutputCount() >= 2 ? i.OutputRegister(1) : i.TempRegister(0); |
1088 if (instr->InputAt(2)->IsImmediate()) { | 1090 if (instr->InputAt(2)->IsImmediate()) { |
1089 __ LslPair(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0), | 1091 __ LslPair(i.OutputRegister(0), second_output, i.InputRegister(0), |
1090 i.InputRegister(1), i.InputInt32(2)); | 1092 i.InputRegister(1), i.InputInt32(2)); |
1091 } else { | 1093 } else { |
1092 __ LslPair(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0), | 1094 __ LslPair(i.OutputRegister(0), second_output, i.InputRegister(0), |
1093 i.InputRegister(1), kScratchReg, i.InputRegister(2)); | 1095 i.InputRegister(1), kScratchReg, i.InputRegister(2)); |
1094 } | 1096 } |
1095 break; | 1097 break; |
1096 case kArmLsrPair: | 1098 } |
| 1099 case kArmLsrPair: { |
| 1100 Register second_output = |
| 1101 instr->OutputCount() >= 2 ? i.OutputRegister(1) : i.TempRegister(0); |
1097 if (instr->InputAt(2)->IsImmediate()) { | 1102 if (instr->InputAt(2)->IsImmediate()) { |
1098 __ LsrPair(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0), | 1103 __ LsrPair(i.OutputRegister(0), second_output, i.InputRegister(0), |
1099 i.InputRegister(1), i.InputInt32(2)); | 1104 i.InputRegister(1), i.InputInt32(2)); |
1100 } else { | 1105 } else { |
1101 __ LsrPair(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0), | 1106 __ LsrPair(i.OutputRegister(0), second_output, i.InputRegister(0), |
1102 i.InputRegister(1), kScratchReg, i.InputRegister(2)); | 1107 i.InputRegister(1), kScratchReg, i.InputRegister(2)); |
1103 } | 1108 } |
1104 break; | 1109 break; |
1105 case kArmAsrPair: | 1110 } |
| 1111 case kArmAsrPair: { |
| 1112 Register second_output = |
| 1113 instr->OutputCount() >= 2 ? i.OutputRegister(1) : i.TempRegister(0); |
1106 if (instr->InputAt(2)->IsImmediate()) { | 1114 if (instr->InputAt(2)->IsImmediate()) { |
1107 __ AsrPair(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0), | 1115 __ AsrPair(i.OutputRegister(0), second_output, i.InputRegister(0), |
1108 i.InputRegister(1), i.InputInt32(2)); | 1116 i.InputRegister(1), i.InputInt32(2)); |
1109 } else { | 1117 } else { |
1110 __ AsrPair(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0), | 1118 __ AsrPair(i.OutputRegister(0), second_output, i.InputRegister(0), |
1111 i.InputRegister(1), kScratchReg, i.InputRegister(2)); | 1119 i.InputRegister(1), kScratchReg, i.InputRegister(2)); |
1112 } | 1120 } |
1113 break; | 1121 break; |
| 1122 } |
1114 case kArmVcmpF32: | 1123 case kArmVcmpF32: |
1115 if (instr->InputAt(1)->IsFPRegister()) { | 1124 if (instr->InputAt(1)->IsFPRegister()) { |
1116 __ VFPCompareAndSetFlags(i.InputFloat32Register(0), | 1125 __ VFPCompareAndSetFlags(i.InputFloat32Register(0), |
1117 i.InputFloat32Register(1)); | 1126 i.InputFloat32Register(1)); |
1118 } else { | 1127 } else { |
1119 DCHECK(instr->InputAt(1)->IsImmediate()); | 1128 DCHECK(instr->InputAt(1)->IsImmediate()); |
1120 // 0.0 is the only immediate supported by vcmp instructions. | 1129 // 0.0 is the only immediate supported by vcmp instructions. |
1121 DCHECK(i.InputFloat32(1) == 0.0f); | 1130 DCHECK(i.InputFloat32(1) == 0.0f); |
1122 __ VFPCompareAndSetFlags(i.InputFloat32Register(0), i.InputFloat32(1)); | 1131 __ VFPCompareAndSetFlags(i.InputFloat32Register(0), i.InputFloat32(1)); |
1123 } | 1132 } |
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1985 padding_size -= v8::internal::Assembler::kInstrSize; | 1994 padding_size -= v8::internal::Assembler::kInstrSize; |
1986 } | 1995 } |
1987 } | 1996 } |
1988 } | 1997 } |
1989 | 1998 |
1990 #undef __ | 1999 #undef __ |
1991 | 2000 |
1992 } // namespace compiler | 2001 } // namespace compiler |
1993 } // namespace internal | 2002 } // namespace internal |
1994 } // namespace v8 | 2003 } // namespace v8 |
OLD | NEW |