From: Julian Seward Date: Mon, 2 May 2005 16:16:15 +0000 (+0000) Subject: Minor tweakage: use testl rather than andl in three places on the X-Git-Tag: svn/VALGRIND_3_0_1^2~179 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=006e4d30b9850acc377293a3fe6b571d73c103dc;p=thirdparty%2Fvalgrind.git Minor tweakage: use testl rather than andl in three places on the basis that andl trashes the tested register whereas testl doesn't. In two out of the three cases this makes no difference since the tested register is a copy of some other register anyway, but hey. git-svn-id: svn://svn.valgrind.org/vex/trunk@1155 --- diff --git a/VEX/priv/host-x86/isel.c b/VEX/priv/host-x86/isel.c index fb676d153f..0cfe5924e4 100644 --- a/VEX/priv/host-x86/isel.c +++ b/VEX/priv/host-x86/isel.c @@ -1471,9 +1471,8 @@ static X86CondCode iselCondCode_wrk ( ISelEnv* env, IRExpr* e ) /* var */ if (e->tag == Iex_Tmp) { HReg r32 = lookupIRTemp(env, e->Iex.Tmp.tmp); - HReg dst = newVRegI(env); - addInstr(env, mk_iMOVsd_RR(r32,dst)); - addInstr(env, X86Instr_Alu32R(Xalu_AND,X86RMI_Imm(1),dst)); + /* Test32 doesn't modify r32; so this is OK. */ + addInstr(env, X86Instr_Test32(1,r32)); return Xcc_NZ; } @@ -1626,7 +1625,7 @@ static X86CondCode iselCondCode_wrk ( ISelEnv* env, IRExpr* e ) HReg r = newVRegI(env); addInstr(env, mk_iMOVsd_RR(r1,r)); addInstr(env, X86Instr_Alu32R(Xalu_XOR,rmi2,r)); - addInstr(env, X86Instr_Alu32R(Xalu_AND,X86RMI_Imm(0xFF),r)); + addInstr(env, X86Instr_Test32(0xFF,r)); switch (e->Iex.Binop.op) { case Iop_CmpEQ8: return Xcc_Z; case Iop_CmpNE8: return Xcc_NZ; @@ -1643,7 +1642,7 @@ static X86CondCode iselCondCode_wrk ( ISelEnv* env, IRExpr* e ) HReg r = newVRegI(env); addInstr(env, mk_iMOVsd_RR(r1,r)); addInstr(env, X86Instr_Alu32R(Xalu_XOR,rmi2,r)); - addInstr(env, X86Instr_Alu32R(Xalu_AND,X86RMI_Imm(0xFFFF),r)); + addInstr(env, X86Instr_Test32(0xFFFF,r)); switch (e->Iex.Binop.op) { case Iop_CmpEQ16: return Xcc_Z; case Iop_CmpNE16: return Xcc_NZ;