From 6ee2b0280eb5e1d2740a946dbb1a09361ce790eb Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Thu, 31 Jul 2008 07:53:43 -0600 Subject: [PATCH] implement compareAM --- src/x86.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/x86.cpp b/src/x86.cpp index fcfc461c91..3b6c050f40 100644 --- a/src/x86.cpp +++ b/src/x86.cpp @@ -1694,6 +1694,18 @@ compareRM(Context* c, unsigned size, Assembler::Register* a, encode(c, 0x39, a->low, b, true); } +void +compareAM(Context* c, unsigned size, Assembler::Address* a, + Assembler::Memory* b) +{ + assert(c, BytesPerWord == 8 or size == 4); + + Assembler::Register tmp(c->client->acquireTemporary()); + moveAR(c, size, a, &tmp); + compareRM(c, size, &tmp, b); + c->client->releaseTemporary(tmp.low); +} + void compareMR(Context* c, unsigned size, Assembler::Memory* a, Assembler::Register* b) @@ -1984,6 +1996,7 @@ populateTables() BinaryOperations[INDEX2(Compare, Register, Constant)] = CAST2(compareRC); BinaryOperations[INDEX2(Compare, Register, Register)] = CAST2(compareRR); BinaryOperations[INDEX2(Compare, Address, Register)] = CAST2(compareAR); + BinaryOperations[INDEX2(Compare, Address, Memory)] = CAST2(compareAM); BinaryOperations[INDEX2(Compare, Register, Memory)] = CAST2(compareRM); BinaryOperations[INDEX2(Compare, Memory, Register)] = CAST2(compareMR); BinaryOperations[INDEX2(Compare, Constant, Memory)] = CAST2(compareCM);