Revert of [x64] Generate test reg,reg instead of cmp reg,0. (patchset #2 id:20001 of https://codereview.chromium.org/916543004/)

Reason for revert:
Tanks some benchmarks (for no obvious reason)

Original issue's description:
> [x64] Generate test reg,reg instead of cmp reg,0.
>
> The instruction sequence is shorter and saves decoding bandwidth.
>
> R=svenpanne@chromium.org
>
> Committed: https://crrev.com/a7fb5ed400701b22c455d0ad410bc98b211e5730
> Cr-Commit-Position: refs/heads/master@{#26734}

TBR=svenpanne@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#26742}
This commit is contained in:
bmeurer 2015-02-19 02:38:24 -08:00 committed by Commit bot
parent 36ed9ca348
commit 28483ffeb3

View File

@ -210,27 +210,6 @@ class OutOfLineTruncateDoubleToI FINAL : public OutOfLineCode {
} while (0)
#define ASSEMBLE_CMP(cmp_instr, test_instr) \
do { \
if (HasImmediateInput(instr, 1)) { \
if (instr->InputAt(0)->IsRegister()) { \
if (i.InputInt32(1) == 0) { \
__ test_instr(i.InputRegister(0), i.InputRegister(0)); \
} else { \
__ cmp_instr(i.InputRegister(0), i.InputImmediate(1)); \
} \
} else { \
__ cmp_instr(i.InputOperand(0), i.InputImmediate(1)); \
} \
} else { \
if (instr->InputAt(1)->IsRegister()) { \
__ cmp_instr(i.InputRegister(0), i.InputRegister(1)); \
} else { \
__ cmp_instr(i.InputRegister(0), i.InputOperand(1)); \
} \
} \
} while (0)
#define ASSEMBLE_MULT(asm_instr) \
do { \
if (HasImmediateInput(instr, 1)) { \
@ -609,10 +588,10 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
ASSEMBLE_BINOP(andq);
break;
case kX64Cmp32:
ASSEMBLE_CMP(cmpl, testl);
ASSEMBLE_BINOP(cmpl);
break;
case kX64Cmp:
ASSEMBLE_CMP(cmpq, testq);
ASSEMBLE_BINOP(cmpq);
break;
case kX64Test32:
ASSEMBLE_BINOP(testl);