From 1778e15d3419b14d7c41d199a6e771d3c7a9c192 Mon Sep 17 00:00:00 2001 From: Heiher Date: Mon, 10 Oct 2016 17:08:02 +0800 Subject: [PATCH] Bug 1290812 - Part 11: Implement the 64bit variant of ExtendInt32toInt64 on mips64. r=h4writer --- js/src/jit/mips-shared/Lowering-mips-shared.cpp | 2 +- js/src/jit/mips64/CodeGenerator-mips64.cpp | 12 ++++++++++++ js/src/jit/mips64/CodeGenerator-mips64.h | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) --- js/src/jit/mips-shared/Lowering-mips-shared.cpp | 2 +- js/src/jit/mips64/CodeGenerator-mips64.cpp | 12 ++++++++++++ js/src/jit/mips64/CodeGenerator-mips64.h | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/js/src/jit/mips-shared/Lowering-mips-shared.cpp b/js/src/jit/mips-shared/Lowering-mips-shared.cpp index bd9e8272a612..331e88818ee8 100644 --- a/js/src/jit/mips-shared/Lowering-mips-shared.cpp +++ b/js/src/jit/mips-shared/Lowering-mips-shared.cpp @@ -678,5 +678,5 @@ LIRGeneratorMIPSShared::visitCopySign(MCopySign* ins) void LIRGeneratorMIPSShared::visitExtendInt32ToInt64(MExtendInt32ToInt64* ins) { - MOZ_CRASH("NYI"); + defineInt64(new(alloc()) LExtendInt32ToInt64(useRegisterAtStart(ins->input())), ins); } diff --git a/js/src/jit/mips64/CodeGenerator-mips64.cpp b/js/src/jit/mips64/CodeGenerator-mips64.cpp index f613f4c42021..db12cc834b9b 100644 --- a/js/src/jit/mips64/CodeGenerator-mips64.cpp +++ b/js/src/jit/mips64/CodeGenerator-mips64.cpp @@ -476,6 +476,18 @@ CodeGeneratorMIPS64::visitAsmReinterpretToI64(LAsmReinterpretToI64* lir) masm.as_dmfc1(ToRegister(lir->output()), ToFloatRegister(lir->input())); } +void +CodeGeneratorMIPS64::visitExtendInt32ToInt64(LExtendInt32ToInt64* lir) +{ + const LAllocation* input = lir->getOperand(0); + Register output = ToRegister(lir->output()); + + if (lir->mir()->isUnsigned()) + masm.ma_dext(output, ToRegister(input), Imm32(0), Imm32(32)); + else + masm.ma_sll(output, ToRegister(input), Imm32(0)); +} + void CodeGeneratorMIPS64::setReturnDoubleRegs(LiveRegisterSet* regs) { diff --git a/js/src/jit/mips64/CodeGenerator-mips64.h b/js/src/jit/mips64/CodeGenerator-mips64.h index 8c34607380ff..515bdfaab883 100644 --- a/js/src/jit/mips64/CodeGenerator-mips64.h +++ b/js/src/jit/mips64/CodeGenerator-mips64.h @@ -52,6 +52,7 @@ class CodeGeneratorMIPS64 : public CodeGeneratorMIPSShared void visitAsmSelectI64(LAsmSelectI64* ins); void visitAsmReinterpretFromI64(LAsmReinterpretFromI64* lir); void visitAsmReinterpretToI64(LAsmReinterpretToI64* lir); + void visitExtendInt32ToInt64(LExtendInt32ToInt64* lir); // Out of line visitors. void visitOutOfLineBailout(OutOfLineBailout* ool);