From 09cdb5b4e81353d46631f6458be1d65e15baf9c4 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Tue, 19 Jul 2005 08:42:56 +0000 Subject: [PATCH] iselCondCode: handle literals. git-svn-id: svn://svn.valgrind.org/vex/trunk@1277 --- VEX/priv/host-amd64/isel.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/VEX/priv/host-amd64/isel.c b/VEX/priv/host-amd64/isel.c index c23185a79a..3dcf354d1e 100644 --- a/VEX/priv/host-amd64/isel.c +++ b/VEX/priv/host-amd64/isel.c @@ -1934,15 +1934,17 @@ static AMD64CondCode iselCondCode_wrk ( ISelEnv* env, IRExpr* e ) return Acc_NZ; } -//.. /* Constant 1:Bit */ -//.. if (e->tag == Iex_Const && e->Iex.Const.con->Ico.U1 == True) { -//.. HReg r; -//.. vassert(e->Iex.Const.con->tag == Ico_U1); -//.. r = newVRegI(env); -//.. addInstr(env, X86Instr_Alu32R(Xalu_MOV,X86RMI_Imm(0),r)); -//.. addInstr(env, X86Instr_Alu32R(Xalu_XOR,X86RMI_Reg(r),r)); -//.. return Xcc_Z; -//.. } + /* Constant 1:Bit */ + if (e->tag == Iex_Const) { + HReg r; + vassert(e->Iex.Const.con->tag == Ico_U1); + vassert(e->Iex.Const.con->Ico.U1 == True + || e->Iex.Const.con->Ico.U1 == False); + r = newVRegI(env); + addInstr(env, AMD64Instr_Alu64R(Aalu_MOV,AMD64RMI_Imm(0),r)); + addInstr(env, AMD64Instr_Alu64R(Aalu_XOR,AMD64RMI_Reg(r),r)); + return e->Iex.Const.con->Ico.U1 ? Acc_Z : Acc_NZ; + } /* Not1(...) */ if (e->tag == Iex_Unop && e->Iex.Unop.op == Iop_Not1) { -- 2.47.3