Skip to content

Commit 2e4da65

Browse files
committed
Version 4.8.271.20 (cherry-pick)
Merged 789ad2f PPC: [turbofan] Support for CPU models lacking isel. (See nodejs/node#5089) [email protected], [email protected] BUG= Review URL: https://codereview.chromium.org/1705293002 . Cr-Commit-Position: refs/branch-heads/4.8@{#24} Cr-Branched-From: 10449d4-refs/heads/4.8.271@{#1} Cr-Branched-From: 2ebd5fc-refs/heads/master@{#31941}
1 parent d3de228 commit 2e4da65

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

include/v8-version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 4
1212
#define V8_MINOR_VERSION 8
1313
#define V8_BUILD_NUMBER 271
14-
#define V8_PATCH_LEVEL 19
14+
#define V8_PATCH_LEVEL 20
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

src/compiler/ppc/code-generator-ppc.cc

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,8 +1313,8 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr,
13131313
PPCOperandConverter i(this, instr);
13141314
Label done;
13151315
ArchOpcode op = instr->arch_opcode();
1316-
bool check_unordered = (op == kPPC_CmpDouble);
13171316
CRegister cr = cr0;
1317+
int reg_value = -1;
13181318

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

13281328
Condition cond = FlagsConditionToCondition(condition);
1329-
switch (cond) {
1330-
case eq:
1331-
case lt:
1329+
if (op == kPPC_CmpDouble) {
1330+
// check for unordered if necessary
1331+
if (cond == le) {
1332+
reg_value = 0;
13321333
__ li(reg, Operand::Zero());
1333-
__ li(kScratchReg, Operand(1));
1334-
__ isel(cond, reg, kScratchReg, reg, cr);
1335-
break;
1336-
case ne:
1337-
case ge:
1334+
__ bunordered(&done, cr);
1335+
} else if (cond == gt) {
1336+
reg_value = 1;
13381337
__ li(reg, Operand(1));
1339-
__ isel(NegateCondition(cond), reg, r0, reg, cr);
1340-
break;
1341-
case gt:
1342-
if (check_unordered) {
1343-
__ li(reg, Operand(1));
1338+
__ bunordered(&done, cr);
1339+
}
1340+
// Unnecessary for eq/lt & ne/ge since only FU bit will be set.
1341+
}
1342+
1343+
if (CpuFeatures::IsSupported(ISELECT)) {
1344+
switch (cond) {
1345+
case eq:
1346+
case lt:
1347+
case gt:
1348+
if (reg_value != 1) __ li(reg, Operand(1));
13441349
__ li(kScratchReg, Operand::Zero());
1345-
__ bunordered(&done, cr);
13461350
__ isel(cond, reg, reg, kScratchReg, cr);
1347-
} else {
1348-
__ li(reg, Operand::Zero());
1349-
__ li(kScratchReg, Operand(1));
1350-
__ isel(cond, reg, kScratchReg, reg, cr);
1351-
}
1352-
break;
1353-
case le:
1354-
if (check_unordered) {
1355-
__ li(reg, Operand::Zero());
1356-
__ li(kScratchReg, Operand(1));
1357-
__ bunordered(&done, cr);
1358-
__ isel(NegateCondition(cond), reg, r0, kScratchReg, cr);
1359-
} else {
1360-
__ li(reg, Operand(1));
1351+
break;
1352+
case ne:
1353+
case ge:
1354+
case le:
1355+
if (reg_value != 1) __ li(reg, Operand(1));
1356+
// r0 implies logical zero in this form
13611357
__ isel(NegateCondition(cond), reg, r0, reg, cr);
1362-
}
1363-
break;
1358+
break;
13641359
default:
13651360
UNREACHABLE();
13661361
break;
1362+
}
1363+
} else {
1364+
if (reg_value != 0) __ li(reg, Operand::Zero());
1365+
__ b(NegateCondition(cond), &done, cr);
1366+
__ li(reg, Operand(1));
13671367
}
13681368
__ bind(&done);
13691369
}

0 commit comments

Comments
 (0)