From patchwork Sun Oct 22 23:28:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 737042 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1282771wrl; Sun, 22 Oct 2023 16:33:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGr3O1C0WNLNztUCAE66BJUxJXCtw/OVTRmNmWP6r6WnvAvJYhTRiab2ib7Q6N4EMl2WdF4 X-Received: by 2002:a05:620a:3b18:b0:76d:984c:9d01 with SMTP id tl24-20020a05620a3b1800b0076d984c9d01mr6945921qkn.33.1698017619520; Sun, 22 Oct 2023 16:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698017619; cv=none; d=google.com; s=arc-20160816; b=WFxZ4froQ079/kB3dcNbE+0l+Br3HZoRb2aPvzQK4+Dl4/Nqn2iGnI8Kh3wNa0Fszu v2gh0oorWYn3CvODk4QMGQrVAsAFpQVozAw8FQQNdYtKUN6g1mXkiAcs6RQIJj50IsLn fXkmkprIp5KtJgCkWz1bxl09iJk68imt5ryUb8maS7pUagw81icugpQiYzM8ZRQw5wLh nuqvru/EOrZAypD1JnRp04IDmw1+BZRehov2fD0cBVXpOCyxeKHg4qX78LcF3C/jlDUX FDzRXtj1mBVbJMZcH7KWCw4aPV1Ba+dAZwhrLFi1XIICw0NTcGFMHYhAlfGX6lxuyIvq b6MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qScZs44s00L/oLLs4eIUKTqGk+BatBxWrSAikGLStjw=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=C5JyEEU8TlOc2EYH2k1w0pBu+9y/va/d0ITdJEezL4QLEen5qGFGowIP5mMbXvobCU 08nWeydLSCW2eBb6P8021DUinBAzjhK60s0tOKbsAt2OhNfxFcbrYY4oSsGerXFz9J9Y jEZJt9eHdklMXrM1bm2GqQiUtgoDp0nJm0QreWivdVgLB/3F23OPxyks+DupnrEDbql0 M4ywK77pfRxZ5r7mAOJgMbfMYES7rdXIzin/RE+TlPhlG29vKoPtDkFNrT+tbPk59vZm nZmjkiAWhvxLK6Y7t0x1uSC+6oF0QKzzgpumGz2rYjKQz9kLo+q4SOdF0UyvnwouTLa1 +bww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TbeSocEq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bk12-20020a05620a1a0c00b0076cc34b44c1si4856777qkb.292.2023.10.22.16.33.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Oct 2023 16:33:39 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TbeSocEq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quhtU-0007DY-Tl; Sun, 22 Oct 2023 19:30:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1quhtT-0007CO-6U for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:30:03 -0400 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quhtR-0006oi-ES for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:30:02 -0400 Received: by mail-oi1-x235.google.com with SMTP id 5614622812f47-3b2ec9a79bdso2107843b6e.3 for ; Sun, 22 Oct 2023 16:30:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698017400; x=1698622200; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qScZs44s00L/oLLs4eIUKTqGk+BatBxWrSAikGLStjw=; b=TbeSocEqVMhXk0MKZKCeVG3BzYW6xc4JrHA/fKb/IOPRHgmiChTyQEcfhpsgttidGQ Q80x/3MBdU8ZBL04+7+NVLQxsUzfD2uknjbq4vBGIfye5ryiNyP3QNnybHS13fOyTuPW KOL+axEVyyGP8zKi9WlbkcC+Yk0V8YR+nXG2eY4kQeWeqbqhKD6n07VqRGf1LgLQ6Bf2 UaWPaYDwjyIZXD5UPyXhVMVJptsH3/xqtAu8Hg8lG48QyN3Ip/wnXe7lYURyFWmG8ZEt 13E2BdGimOikSs6UXcbchWpSd0lZTWoh3iw+BAertljHNvByXsYL2sYAsP4gAuCOHGw6 Nqeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698017400; x=1698622200; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qScZs44s00L/oLLs4eIUKTqGk+BatBxWrSAikGLStjw=; b=GhcDfvy29smjbG4RyF3LzlFUz7buIBDhyz03xagbRuBgIbiop09Dq2k22oy4zmK+ip CZy44smThwJ2peG18QB4XVFQNNai/ASIvPs5261UCi8A+/Pt5CZXFmdxL5NP9XvIsqIs iFzPwAWehbEs1SYmTJh+6Z4kB+K2hqVsZk/hJAFVFWg2TmaQOYtSsRE6f5RAhqJDEj0r PlBPvhZtI8vrSDrYyi1sFx+SPrwd7GF7SOYHKG3YY9qmp3ebzL/vePzFUsCNEl+quHFO rIl0uzSlJg/mHyx/QZ1rwfwtaLgyBs7iF4HmbAtmLXMb7ZCxhFQYyWy9F0VoXbhk+VFR /xnQ== X-Gm-Message-State: AOJu0Yxq2cRvppUzDqBBlblZihGJQJYeKCuZiDOX7yWkAZoAJjYnV5Yn 9c+q8qMWV5Cz1K1Ppjzsthhyw4qbWrou89YJM3Q= X-Received: by 2002:a05:6808:190d:b0:3af:71cf:2b52 with SMTP id bf13-20020a056808190d00b003af71cf2b52mr10682853oib.27.1698017400248; Sun, 22 Oct 2023 16:30:00 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k26-20020a63ba1a000000b005b25a04cf8bsm4023772pgf.12.2023.10.22.16.29.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 16:29:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v5 30/94] target/sparc: Remove cpu_wim Date: Sun, 22 Oct 2023 16:28:28 -0700 Message-Id: <20231022232932.80507-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231022232932.80507-1-richard.henderson@linaro.org> References: <20231022232932.80507-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::235; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x235.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Use direct loads and stores to env instead. Signed-off-by: Richard Henderson --- target/sparc/translate.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index d87c08c18c..096cbb869f 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -84,9 +84,7 @@ static TCGv_i32 cpu_xcc, 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; -# define cpu_wim ({ qemu_build_not_reached(); (TCGv)NULL; }) #else -static TCGv cpu_wim; # define cpu_fprs ({ qemu_build_not_reached(); (TCGv)NULL; }) # define cpu_gsr ({ qemu_build_not_reached(); (TCGv)NULL; }) # define cpu_hintp ({ qemu_build_not_reached(); (TCGv)NULL; }) @@ -103,8 +101,10 @@ static TCGv_i64 cpu_fpr[TARGET_DPREGS]; #define env_field_offsetof(X) offsetof(CPUSPARCState, X) #ifdef TARGET_SPARC64 +# define env32_field_offsetof(X) ({ qemu_build_not_reached(); 0; }) # define env64_field_offsetof(X) env_field_offsetof(X) #else +# define env32_field_offsetof(X) env_field_offsetof(X) # define env64_field_offsetof(X) ({ qemu_build_not_reached(); 0; }) #endif @@ -3414,7 +3414,8 @@ TRANS(RDHPR_hstick_cmpr, HYPV, do_rd_special, hypervisor(dc), a->rd, static TCGv do_rdwim(DisasContext *dc, TCGv dst) { - return cpu_wim; + tcg_gen_ld_tl(dst, tcg_env, env32_field_offsetof(wim)); + return dst; } TRANS(RDWIM, 32, do_rd_special, supervisor(dc), a->rd, do_rdwim) @@ -3767,7 +3768,10 @@ TRANS(WRPSR, 32, do_wr_special, a, supervisor(dc), do_wrpsr) static void do_wrwim(DisasContext *dc, TCGv src) { target_ulong mask = MAKE_64BIT_MASK(0, dc->def->nwindows); - tcg_gen_andi_tl(cpu_wim, src, mask); + TCGv tmp = tcg_temp_new(); + + tcg_gen_andi_tl(tmp, src, mask); + tcg_gen_st_tl(tmp, tcg_env, env32_field_offsetof(wim)); } TRANS(WRWIM, 32, do_wr_special, a, supervisor(dc), do_wrwim) @@ -5939,8 +5943,6 @@ void sparc_tcg_init(void) #ifdef TARGET_SPARC64 { &cpu_xcc, offsetof(CPUSPARCState, xcc), "xcc" }, { &cpu_fprs, offsetof(CPUSPARCState, fprs), "fprs" }, -#else - { &cpu_wim, offsetof(CPUSPARCState, wim), "wim" }, #endif { &cpu_cc_op, offsetof(CPUSPARCState, cc_op), "cc_op" }, { &cpu_psr, offsetof(CPUSPARCState, psr), "psr" },