Revision: 17675
Author: [email protected]
Date: Wed Nov 13 02:56:30 2013 UTC
Log: MIPS: Fix usage of EmitBranch in compare-minus-zero-and-branch.
Port r17669 (132efad)
BUG=
[email protected]
Review URL: https://codereview.chromium.org/71003003
http://code.google.com/p/v8/source/detail?r=17675
Modified:
/branches/bleeding_edge/src/mips/lithium-codegen-mips.cc
/branches/bleeding_edge/src/mips/lithium-codegen-mips.h
=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Tue Nov 12
19:05:38 2013 UTC
+++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Wed Nov 13
02:56:30 2013 UTC
@@ -2036,6 +2036,16 @@
__ Branch(chunk_->GetAssemblyLabel(right_block));
}
}
+
+
+template<class InstrType>
+void LCodeGen::EmitFalseBranch(InstrType instr,
+ Condition condition,
+ Register src1,
+ const Operand& src2) {
+ int false_block = instr->FalseDestination(chunk_);
+ __ Branch(chunk_->GetAssemblyLabel(false_block), condition, src1, src2);
+}
template<class InstrType>
@@ -2314,27 +2324,26 @@
void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch*
instr) {
Representation rep = instr->hydrogen()->value()->representation();
ASSERT(!rep.IsInteger32());
- Label if_false;
Register scratch = ToRegister(instr->temp());
if (rep.IsDouble()) {
DoubleRegister value = ToDoubleRegister(instr->value());
- __ BranchF(&if_false, NULL, ne, value, kDoubleRegZero);
+ EmitFalseBranchF(instr, ne, value, kDoubleRegZero);
__ FmoveHigh(scratch, value);
__ li(at, 0x80000000);
} else {
Register value = ToRegister(instr->value());
- __ CheckMap(
- value, scratch, Heap::kHeapNumberMapRootIndex, &if_false,
DO_SMI_CHECK);
+ __ CheckMap(value,
+ scratch,
+ Heap::kHeapNumberMapRootIndex,
+ instr->FalseLabel(chunk()),
+ DO_SMI_CHECK);
__ lw(scratch, FieldMemOperand(value, HeapNumber::kExponentOffset));
- __ Branch(&if_false, ne, scratch, Operand(0x80000000));
+ EmitFalseBranch(instr, ne, scratch, Operand(0x80000000));
__ lw(scratch, FieldMemOperand(value, HeapNumber::kMantissaOffset));
__ mov(at, zero_reg);
}
EmitBranch(instr, eq, scratch, Operand(at));
-
- __ bind(&if_false);
- EmitFalseBranchF(instr, al, kDoubleRegZero, kDoubleRegZero);
}
=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.h Wed Nov 6
23:52:37 2013 UTC
+++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.h Wed Nov 13
02:56:30 2013 UTC
@@ -301,6 +301,8 @@
static Condition TokenToCondition(Token::Value op, bool is_unsigned);
void EmitGoto(int block);
+
+ // EmitBranch expects to be the last instruction of a block.
template<class InstrType>
void EmitBranch(InstrType instr,
Condition condition,
@@ -311,6 +313,11 @@
Condition condition,
FPURegister src1,
FPURegister src2);
+ template<class InstrType>
+ void EmitFalseBranch(InstrType instr,
+ Condition condition,
+ Register src1,
+ const Operand& src2);
template<class InstrType>
void EmitFalseBranchF(InstrType instr,
Condition condition,
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.