Received: from eggs.gnu.org ([2001:4830:134:3::10]:53237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buN41-0001KF-MM for qemu-devel@nongnu.org; Wed, 12 Oct 2016 13:11:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buN3y-0006AB-FW for qemu-devel@nongnu.org; Wed, 12 Oct 2016 13:11:33 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 12 Oct 2016 19:11:24 +0200 From: Michael Walle In-Reply-To: References: <1476289396-10780-1-git-send-email-michael@walle.cc> Message-ID: <03c84be8a07e80bfcbc6692ebdddf3df@walle.cc> Subject: Re: [Qemu-devel] [PATCH] target-lm32: fix style issue List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , QEMU Trivial , Thomas Huth Am 2016-10-12 18:35, schrieb Peter Maydell: > On 12 October 2016 at 17:23, Michael Walle wrote: >> Both branches of the ternary operator have the same expressions. Drop >> the >> operator. >> >> This fixes: https://bugs.launchpad.net/qemu/+bug/1414293 >> >> Signed-off-by: Michael Walle >> --- >> target-lm32/translate.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/target-lm32/translate.c b/target-lm32/translate.c >> index 2d8caeb..534c17c 100644 >> --- a/target-lm32/translate.c >> +++ b/target-lm32/translate.c >> @@ -343,7 +343,7 @@ static void dec_calli(DisasContext *dc) >> static inline void gen_compare(DisasContext *dc, int cond) >> { >> int rX = (dc->format == OP_FMT_RR) ? dc->r2 : dc->r1; >> - int rY = (dc->format == OP_FMT_RR) ? dc->r0 : dc->r0; >> + int rY = dc->r0; >> int rZ = (dc->format == OP_FMT_RR) ? dc->r1 : -1; >> int i; > > This checks against the processor reference manual, so: > > Reviewed-by: Peter Maydell > > but I noticed while doing the review that our LOG_DIS > is wrong for the compare-immediates: > > LOG_DIS("cmpei r%d, r%d, %d\n", dc->r0, dc->r1, > sign_extend(dc->imm16, 16)); > > but the processor reference manual says cmpei's mnemonic > should have dc->r1 first and dc->r0 second. Hi Peter, can I drop the DISAS_LM32 macro and just always enable the qemu_log_mask(CPU_LOG_TB_IN_ASM)? Looking at other CPUs this is sometimes a (debug) compile switch (eg ppc) and sometimes its always enabled (tilegx). -michael