Bug 1258910 - OdinMonkey: MIPS64: Implement AsmSelectI64. r=bbouvier
authorHeiher <r@hev.cc>
Thu, 24 Mar 2016 11:51:30 +0800
changeset 290180 4400a8b6aaeb9abadb250bdb49452275884540dd
parent 290179 e7d2b5f5878e2da285aa9fd6ed707eda59d7dbf4
child 290181 c617aafb0e961fb863d3a5222dbca082a6a9c3b5
push id30114
push usercbook@mozilla.com
push dateThu, 24 Mar 2016 15:15:54 +0000
treeherdermozilla-central@24c5fbde4488 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1258910
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1258910 - OdinMonkey: MIPS64: Implement AsmSelectI64. r=bbouvier --- js/src/jit/mips64/CodeGenerator-mips64.cpp | 21 +++++++++++++++++++++ js/src/jit/mips64/CodeGenerator-mips64.h | 1 + 2 files changed, 22 insertions(+)
js/src/jit/mips64/CodeGenerator-mips64.cpp
js/src/jit/mips64/CodeGenerator-mips64.h
--- a/js/src/jit/mips64/CodeGenerator-mips64.cpp
+++ b/js/src/jit/mips64/CodeGenerator-mips64.cpp
@@ -274,16 +274,37 @@ CodeGeneratorMIPS64::visitCompareBitwise
 
     MOZ_ASSERT(mir->jsop() == JSOP_EQ || mir->jsop() == JSOP_STRICTEQ ||
                mir->jsop() == JSOP_NE || mir->jsop() == JSOP_STRICTNE);
 
     emitBranch(lhs.valueReg(), rhs.valueReg(), cond, lir->ifTrue(), lir->ifFalse());
 }
 
 void
+CodeGeneratorMIPS64::visitAsmSelectI64(LAsmSelectI64* lir)
+{
+    MOZ_ASSERT(lir->mir()->type() == MIRType_Int64);
+
+    Register cond = ToRegister(lir->condExpr());
+    Operand falseExpr = ToOperand(lir->falseExpr());
+
+    Register out = ToRegister(lir->output());
+    MOZ_ASSERT(ToRegister(lir->trueExpr()) == out, "true expr is reused for input");
+
+    if (falseExpr.getTag() == Operand::REG) {
+        masm.as_movz(out, falseExpr.toReg(), cond);
+    } else {
+        Label done;
+        masm.ma_b(cond, cond, &done, Assembler::NonZero, ShortJump);
+        masm.loadPtr(falseExpr.toAddress(), out);
+        masm.bind(&done);
+    }
+}
+
+void
 CodeGeneratorMIPS64::setReturnDoubleRegs(LiveRegisterSet* regs)
 {
     MOZ_ASSERT(ReturnFloat32Reg.reg_ == FloatRegisters::f0);
     MOZ_ASSERT(ReturnDoubleReg.reg_ == FloatRegisters::f0);
     FloatRegister f1 = { FloatRegisters::f1, FloatRegisters::Single };
     regs->add(ReturnFloat32Reg);
     regs->add(f1);
     regs->add(ReturnDoubleReg);
--- a/js/src/jit/mips64/CodeGenerator-mips64.h
+++ b/js/src/jit/mips64/CodeGenerator-mips64.h
@@ -39,16 +39,17 @@ class CodeGeneratorMIPS64 : public CodeG
 
     void emitTableSwitchDispatch(MTableSwitch* mir, Register index, Register base);
 
   public:
     virtual void visitCompareB(LCompareB* lir);
     virtual void visitCompareBAndBranch(LCompareBAndBranch* lir);
     virtual void visitCompareBitwise(LCompareBitwise* lir);
     virtual void visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir);
+    virtual void visitAsmSelectI64(LAsmSelectI64* ins);
 
     // Out of line visitors.
     void visitOutOfLineBailout(OutOfLineBailout* ool);
     void visitOutOfLineTableSwitch(OutOfLineTableSwitch* ool);
   protected:
     ValueOperand ToValue(LInstruction* ins, size_t pos);
     ValueOperand ToOutValue(LInstruction* ins);
     ValueOperand ToTempValue(LInstruction* ins, size_t pos);