From patchwork Tue Jan 27 12:09:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 433319 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1916C1401DD for ; Tue, 27 Jan 2015 22:09:28 +1100 (AEDT) Received: from localhost ([::1]:46357 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YG41O-0007HJ-7I for incoming@patchwork.ozlabs.org; Tue, 27 Jan 2015 06:09:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YG40i-000653-H9 for qemu-devel@nongnu.org; Tue, 27 Jan 2015 06:08:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YG40d-0002WP-C0 for qemu-devel@nongnu.org; Tue, 27 Jan 2015 06:08:44 -0500 Received: from mail.uni-paderborn.de ([131.234.142.9]:41895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YG40d-0002WJ-68 for qemu-devel@nongnu.org; Tue, 27 Jan 2015 06:08:39 -0500 From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Tue, 27 Jan 2015 12:09:18 +0000 Message-Id: <1422360565-15503-3-git-send-email-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.2.2 In-Reply-To: <1422360565-15503-1-git-send-email-kbastian@mail.uni-paderborn.de> References: <1422360565-15503-1-git-send-email-kbastian@mail.uni-paderborn.de> X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.2.0.2453472, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2015.1.27.105723 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 131.234.142.9 Cc: peter.maydell@linaro.org Subject: [Qemu-devel] [PULL v2 2/9] target-tricore: Several translator and cpu model fixes X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Fix tc1796 cpu model using wrong ISA version. Fix cond_add sometimes writing back wrong result. Fix RCR_SEL and RCR_SELN using wrong registers for result and cond. Signed-off-by: Bastian Koppelmann --- target-tricore/cpu.c | 2 +- target-tricore/op_helper.c | 1 + target-tricore/translate.c | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/target-tricore/cpu.c b/target-tricore/cpu.c index abe16fa..2ba0cf4 100644 --- a/target-tricore/cpu.c +++ b/target-tricore/cpu.c @@ -118,7 +118,7 @@ static void tc1796_initfn(Object *obj) { TriCoreCPU *cpu = TRICORE_CPU(obj); - set_feature(&cpu->env, TRICORE_FEATURE_13); + set_feature(&cpu->env, TRICORE_FEATURE_131); } static void aurix_initfn(Object *obj) diff --git a/target-tricore/op_helper.c b/target-tricore/op_helper.c index 5704549..ec2a0cc 100644 --- a/target-tricore/op_helper.c +++ b/target-tricore/op_helper.c @@ -255,6 +255,7 @@ target_ulong helper_mul_suov(CPUTriCoreState *env, target_ulong r1, int64_t t1 = extract64(r1, 0, 32); int64_t t2 = extract64(r2, 0, 32); int64_t result = t1 * t2; + return suov32(env, result); } diff --git a/target-tricore/translate.c b/target-tricore/translate.c index def7f4a..61518f3 100644 --- a/target-tricore/translate.c +++ b/target-tricore/translate.c @@ -745,7 +745,7 @@ static inline void gen_cond_add(TCGCond cond, TCGv r1, TCGv r2, TCGv r3, tcg_gen_and_tl(temp, temp, mask); tcg_gen_or_tl(cpu_PSW_SAV, temp, cpu_PSW_SAV); /* write back result */ - tcg_gen_movcond_tl(cond, r3, r4, t0, result, r3); + tcg_gen_movcond_tl(cond, r3, r4, t0, result, r1); tcg_temp_free(t0); tcg_temp_free(temp); @@ -3898,7 +3898,7 @@ static void decode_rcr_cond_select(CPUTriCoreState *env, DisasContext *ctx) case OPC2_32_RCR_SEL: temp = tcg_const_i32(0); temp2 = tcg_const_i32(const9); - tcg_gen_movcond_tl(TCG_COND_NE, cpu_gpr_d[r3], cpu_gpr_d[r4], temp, + tcg_gen_movcond_tl(TCG_COND_NE, cpu_gpr_d[r4], cpu_gpr_d[r3], temp, cpu_gpr_d[r1], temp2); tcg_temp_free(temp); tcg_temp_free(temp2); @@ -3906,7 +3906,7 @@ static void decode_rcr_cond_select(CPUTriCoreState *env, DisasContext *ctx) case OPC2_32_RCR_SELN: temp = tcg_const_i32(0); temp2 = tcg_const_i32(const9); - tcg_gen_movcond_tl(TCG_COND_EQ, cpu_gpr_d[r3], cpu_gpr_d[r4], temp, + tcg_gen_movcond_tl(TCG_COND_EQ, cpu_gpr_d[r4], cpu_gpr_d[r3], temp, cpu_gpr_d[r1], temp2); tcg_temp_free(temp); tcg_temp_free(temp2);