Received: from eggs.gnu.org ([2001:4830:134:3::10]:33348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgsTr-0000xj-If for qemu-devel@nongnu.org; Mon, 05 Sep 2016 07:54:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgsTi-0001Vc-8r for qemu-devel@nongnu.org; Mon, 05 Sep 2016 07:54:26 -0400 Received: from bes.se.axis.com ([195.60.68.10]:43715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgsTh-0001Ux-T2 for qemu-devel@nongnu.org; Mon, 05 Sep 2016 07:54:18 -0400 From: Rabin Vincent Date: Mon, 5 Sep 2016 13:54:08 +0200 Message-Id: <1473076452-19795-5-git-send-email-rabin.vincent@axis.com> In-Reply-To: <1473076452-19795-1-git-send-email-rabin.vincent@axis.com> References: <1473076452-19795-1-git-send-email-rabin.vincent@axis.com> Subject: [Qemu-devel] [PATCH 5/9] target-cris: sync CC state at load/stores. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: edgar.iglesias@gmail.com Cc: qemu-devel@nongnu.org, "Edgar E. Iglesias" , Rabin Vincent From: "Edgar E. Iglesias" Icount may choose to abort and recompile a TB at any load/store. We need to sync the CC state at these insns. Signed-off-by: Edgar E. Iglesias Signed-off-by: Rabin Vincent --- target-cris/translate.c | 9 +++++++++ target-cris/translate_v10.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/target-cris/translate.c b/target-cris/translate.c index f4a8d7d..c280e24 100644 --- a/target-cris/translate.c +++ b/target-cris/translate.c @@ -1098,6 +1098,9 @@ static void gen_load64(DisasContext *dc, TCGv_i64 dst, TCGv addr) { int mem_index = cpu_mmu_index(&dc->cpu->env, false); + /* Due to icount, we need to update the CC flags on load/stores. */ + cris_evaluate_flags(dc); + /* If we get a fault on a delayslot we must keep the jmp state in the cpu-state to be able to re-execute the jmp. */ if (dc->delayed_branch == 1) { @@ -1112,6 +1115,9 @@ static void gen_load(DisasContext *dc, TCGv dst, TCGv addr, { int mem_index = cpu_mmu_index(&dc->cpu->env, false); + /* Due to icount, we need to update the CC flags on load/stores. */ + cris_evaluate_flags(dc); + /* If we get a fault on a delayslot we must keep the jmp state in the cpu-state to be able to re-execute the jmp. */ if (dc->delayed_branch == 1) { @@ -1127,6 +1133,9 @@ static void gen_store (DisasContext *dc, TCGv addr, TCGv val, { int mem_index = cpu_mmu_index(&dc->cpu->env, false); + /* Due to icount, we need to update the CC flags on load/stores. */ + cris_evaluate_flags(dc); + /* If we get a fault on a delayslot we must keep the jmp state in the cpu-state to be able to re-execute the jmp. */ if (dc->delayed_branch == 1) { diff --git a/target-cris/translate_v10.c b/target-cris/translate_v10.c index 4707a18..a3da425 100644 --- a/target-cris/translate_v10.c +++ b/target-cris/translate_v10.c @@ -99,6 +99,9 @@ static void gen_store_v10(DisasContext *dc, TCGv addr, TCGv val, { int mem_index = cpu_mmu_index(&dc->cpu->env, false); + /* Due to icount, we need to update the CC flags on load/stores. */ + cris_evaluate_flags(dc); + /* If we get a fault on a delayslot we must keep the jmp state in the cpu-state to be able to re-execute the jmp. */ if (dc->delayed_branch == 1) { -- 2.1.4