Smaller instruction to test negative number on ia32

BUG=
R=jkummerow@chromium.org

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

Patch from Weiliang Lin <weiliang.lin2@gmail.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16335 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent e146b6e1
......@@ -606,7 +606,7 @@ int DisassemblerIA32::D1D3C1Instruction(byte* data) {
}
ASSERT_NE(NULL, mnem);
AppendToBuffer("%s %s,", mnem, NameOfCPURegister(rm));
if (imm8 > 0) {
if (imm8 >= 0) {
AppendToBuffer("%d", imm8);
} else {
AppendToBuffer("cl");
......
......@@ -1787,8 +1787,8 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
case Token::ROR:
__ ror_cl(ToRegister(left));
if (instr->can_deopt()) {
__ test(ToRegister(left), Immediate(0x80000000));
DeoptimizeIf(not_zero, instr->environment());
__ test(ToRegister(left), ToRegister(left));
DeoptimizeIf(sign, instr->environment());
}
break;
case Token::SAR:
......@@ -1797,8 +1797,8 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
case Token::SHR:
__ shr_cl(ToRegister(left));
if (instr->can_deopt()) {
__ test(ToRegister(left), Immediate(0x80000000));
DeoptimizeIf(not_zero, instr->environment());
__ test(ToRegister(left), ToRegister(left));
DeoptimizeIf(sign, instr->environment());
}
break;
case Token::SHL:
......@@ -1814,8 +1814,8 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
switch (instr->op()) {
case Token::ROR:
if (shift_count == 0 && instr->can_deopt()) {
__ test(ToRegister(left), Immediate(0x80000000));
DeoptimizeIf(not_zero, instr->environment());
__ test(ToRegister(left), ToRegister(left));
DeoptimizeIf(sign, instr->environment());
} else {
__ ror(ToRegister(left), shift_count);
}
......@@ -1827,8 +1827,8 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
break;
case Token::SHR:
if (shift_count == 0 && instr->can_deopt()) {
__ test(ToRegister(left), Immediate(0x80000000));
DeoptimizeIf(not_zero, instr->environment());
__ test(ToRegister(left), ToRegister(left));
DeoptimizeIf(sign, instr->environment());
} else {
__ shr(ToRegister(left), shift_count);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment