From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoroZ-0007iQ-DA for qemu-devel@nongnu.org; Thu, 13 Nov 2014 05:39:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoroT-00038Z-7Y for qemu-devel@nongnu.org; Thu, 13 Nov 2014 05:39:47 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:10175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoroT-00038T-1P for qemu-devel@nongnu.org; Thu, 13 Nov 2014 05:39:41 -0500 Message-ID: <54648A6B.4070106@imgtec.com> Date: Thu, 13 Nov 2014 10:39:39 +0000 From: Leon Alrae MIME-Version: 1.0 References: <1412765732-45369-1-git-send-email-leon.alrae@imgtec.com> <1412765732-45369-15-git-send-email-leon.alrae@imgtec.com> <5463CBF6.8080106@redhat.com> In-Reply-To: <5463CBF6.8080106@redhat.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 14/21] target-mips: add AUI, LSA and PCREL instruction families List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: yongbok.kim@imgtec.com, cristian.cuna@imgtec.com, james.hogan@imgtec.com, aurelien@aurel32.net, rth@twiddle.net On 12/11/2014 21:07, Paolo Bonzini wrote: > > > On 08/10/2014 12:55, Leon Alrae wrote: >> case OPC_LUI: >> - tcg_gen_movi_tl(cpu_gpr[rt], imm << 16); >> - MIPS_DEBUG("lui %s, " TARGET_FMT_lx, regnames[rt], uimm); >> + if (rs != 0 && (ctx->insn_flags & ISA_MIPS32R6)) { >> + /* OPC_AUI */ >> + tcg_gen_addi_tl(cpu_gpr[rt], cpu_gpr[rs], imm << 16); >> + tcg_gen_ext32s_tl(cpu_gpr[rt], cpu_gpr[rt]); >> + MIPS_DEBUG("aui %s, %s, %04x", regnames[rt], regnames[rs], imm); >> + } else { >> + tcg_gen_movi_tl(cpu_gpr[rt], imm << 16); >> + MIPS_DEBUG("lui %s, " TARGET_FMT_lx, regnames[rt], uimm); >> + } >> break; > > Coverity reported a > > gen_logic_imm(ctx, OPC_LUI, rs, -1, imm); > > where the -1 probably has to become zero now. This line is from microMIPS decoder. We don't support microMIPS R6 in QEMU so I think this isn't an issue at the moment as (ctx->insn_flags & ISA_MIPS32R6) should always be false on a CPU with existing implementation of microMIPS. Nevertheless, I agree this should be 0 for safety, I'll correct it in 2.3. Thanks for pointing this out. Regards, Leon