From 488c1ec17f4c694bcf3adf78fba06e8e8ba80e6f Mon Sep 17 00:00:00 2001 From: Hannes Verschore Date: Fri, 29 Jul 2016 16:53:47 +0200 Subject: [PATCH] Bug 1279248 - Part 23: Implement the 64bit variant of Test on x86, r=nbp --- js/src/jit/x86/CodeGenerator-x86.cpp | 11 +++++++++++ js/src/jit/x86/CodeGenerator-x86.h | 1 + 2 files changed, 12 insertions(+) diff --git a/js/src/jit/x86/CodeGenerator-x86.cpp b/js/src/jit/x86/CodeGenerator-x86.cpp index e49ac5e6af9e..9b182ef1ba3e 100644 --- a/js/src/jit/x86/CodeGenerator-x86.cpp +++ b/js/src/jit/x86/CodeGenerator-x86.cpp @@ -1608,3 +1608,14 @@ CodeGeneratorX86::visitInt64ToFloatingPoint(LInt64ToFloatingPoint* lir) if (outputType == MIRType::Float32) masm.convertDoubleToFloat32(output, output); } + +void +CodeGeneratorX86::visitTestI64AndBranch(LTestI64AndBranch* lir) +{ + Register64 input = ToRegister64(lir->getInt64Operand(0)); + + masm.testl(input.high, input.high); + jumpToBlock(lir->ifTrue(), Assembler::NonZero); + masm.testl(input.low, input.low); + emitBranch(Assembler::NonZero, lir->ifTrue(), lir->ifFalse()); +} diff --git a/js/src/jit/x86/CodeGenerator-x86.h b/js/src/jit/x86/CodeGenerator-x86.h index e996f439b07e..4abe6ecc1201 100644 --- a/js/src/jit/x86/CodeGenerator-x86.h +++ b/js/src/jit/x86/CodeGenerator-x86.h @@ -89,6 +89,7 @@ class CodeGeneratorX86 : public CodeGeneratorX86Shared void visitNotI64(LNotI64* lir); void visitWasmTruncateToInt64(LWasmTruncateToInt64* lir); void visitInt64ToFloatingPoint(LInt64ToFloatingPoint* lir); + void visitTestI64AndBranch(LTestI64AndBranch* lir); private: void asmJSAtomicComputeAddress(Register addrTemp, Register ptrReg,