From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbGlY-0002Q5-Ot for qemu-devel@nongnu.org; Tue, 29 Oct 2013 17:24:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbGlS-0000pc-F9 for qemu-devel@nongnu.org; Tue, 29 Oct 2013 17:23:56 -0400 Received: from www11.your-server.de ([213.133.104.11]:44139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbGlS-0000pV-7v for qemu-devel@nongnu.org; Tue, 29 Oct 2013 17:23:50 -0400 Message-ID: <52702762.3030905@macke.de> Date: Tue, 29 Oct 2013 14:23:46 -0700 From: Sebastian Macke MIME-Version: 1.0 References: <1383073495-5332-1-git-send-email-sebastian@macke.de> <1383073495-5332-8-git-send-email-sebastian@macke.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 07/13] target-openrisc: Correct l.cmov conditional check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Filippov Cc: openrisc@lists.openrisc.net, openrisc@lists.opencores.org, qemu-devel , Ethan Hunt On 29/10/2013 2:15 PM, Max Filippov wrote: > On Tue, Oct 29, 2013 at 11:04 PM, Sebastian Macke wrote: >> srf is a boolean variable. >> Therefore the instruction should check for != 0 and not for != SR_F >> >> Signed-off-by: Sebastian Macke >> --- >> target-openrisc/translate.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/target-openrisc/translate.c b/target-openrisc/translate.c >> index 378ff1b..9fd1126 100644 >> --- a/target-openrisc/translate.c >> +++ b/target-openrisc/translate.c >> @@ -565,7 +565,7 @@ static void dec_calc(DisasContext *dc, uint32_t insn) >> int lab = gen_new_label(); >> TCGv res = tcg_temp_local_new(); >> tcg_gen_mov_tl(res, cpu_R[rb]); >> - tcg_gen_brcondi_tl(TCG_COND_NE, cpu_srf, SR_F, lab); >> + tcg_gen_brcondi_tl(TCG_COND_NE, cpu_srf, 0, lab); >> tcg_gen_mov_tl(res, cpu_R[ra]); >> gen_set_label(lab); >> tcg_gen_mov_tl(cpu_R[rd], res); > Looks like this implementation may be rewritten as > > TCGv zero = tcg_const_tl(0); > tcg_gen_movcond_tl(cpu_R[rd], cpu_srf, zero, cpu_R[ra], cpu_R[rb], TCG_COND_EQ); > tcg_temp_free(zero); > You are right. I will change that.