From patchwork Tue Aug 25 20:58:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 248280 Delivered-To: patch@linaro.org Received: by 2002:a17:906:6447:0:0:0:0 with SMTP id l7csp3481ejn; Tue, 25 Aug 2020 14:11:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhPVlh+NNOGB5UYkvR8zBjEaB2cdjv0AkSb4B1SRLpZwkN4AkHZ0PAijFiDk/jvCxjlTzW X-Received: by 2002:a67:e28c:: with SMTP id g12mr6773488vsf.31.1598389904805; Tue, 25 Aug 2020 14:11:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598389904; cv=none; d=google.com; s=arc-20160816; b=tA7kc6GTJoJHKVBYF/CDhGDUnNuuPcjheb3mBvMdmojFdN0iN5L9e3Ber7YKwfIo4e ewXUNrAKpWwep/uXUM7CA3sz6fsJTYU3zdn/62ANjFgZdlQtzyCs40FssYzaKeOluCLu Gwhf6zhIOdkRYpw/8tDaS1UDqbGDjZ86jhl/fpT1Vi+1MJMdXxTRI0mH2GBfgqPJlgrT G+NVXdktVYyG50apjfKBTBwhmD/vJ7mFXFtzBkUt+xuGZiqKIRQI7OcU/oxxIHVLAkXX Ne9s6RueEQbZEnWLGyX5hPVyyjhy1/IC2DZQ55Tm+x+s/6ju5Xuw150X0pATaACKs4xD fllA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=HaAnpocjYbBqDikM80fgZOEo5h0cDqsU8in/f2nqeSk=; b=P+U1EBDI2jracVaLrSx02R+g4SBxV0cFnN83djLOKydmxysBk7IbxMCPg9UBHCqarv se6ei3O0/LgTDCBcjvhkJRLCGZUfoG9pll/de5aYBkWA2L2dL8bL7nIUw7zC2gXkAOT8 PkA8E5bLzr3+duCTVbT6XwJGUKxYUvF6HyW05kRQ4xRO3KukmgNsEePm5Yeleah0k+SV lmOX83mnQ53l8GmzJIVnQOIFuxKmxZFLdX3qrlCY2RbpQETKT95LQGOC5C06VpR5rsqU be/ucQatbh4CDMIaf32jdiIqIkCkCyt1eWksZ73DJDDHCr1BHAmOoCAfU3Z5idOfOvmv VYiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k9kjF86s; 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 65si25855vsw.192.2020.08.25.14.11.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Aug 2020 14:11:44 -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=k9kjF86s; 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]:54498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAgEK-0007XX-4o for patch@linaro.org; Tue, 25 Aug 2020 17:11:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAg3I-0007VH-F4 for qemu-devel@nongnu.org; Tue, 25 Aug 2020 17:00:20 -0400 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]:36389) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAg3G-0001hs-Fo for qemu-devel@nongnu.org; Tue, 25 Aug 2020 17:00:20 -0400 Received: by mail-pj1-x1042.google.com with SMTP id q1so127248pjd.1 for ; Tue, 25 Aug 2020 14:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HaAnpocjYbBqDikM80fgZOEo5h0cDqsU8in/f2nqeSk=; b=k9kjF86s31Ab6Xxn5y1ioVUgfUNO5Z9DQhb3bZ6qS/8aB+TXe5RxE228zFX0joYqry jCpmGE/9BGjfUK8/lMe6cbl6DSHt7tW7Ba/y+7Whcnc8X9kQQJtIwwb9N+5whq94TFp1 9okqSRW8nDo8nwAxwMfj/Y3n2RDxQ+E/6wkeA7hvsAAzcqf8uoXKFLCc6bSI06gX722u mO43Pe+X5aVDiGA8a9oc1212zKtcNTE7Ihfg0v9yAtJhn+Ajt+3FFa3Kos0xoE8gwtNU b7sDdPATD63oLz5ONAvHmqYvZa16II4x50z10FVjg0NxDIpAxe90jXM8twXtIqUu5J0f gXzg== 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:mime-version:content-transfer-encoding; bh=HaAnpocjYbBqDikM80fgZOEo5h0cDqsU8in/f2nqeSk=; b=c+fvWZ2c8jAb+hbxtQpc7MgCoCXIB7FCO1LWZDYrTKLqM/uZCLOGRvicgA+N2n08cV 6w2FUjjnJpLoGgL+Z30pNj55EkydPElfqm/NSxpr5liBA9LPIVY8InX1ZzntmAHtFc8o 4Q2dlK+wIn2HJWDFj26hnwDZeVsG6yaeFzC8sZpuDOJwoLzecxuTk2ulUlZsGF6iTlRb V4s42l11XA5r1IMILo1H32Fb+0YKUIYgPzgYu+/lOFkSec0CUA/M3uqZhGO7sfkTq8bF EDReEnf5Ldl0P6Tc0gqnhrftwj71Z2T/hwzCsLLyFZ2hEhCM2yQWU8v4wdiCS/LA/C3M Izhg== X-Gm-Message-State: AOAM5303uNH6CQZKEc9XKcvRAjASYSogvf3Ay3vA8m6dpNxPV6VIA0Tl kyhnfh5z8vJs8le0m62hTk8qD4y+2EeIEg== X-Received: by 2002:a17:90b:1895:: with SMTP id mn21mr3146401pjb.173.1598389216498; Tue, 25 Aug 2020 14:00:16 -0700 (PDT) Received: from localhost.localdomain (h216-228-167-147.bendor.dedicated.static.tds.net. [216.228.167.147]) by smtp.gmail.com with ESMTPSA id k4sm16074pgr.87.2020.08.25.14.00.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2020 14:00:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 19/77] target/microblaze: Remove cpu_ear Date: Tue, 25 Aug 2020 13:58:52 -0700 Message-Id: <20200825205950.730499-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200825205950.730499-1-richard.henderson@linaro.org> References: <20200825205950.730499-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1042; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1042.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Since cpu_ear is only used during MSR and MTR instructions, we can just as easily use an explicit load and store, so eliminate the variable. Signed-off-by: Richard Henderson --- target/microblaze/translate.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index a862ac4055..f5ca25cead 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -57,7 +57,6 @@ static TCGv_i32 env_debug; static TCGv_i32 cpu_R[32]; static TCGv_i32 cpu_pc; static TCGv_i32 cpu_msr; -static TCGv_i64 cpu_ear; static TCGv_i32 cpu_esr; static TCGv_i32 env_imm; static TCGv_i32 env_btaken; @@ -533,7 +532,12 @@ static void dec_msr(DisasContext *dc) msr_write(dc, cpu_R[dc->ra]); break; case SR_EAR: - tcg_gen_extu_i32_i64(cpu_ear, cpu_R[dc->ra]); + { + TCGv_i64 t64 = tcg_temp_new_i64(); + tcg_gen_extu_i32_i64(t64, cpu_R[dc->ra]); + tcg_gen_st_i64(t64, cpu_env, offsetof(CPUMBState, ear)); + tcg_temp_free_i64(t64); + } break; case SR_ESR: tcg_gen_mov_i32(cpu_esr, cpu_R[dc->ra]); @@ -573,10 +577,15 @@ static void dec_msr(DisasContext *dc) msr_read(dc, cpu_R[dc->rd]); break; case SR_EAR: - if (extended) { - tcg_gen_extrh_i64_i32(cpu_R[dc->rd], cpu_ear); - } else { - tcg_gen_extrl_i64_i32(cpu_R[dc->rd], cpu_ear); + { + TCGv_i64 t64 = tcg_temp_new_i64(); + tcg_gen_ld_i64(t64, cpu_env, offsetof(CPUMBState, ear)); + if (extended) { + tcg_gen_extrh_i64_i32(cpu_R[dc->rd], t64); + } else { + tcg_gen_extrl_i64_i32(cpu_R[dc->rd], t64); + } + tcg_temp_free_i64(t64); } break; case SR_ESR: @@ -1865,8 +1874,6 @@ void mb_tcg_init(void) tcg_global_mem_new_i32(cpu_env, offsetof(CPUMBState, pc), "rpc"); cpu_msr = tcg_global_mem_new_i32(cpu_env, offsetof(CPUMBState, msr), "rmsr"); - cpu_ear = - tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, ear), "rear"); cpu_esr = tcg_global_mem_new_i32(cpu_env, offsetof(CPUMBState, esr), "resr"); }