From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8Ldq-0004KQ-2w for qemu-devel@nongnu.org; Thu, 02 Jun 2016 01:58:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8Ldj-00035a-4Z for qemu-devel@nongnu.org; Thu, 02 Jun 2016 01:58:01 -0400 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:36759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8Ldj-00035B-05 for qemu-devel@nongnu.org; Thu, 02 Jun 2016 01:57:55 -0400 Received: by mail-qk0-x243.google.com with SMTP id v3so936055qki.3 for ; Wed, 01 Jun 2016 22:57:54 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Wed, 1 Jun 2016 22:56:58 -0700 Message-Id: <1464847040-22536-3-git-send-email-rth@twiddle.net> In-Reply-To: <1464847040-22536-1-git-send-email-rth@twiddle.net> References: <1464847040-22536-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH v3 02/24] target-sparc: Remove softint as a TCG global List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com The global is only ever read for one insn; we can just as well use a load from env instead and generate the same code. This also allows us to indicate the the associated helpers do not touch TCG globals. Signed-off-by: Richard Henderson --- target-sparc/helper.h | 6 +++--- target-sparc/translate.c | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/target-sparc/helper.h b/target-sparc/helper.h index 366d4d1..14712cc 100644 --- a/target-sparc/helper.h +++ b/target-sparc/helper.h @@ -21,9 +21,9 @@ DEF_HELPER_4(ldda_asi, void, env, tl, int, int) DEF_HELPER_5(ldf_asi, void, env, tl, int, int, int) DEF_HELPER_FLAGS_5(stf_asi, TCG_CALL_NO_WG, void, env, tl, int, int, int) DEF_HELPER_FLAGS_5(casx_asi, TCG_CALL_NO_WG, tl, env, tl, tl, tl, i32) -DEF_HELPER_2(set_softint, void, env, i64) -DEF_HELPER_2(clear_softint, void, env, i64) -DEF_HELPER_2(write_softint, void, env, i64) +DEF_HELPER_FLAGS_2(set_softint, TCG_CALL_NO_RWG, void, env, i64) +DEF_HELPER_FLAGS_2(clear_softint, TCG_CALL_NO_RWG, void, env, i64) +DEF_HELPER_FLAGS_2(write_softint, TCG_CALL_NO_RWG, void, env, i64) DEF_HELPER_FLAGS_2(tick_set_count, TCG_CALL_NO_RWG, void, ptr, i64) DEF_HELPER_FLAGS_3(tick_get_count, TCG_CALL_NO_WG, i64, env, ptr, int) DEF_HELPER_FLAGS_2(tick_set_limit, TCG_CALL_NO_RWG, void, ptr, i64) diff --git a/target-sparc/translate.c b/target-sparc/translate.c index 21760b9..bfeef35 100644 --- a/target-sparc/translate.c +++ b/target-sparc/translate.c @@ -57,7 +57,6 @@ static TCGv_i32 cpu_xcc, cpu_asi, cpu_fprs; static TCGv cpu_gsr; static TCGv cpu_tick_cmpr, cpu_stick_cmpr, cpu_hstick_cmpr; static TCGv cpu_hintp, cpu_htba, cpu_hver, cpu_ssr, cpu_ver; -static TCGv_i32 cpu_softint; #else static TCGv cpu_wim; #endif @@ -2754,7 +2753,8 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn) gen_store_gpr(dc, rd, cpu_gsr); break; case 0x16: /* Softint */ - tcg_gen_ext_i32_tl(cpu_dst, cpu_softint); + tcg_gen_ld32s_tl(cpu_dst, cpu_env, + offsetof(CPUSPARCState, softint)); gen_store_gpr(dc, rd, cpu_dst); break; case 0x17: /* Tick compare */ @@ -5360,7 +5360,6 @@ void gen_intermediate_code_init(CPUSPARCState *env) { &cpu_xcc, offsetof(CPUSPARCState, xcc), "xcc" }, { &cpu_asi, offsetof(CPUSPARCState, asi), "asi" }, { &cpu_fprs, offsetof(CPUSPARCState, fprs), "fprs" }, - { &cpu_softint, offsetof(CPUSPARCState, softint), "softint" }, #else { &cpu_wim, offsetof(CPUSPARCState, wim), "wim" }, #endif -- 2.5.5