Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: src/compiler/ppc/code-generator-ppc.cc

Issue 2559433003: PPC: Split kPPC_Add into kPPC_Add[32|64] (Closed)
Patch Set: extsw outside the if/else block Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/ppc/instruction-codes-ppc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ppc/code-generator-ppc.cc
diff --git a/src/compiler/ppc/code-generator-ppc.cc b/src/compiler/ppc/code-generator-ppc.cc
index a838ede47c37aff888b2ef033aa78d0ae9cc9e8b..d7232bf3f9f558badc48aa6a98c047086b029091 100644
--- a/src/compiler/ppc/code-generator-ppc.cc
+++ b/src/compiler/ppc/code-generator-ppc.cc
@@ -263,7 +263,8 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) {
// Overflow checked for add/sub only.
switch (op) {
#if V8_TARGET_ARCH_PPC64
- case kPPC_Add:
+ case kPPC_Add32:
+ case kPPC_Add64:
case kPPC_Sub:
#endif
case kPPC_AddWithOverflow32:
@@ -276,7 +277,8 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) {
case kNotOverflow:
switch (op) {
#if V8_TARGET_ARCH_PPC64
- case kPPC_Add:
+ case kPPC_Add32:
+ case kPPC_Add64:
case kPPC_Sub:
#endif
case kPPC_AddWithOverflow32:
@@ -1322,7 +1324,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
63 - i.InputInt32(2), i.OutputRCBit());
break;
#endif
- case kPPC_Add:
+ case kPPC_Add32:
#if V8_TARGET_ARCH_PPC64
if (FlagsModeField::decode(instr->opcode()) != kFlags_none) {
ASSEMBLE_ADD_WITH_OVERFLOW();
@@ -1335,10 +1337,26 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ addi(i.OutputRegister(), i.InputRegister(0), i.InputImmediate(1));
DCHECK_EQ(LeaveRC, i.OutputRCBit());
}
+ __ extsw(i.OutputRegister(), i.OutputRegister());
#if V8_TARGET_ARCH_PPC64
}
#endif
break;
+#if V8_TARGET_ARCH_PPC64
+ case kPPC_Add64:
+ if (FlagsModeField::decode(instr->opcode()) != kFlags_none) {
+ ASSEMBLE_ADD_WITH_OVERFLOW();
+ } else {
+ if (HasRegisterInput(instr, 1)) {
+ __ add(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
+ LeaveOE, i.OutputRCBit());
+ } else {
+ __ addi(i.OutputRegister(), i.InputRegister(0), i.InputImmediate(1));
+ DCHECK_EQ(LeaveRC, i.OutputRCBit());
+ }
+ }
+ break;
+#endif
case kPPC_AddWithOverflow32:
ASSEMBLE_ADD_WITH_OVERFLOW32();
break;
« no previous file with comments | « no previous file | src/compiler/ppc/instruction-codes-ppc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698