From patchwork Tue Dec 19 05:38:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10122473 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0783360390 for ; Tue, 19 Dec 2017 05:44:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED8B829042 for ; Tue, 19 Dec 2017 05:44:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1FAB2905A; Tue, 19 Dec 2017 05:44:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 91D0029042 for ; Tue, 19 Dec 2017 05:44:38 +0000 (UTC) Received: from localhost ([::1]:50627 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRAhh-0005AP-Pq for patchwork-qemu-devel@patchwork.kernel.org; Tue, 19 Dec 2017 00:44:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRAdD-00014v-WA for qemu-devel@nongnu.org; Tue, 19 Dec 2017 00:40:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRAdD-00020M-2T for qemu-devel@nongnu.org; Tue, 19 Dec 2017 00:40:00 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:44964) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRAdC-0001zq-Re for qemu-devel@nongnu.org; Tue, 19 Dec 2017 00:39:58 -0500 Received: by mail-wr0-x242.google.com with SMTP id l41so4806487wre.11 for ; Mon, 18 Dec 2017 21:39:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Jiz6f9wXt/OwU21baq0/IcwU1mbMC245/ym4CY4Floc=; b=EB9hGz6+GCuDQKyrSC2MCIcgAhdltn6a4eqEQ4Akiy9RLLNfTIHSUQ7FubhHULUgRK btydw+fW5fx+PvAe/gq5Pcuc+WJBwLHlB8TfGSuqIMRsJ9si8ZBJg3t2sSBno4X4Cf1Y kuqjxO2uqzd4vfswA+iA0AY3S3uB1/t3nmkuUXJ+CorN1GJTm6fEI4uTrhod8x9VO2iS +iuV1yjq0aldHEGD7QD0fjBKAG9DmJ5Jba4goEzx7eu9GYEmOhrH2braEC6YHlcaX0nY vuvzraHs20jA5424Ej0exDP1CagaJ/FE6RsgA2c69ikBfnVRqj77HpvJTn0U4isoJa1n rF3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Jiz6f9wXt/OwU21baq0/IcwU1mbMC245/ym4CY4Floc=; b=jdJiPgNi1GJTmq/K5bOjko/hXyVZbufYzI8JfwkQkPDQeslfs/ztJbuLw5m6FQufdo KB/rf3E83BB3KFm5jBm0n5s2VlB/L6VUJ4iR4YFVwoE+2KsI8/Y6Uuti1Uc20myZ21VC uZy/15sdOQcqGrQTgGeYBBTR3+StKBCjfoYXA4g/R0CF2CjiT9JFWMOUC1D9A6JnYnRL BB8zlDdizGbOiykNbC1QEUliX/TUUDzbpm/PxY60g80Yapm6y8hgiMgmKm7wxOOXaM6Q vj7OXuUx85YHmKE0SZpT3TzM2G5T+p4qQfqWzKRmVURJsa6G3lMcLWWgtbDzs7MYuCIC fshg== X-Gm-Message-State: AKGB3mKN3StQymFpr3Wj16yYWC2qmE309mztcD4VC2D641tQNmknhhRL i+WTVdJGHudALLJCz6bwXzHbYA== X-Google-Smtp-Source: ACJfBouOSmDDFGnfdmBAWTuF1ilC2QnoGCjrJMs0+hiDE3Q+2EoM6zs5w+IUwJsRTiFiJ8L2UFr1NQ== X-Received: by 10.25.225.90 with SMTP id y87mr1306141lfg.106.1513661997652; Mon, 18 Dec 2017 21:39:57 -0800 (PST) Received: from octofox.net (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id f67sm673187lfb.83.2017.12.18.21.39.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Dec 2017 21:39:57 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Mon, 18 Dec 2017 21:38:47 -0800 Message-Id: <1513661932-6849-12-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1513661932-6849-1-git-send-email-jcmvbkbc@gmail.com> References: <1513661932-6849-1-git-send-email-jcmvbkbc@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PATCH v2 11/16] target/xtensa: drop DisasContext::litbase X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP It doesn't help much, always-set bit 0 of the LITBASE SR is easy to compensate with decrement of the l32r immediate argument. Signed-off-by: Max Filippov --- target/xtensa/translate.c | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 0460edf61389..fb6a4c979590 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -59,7 +59,6 @@ typedef struct DisasContext { int ring; uint32_t lbeg; uint32_t lend; - TCGv_i32 litbase; int is_jmp; int singlestep_enabled; @@ -266,21 +265,6 @@ static inline bool option_enabled(DisasContext *dc, int opt) return xtensa_option_enabled(dc->config, opt); } -static void init_litbase(DisasContext *dc) -{ - if (dc->tb->flags & XTENSA_TBFLAG_LITBASE) { - dc->litbase = tcg_temp_local_new_i32(); - tcg_gen_andi_i32(dc->litbase, cpu_SR[LITBASE], 0xfffff000); - } -} - -static void reset_litbase(DisasContext *dc) -{ - if (dc->tb->flags & XTENSA_TBFLAG_LITBASE) { - tcg_temp_free(dc->litbase); - } -} - static void init_sar_tracker(DisasContext *dc) { dc->sar_5bit = false; @@ -1094,7 +1078,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb) dc.slotbuf = xtensa_insnbuf_alloc(dc.config->isa); } - init_litbase(&dc); init_sar_tracker(&dc); if (dc.icount) { dc.next_icount = tcg_temp_local_new_i32(); @@ -1169,7 +1152,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb) dc.pc + xtensa_insn_len(env, &dc) <= next_page_start && !tcg_op_buf_full()); done: - reset_litbase(&dc); reset_sar_tracker(&dc); if (dc.icount) { tcg_temp_free(dc.next_icount); @@ -1672,12 +1654,13 @@ static void translate_l32r(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { if (gen_window_check1(dc, arg[0])) { - TCGv_i32 tmp = (dc->tb->flags & XTENSA_TBFLAG_LITBASE) ? - tcg_const_i32(dc->raw_arg[1] - 1) : - tcg_const_i32(arg[1]); + TCGv_i32 tmp; if (dc->tb->flags & XTENSA_TBFLAG_LITBASE) { - tcg_gen_add_i32(tmp, tmp, dc->litbase); + tmp = tcg_const_i32(dc->raw_arg[1] - 1); + tcg_gen_add_i32(tmp, cpu_SR[LITBASE], tmp); + } else { + tmp = tcg_const_i32(arg[1]); } tcg_gen_qemu_ld32u(cpu_R[arg[0]], tmp, dc->cring); tcg_temp_free(tmp);