Chromium Code Reviews| 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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
| 9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
| 10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
| (...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 968 case kArchPrepareCallCFunction: { | 968 case kArchPrepareCallCFunction: { |
| 969 int const num_parameters = MiscField::decode(instr->opcode()); | 969 int const num_parameters = MiscField::decode(instr->opcode()); |
| 970 __ PrepareCallCFunction(num_parameters, kScratchReg); | 970 __ PrepareCallCFunction(num_parameters, kScratchReg); |
| 971 // Frame alignment requires using FP-relative frame addressing. | 971 // Frame alignment requires using FP-relative frame addressing. |
| 972 frame_access_state()->SetFrameAccessToFP(); | 972 frame_access_state()->SetFrameAccessToFP(); |
| 973 break; | 973 break; |
| 974 } | 974 } |
| 975 case kArchPrepareTailCall: | 975 case kArchPrepareTailCall: |
| 976 AssemblePrepareTailCall(); | 976 AssemblePrepareTailCall(); |
| 977 break; | 977 break; |
| 978 case kArchComment: { | |
| 979 Address comment_string = i.InputExternalReference(0).address(); | |
| 980 __ RecordComment(reinterpret_cast<const char*>(comment_string)); | |
| 981 break; | |
| 982 } | |
| 978 case kArchCallCFunction: { | 983 case kArchCallCFunction: { |
| 979 int const num_parameters = MiscField::decode(instr->opcode()); | 984 int const num_parameters = MiscField::decode(instr->opcode()); |
| 980 if (instr->InputAt(0)->IsImmediate()) { | 985 if (instr->InputAt(0)->IsImmediate()) { |
| 981 ExternalReference ref = i.InputExternalReference(0); | 986 ExternalReference ref = i.InputExternalReference(0); |
| 982 __ CallCFunction(ref, num_parameters); | 987 __ CallCFunction(ref, num_parameters); |
| 983 } else { | 988 } else { |
| 984 Register func = i.InputRegister(0); | 989 Register func = i.InputRegister(0); |
| 985 __ CallCFunction(func, num_parameters); | 990 __ CallCFunction(func, num_parameters); |
| 986 } | 991 } |
| 987 frame_access_state()->SetFrameAccessToDefault(); | 992 frame_access_state()->SetFrameAccessToDefault(); |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1293 case kPPC_Mul32: | 1298 case kPPC_Mul32: |
| 1294 __ mullw(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1), | 1299 __ mullw(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1), |
| 1295 LeaveOE, i.OutputRCBit()); | 1300 LeaveOE, i.OutputRCBit()); |
| 1296 break; | 1301 break; |
| 1297 #if V8_TARGET_ARCH_PPC64 | 1302 #if V8_TARGET_ARCH_PPC64 |
| 1298 case kPPC_Mul64: | 1303 case kPPC_Mul64: |
| 1299 __ mulld(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1), | 1304 __ mulld(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1), |
| 1300 LeaveOE, i.OutputRCBit()); | 1305 LeaveOE, i.OutputRCBit()); |
| 1301 break; | 1306 break; |
| 1302 #endif | 1307 #endif |
| 1308 case kPPC_Mul32WithHigh32: | |
|
john.yan
2016/07/16 03:57:48
The reason why this fails is that output reg can b
| |
| 1309 __ mullw(i.OutputRegister(0), | |
| 1310 i.InputRegister(0), i.InputRegister(1)); // low | |
| 1311 __ mulhw(i.OutputRegister(1), | |
| 1312 i.InputRegister(0), i.InputRegister(1)); // high | |
| 1313 break; | |
|
john.yan
2016/07/16 03:54:45
Try this sequence here:
+ case kPPC_Mul32WithH
| |
| 1303 case kPPC_MulHigh32: | 1314 case kPPC_MulHigh32: |
| 1304 __ mulhw(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1), | 1315 __ mulhw(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1), |
| 1305 i.OutputRCBit()); | 1316 i.OutputRCBit()); |
| 1306 break; | 1317 break; |
| 1307 case kPPC_MulHighU32: | 1318 case kPPC_MulHighU32: |
| 1308 __ mulhwu(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1), | 1319 __ mulhwu(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1), |
| 1309 i.OutputRCBit()); | 1320 i.OutputRCBit()); |
| 1310 break; | 1321 break; |
| 1311 case kPPC_MulDouble: | 1322 case kPPC_MulDouble: |
| 1312 ASSEMBLE_FLOAT_BINOP_RC(fmul, MiscField::decode(instr->opcode())); | 1323 ASSEMBLE_FLOAT_BINOP_RC(fmul, MiscField::decode(instr->opcode())); |
| (...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2344 padding_size -= v8::internal::Assembler::kInstrSize; | 2355 padding_size -= v8::internal::Assembler::kInstrSize; |
| 2345 } | 2356 } |
| 2346 } | 2357 } |
| 2347 } | 2358 } |
| 2348 | 2359 |
| 2349 #undef __ | 2360 #undef __ |
| 2350 | 2361 |
| 2351 } // namespace compiler | 2362 } // namespace compiler |
| 2352 } // namespace internal | 2363 } // namespace internal |
| 2353 } // namespace v8 | 2364 } // namespace v8 |
| OLD | NEW |