From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2McE-0005oQ-0U for qemu-devel@nongnu.org; Tue, 09 Jun 2015 12:43:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2Mc8-0004cr-WF for qemu-devel@nongnu.org; Tue, 09 Jun 2015 12:43:05 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:60992) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2Mc8-0004cX-NH for qemu-devel@nongnu.org; Tue, 09 Jun 2015 12:43:00 -0400 From: Leon Alrae Date: Tue, 9 Jun 2015 17:42:28 +0100 Message-ID: <1433868154-20384-2-git-send-email-leon.alrae@imgtec.com> In-Reply-To: <1433868154-20384-1-git-send-email-leon.alrae@imgtec.com> References: <1433868154-20384-1-git-send-email-leon.alrae@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v3 1/7] target-mips: correct MFC0 for CP0.EntryLo in MIPS64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: james.hogan@imgtec.com, aurelien@aurel32.net CP0.EntryLo bits 31:30 have to be cleared. Signed-off-by: Leon Alrae --- target-mips/translate.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target-mips/translate.c b/target-mips/translate.c index fe6bc16..668e02d 100644 --- a/target-mips/translate.c +++ b/target-mips/translate.c @@ -4964,10 +4964,10 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, int reg, int sel) tcg_gen_ld_tl(arg, cpu_env, offsetof(CPUMIPSState, CP0_EntryLo0)); #if defined(TARGET_MIPS64) if (ctx->rxi) { + /* Move RI/XI fields to bits 31:30 */ TCGv tmp = tcg_temp_new(); - tcg_gen_andi_tl(tmp, arg, (3ull << CP0EnLo_XI)); - tcg_gen_shri_tl(tmp, tmp, 32); - tcg_gen_or_tl(arg, arg, tmp); + tcg_gen_shri_tl(tmp, arg, CP0EnLo_XI); + tcg_gen_deposit_tl(arg, arg, tmp, 30, 2); tcg_temp_free(tmp); } #endif @@ -5019,10 +5019,10 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, int reg, int sel) tcg_gen_ld_tl(arg, cpu_env, offsetof(CPUMIPSState, CP0_EntryLo1)); #if defined(TARGET_MIPS64) if (ctx->rxi) { + /* Move RI/XI fields to bits 31:30 */ TCGv tmp = tcg_temp_new(); - tcg_gen_andi_tl(tmp, arg, (3ull << CP0EnLo_XI)); - tcg_gen_shri_tl(tmp, tmp, 32); - tcg_gen_or_tl(arg, arg, tmp); + tcg_gen_shri_tl(tmp, arg, CP0EnLo_XI); + tcg_gen_deposit_tl(arg, arg, tmp, 30, 2); tcg_temp_free(tmp); } #endif