From: Julian Seward Date: Wed, 6 Apr 2005 01:11:53 +0000 (+0000) Subject: iselIntExpr64(const): save a precious register in the case where X-Git-Tag: svn/VALGRIND_3_0_1^2~212 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8252b45f304f8f8e819f5d7d9c22bce84e2ea06f;p=thirdparty%2Fvalgrind.git iselIntExpr64(const): save a precious register in the case where the two halves have the same value. git-svn-id: svn://svn.valgrind.org/vex/trunk@1122 --- diff --git a/VEX/priv/host-x86/isel.c b/VEX/priv/host-x86/isel.c index 105f639c18..37bf943ed9 100644 --- a/VEX/priv/host-x86/isel.c +++ b/VEX/priv/host-x86/isel.c @@ -1691,10 +1691,17 @@ static void iselInt64Expr_wrk ( HReg* rHi, HReg* rLo, ISelEnv* env, IRExpr* e ) HReg tLo = newVRegI(env); HReg tHi = newVRegI(env); vassert(e->Iex.Const.con->tag == Ico_U64); - addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Imm(wHi), tHi)); - addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Imm(wLo), tLo)); - *rHi = tHi; - *rLo = tLo; + if (wLo == wHi) { + /* Save a precious Int register in this special case. */ + addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Imm(wLo), tLo)); + *rHi = tLo; + *rLo = tLo; + } else { + addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Imm(wHi), tHi)); + addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Imm(wLo), tLo)); + *rHi = tHi; + *rLo = tLo; + } return; }