[masm] Implement sign text using cross-arch masm api

Use branchTest32 to implement the test for the sign bit in right
shift operations.

Change-Id: I07b3ead4d32761ee3d5f529259be5b5987b7ec5a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
Simon Hausmann 2013-02-25 10:13:46 +01:00 committed by Lars Knoll
parent be99576879
commit 5c8c2307c5
1 changed files with 2 additions and 12 deletions

View File

@ -648,24 +648,14 @@ public:
load32(addr, ScratchRegister); load32(addr, ScratchRegister);
and32(TrustedImm32(0x1f), ScratchRegister); and32(TrustedImm32(0x1f), ScratchRegister);
urshift32(ScratchRegister, reg); urshift32(ScratchRegister, reg);
#if CPU(X86) || CPU(X86_64) return branchTest32(Signed, reg, reg);
m_assembler.testl_rr(reg, reg);
return Jump(m_assembler.jCC(x86Condition(Signed)));
#else
#error "Implement me: Branch if result is negative"
#endif
} }
Jump inline_ushr32(TrustedImm32 imm, RegisterID reg) Jump inline_ushr32(TrustedImm32 imm, RegisterID reg)
{ {
imm.m_value &= 0x1f; imm.m_value &= 0x1f;
urshift32(imm, reg); urshift32(imm, reg);
#if CPU(X86) || CPU(X86_64) return branchTest32(Signed, reg, reg);
m_assembler.testl_rr(reg, reg);
return Jump(m_assembler.jCC(x86Condition(Signed)));
#else
#error "Implement me: Branch if result is negative"
#endif
} }
Jump inline_and32(Address addr, RegisterID reg) Jump inline_and32(Address addr, RegisterID reg)