Fix: Add cmpPtr(Address, Imm32) on x86/x64.(no bug, r=red-no-arm)

This commit is contained in:
Nicolas Pierron 2012-06-14 00:16:00 -07:00
parent 81d5c6440b
commit e021b7c7f8
3 changed files with 10 additions and 2 deletions

View File

@ -1832,6 +1832,7 @@ MacroAssemblerARMCompat::storePtr(const Register &src, const AbsoluteAddress &de
void
MacroAssemblerARMCompat::cmp32(const Register &lhs, const Imm32 &rhs)
{
JS_ASSERT(lhs != ScratchRegister);
ma_cmp(lhs, rhs);
}
@ -1844,6 +1845,7 @@ MacroAssemblerARMCompat::cmp32(const Register &lhs, const Register &rhs)
void
MacroAssemblerARMCompat::cmpPtr(const Register &lhs, const ImmWord &rhs)
{
JS_ASSERT(lhs != ScratchRegister);
ma_cmp(lhs, Imm32(rhs.value));
}
@ -1863,8 +1865,8 @@ MacroAssemblerARMCompat::cmpPtr(const Address &lhs, const Register &rhs)
void
MacroAssemblerARMCompat::cmpPtr(const Address &lhs, const ImmWord &rhs)
{
loadPtr(lhs, ScratchRegister);
ma_cmp(ScratchRegister, Imm32(rhs.value));
loadPtr(lhs, lr);
ma_cmp(lr, Imm32(rhs.value));
}
void

View File

@ -326,6 +326,9 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared
void cmpPtr(const Address &lhs, const ImmGCPtr rhs) {
cmpPtr(Operand(lhs), rhs);
}
void cmpPtr(const Address &lhs, const ImmWord rhs) {
cmpPtr(Operand(lhs), rhs);
}
void cmpPtr(const Operand &lhs, const Register &rhs) {
cmpq(lhs, rhs);
}

View File

@ -373,6 +373,9 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared
void cmpPtr(const Address &lhs, const Register &rhs) {
cmpl(Operand(lhs), rhs);
}
void cmpPtr(const Address &lhs, const ImmWord rhs) {
cmpl(Operand(lhs), rhs);
}
void testPtr(const Register &lhs, const Register &rhs) {
return testl(lhs, rhs);
}