Received: from eggs.gnu.org ([2001:4830:134:3::10]:56902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buS7h-0002cz-9I for qemu-devel@nongnu.org; Wed, 12 Oct 2016 18:35:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buS7f-0002d7-4c for qemu-devel@nongnu.org; Wed, 12 Oct 2016 18:35:40 -0400 From: Michael Walle Date: Thu, 13 Oct 2016 00:35:08 +0200 Message-Id: <1476311708-14792-4-git-send-email-michael@walle.cc> In-Reply-To: <1476311708-14792-1-git-send-email-michael@walle.cc> References: <1476311708-14792-1-git-send-email-michael@walle.cc> Subject: [Qemu-devel] [PATCH 4/4] target-lm32: rewrite gen_compare() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Peter Maydell , Michael Walle Drop the rX, rY and rZ stuff and use dc->r{0,1,2} directly. This should also fix the false positive in coverity CID 1005720. Signed-off-by: Michael Walle --- target-lm32/translate.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/target-lm32/translate.c b/target-lm32/translate.c index 792637f..842af63 100644 --- a/target-lm32/translate.c +++ b/target-lm32/translate.c @@ -344,9 +344,6 @@ 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->r0; - int rZ = (dc->format == OP_FMT_RR) ? dc->r1 : -1; int i; if (dc->format == OP_FMT_RI) { @@ -360,9 +357,9 @@ static inline void gen_compare(DisasContext *dc, int cond) break; } - tcg_gen_setcondi_tl(cond, cpu_R[rX], cpu_R[rY], i); + tcg_gen_setcondi_tl(cond, cpu_R[dc->r1], cpu_R[dc->r0], i); } else { - tcg_gen_setcond_tl(cond, cpu_R[rX], cpu_R[rY], cpu_R[rZ]); + tcg_gen_setcond_tl(cond, cpu_R[dc->r2], cpu_R[dc->r0], cpu_R[dc->r1]); } } -- 2.1.4