Skip to content

Commit

Permalink
Version 4.8.271.20 (cherry-pick)
Browse files Browse the repository at this point in the history
Merged 789ad2f

PPC: [turbofan] Support for CPU models lacking isel.
(See nodejs/node#5089)

R=hablich@chromium.org, adamk@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1705293002 .

Cr-Commit-Position: refs/branch-heads/4.8@{crosswalk-project#24}
Cr-Branched-From: 10449d4-refs/heads/4.8.271@{#1}
Cr-Branched-From: 2ebd5fc-refs/heads/master@{#31941}
  • Loading branch information
mtbrandy committed Feb 17, 2016
1 parent d3de228 commit 2e4da65
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 4
#define V8_MINOR_VERSION 8
#define V8_BUILD_NUMBER 271
#define V8_PATCH_LEVEL 19
#define V8_PATCH_LEVEL 20

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
62 changes: 31 additions & 31 deletions src/compiler/ppc/code-generator-ppc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1313,8 +1313,8 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr,
PPCOperandConverter i(this, instr);
Label done;
ArchOpcode op = instr->arch_opcode();
bool check_unordered = (op == kPPC_CmpDouble);
CRegister cr = cr0;
int reg_value = -1;

// Overflow checked for add/sub only.
DCHECK((condition != kOverflow && condition != kNotOverflow) ||
Expand All @@ -1326,44 +1326,44 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr,
Register reg = i.OutputRegister(instr->OutputCount() - 1);

Condition cond = FlagsConditionToCondition(condition);
switch (cond) {
case eq:
case lt:
if (op == kPPC_CmpDouble) {
// check for unordered if necessary
if (cond == le) {
reg_value = 0;
__ li(reg, Operand::Zero());
__ li(kScratchReg, Operand(1));
__ isel(cond, reg, kScratchReg, reg, cr);
break;
case ne:
case ge:
__ bunordered(&done, cr);
} else if (cond == gt) {
reg_value = 1;
__ li(reg, Operand(1));
__ isel(NegateCondition(cond), reg, r0, reg, cr);
break;
case gt:
if (check_unordered) {
__ li(reg, Operand(1));
__ bunordered(&done, cr);
}
// Unnecessary for eq/lt & ne/ge since only FU bit will be set.
}

if (CpuFeatures::IsSupported(ISELECT)) {
switch (cond) {
case eq:
case lt:
case gt:
if (reg_value != 1) __ li(reg, Operand(1));
__ li(kScratchReg, Operand::Zero());
__ bunordered(&done, cr);
__ isel(cond, reg, reg, kScratchReg, cr);
} else {
__ li(reg, Operand::Zero());
__ li(kScratchReg, Operand(1));
__ isel(cond, reg, kScratchReg, reg, cr);
}
break;
case le:
if (check_unordered) {
__ li(reg, Operand::Zero());
__ li(kScratchReg, Operand(1));
__ bunordered(&done, cr);
__ isel(NegateCondition(cond), reg, r0, kScratchReg, cr);
} else {
__ li(reg, Operand(1));
break;
case ne:
case ge:
case le:
if (reg_value != 1) __ li(reg, Operand(1));
// r0 implies logical zero in this form
__ isel(NegateCondition(cond), reg, r0, reg, cr);
}
break;
break;
default:
UNREACHABLE();
break;
}
} else {
if (reg_value != 0) __ li(reg, Operand::Zero());
__ b(NegateCondition(cond), &done, cr);
__ li(reg, Operand(1));
}
__ bind(&done);
}
Expand Down

0 comments on commit 2e4da65

Please sign in to comment.