Received: from eggs.gnu.org ([2001:4830:134:3::10]:41862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFn0Q-00044D-Ac for qemu-devel@nongnu.org; Mon, 26 Jan 2015 11:59:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFn0M-0003Jt-EJ for qemu-devel@nongnu.org; Mon, 26 Jan 2015 11:59:18 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:49698) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFn0M-0003JG-7G for qemu-devel@nongnu.org; Mon, 26 Jan 2015 11:59:14 -0500 From: Leon Alrae Date: Mon, 26 Jan 2015 16:58:57 +0000 Message-ID: <1422291537-7083-1-git-send-email-leon.alrae@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH] target-mips: pass 0 instead of -1 as rs in microMIPS LUI instruction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aurelien@aurel32.net Using rs = -1 in gen_logic_imm() for microMIPS LUI instruction is dangerous and may bite us when implementing microMIPS R6 because in R6 AUI and LUI are distinguished by rs value. Therefore use 0 for safety. Reported-by: Paolo Bonzini Signed-off-by: Leon Alrae --- target-mips/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-mips/translate.c b/target-mips/translate.c index 77d89be..1347451 100644 --- a/target-mips/translate.c +++ b/target-mips/translate.c @@ -13653,7 +13653,7 @@ static void decode_micromips32_opc (CPUMIPSState *env, DisasContext *ctx, target. */ break; case LUI: - gen_logic_imm(ctx, OPC_LUI, rs, -1, imm); + gen_logic_imm(ctx, OPC_LUI, rs, 0, imm); break; case SYNCI: /* Break the TB to be able to sync copied instructions -- 2.1.0