From patchwork Mon Aug 31 16:05:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 248772 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp3447371ilg; Mon, 31 Aug 2020 09:15:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMxOtq8oWV1b/OsKN3Zd+wXK5881WAy6Hidn99XNCSCM9sMxwaMYoNGpjpzjZBkaGR8AMQ X-Received: by 2002:a1f:1a0e:: with SMTP id a14mr1645422vka.87.1598890508052; Mon, 31 Aug 2020 09:15:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598890508; cv=none; d=google.com; s=arc-20160816; b=XGGXFo44LNIjXPfACTEYhyT7/7U0Scs/718fLHQjSi4/srCAs9Kj31RK5A+4/KsGns ztJarPSmcsJYUgxbeuDZSiHQavYniMSlSgFGfJb4W2G7C9fNDytaGQ+77cv6TL1tk7c0 8+d/f5Y+aQ/N9cbjgc34vjLfjeyH5CrsL7OQaZCrH90jDIyafeVC3GL8IL/LGERfbmS0 pA7M1zswPrjO/B/YGnGbRdN3ki1kwEU6W99t0lwg0i7Fp/SPs40ZBrobNnrcWoDQVD1X w8b+8W2u7WBfj8cakaXEi2k1rurAjX2oLobhUeReShW4xHh1lemd5DawUTUAEOLEjU7a +7Iw== 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=5ShF+BY48IwWmImvy13quKmLT6LR29ss78JGb2qClWk=; b=cSYeP98i91wy/9TJjkjfEh2kObdKu0/4vhVi6urnPhWmSfF8soba0qfCgDaXxh8ila uZYFxmThowsgrevumo2gst7V702GtAHLSPt32rWr5w9k/Wd3xcfHXK1MgN6nI41QQSdR 94KepTY93hhGD7gVlYdhIhVEt6bjgGMqBh1oc7xkUhbP1CivuJAEfTq/E8mtU1mTyQfb uKAwdLSy0nQDJ2I4v/ZTkZhncahydRotmICz3V0l3rO0UHzJJ+4iuNr4WPQhVgnja1ss qULw+WQnVKzqF8ueTEVGCCnkHLgifNd0JHAdZ9A7Jn/oskQqM61da9CIjWLfFmVCnSN9 /BaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=e6H9RCuE; 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=fail (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 v7si1194339vsm.174.2020.08.31.09.15.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 31 Aug 2020 09:15:08 -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=fail header.i=@linaro.org header.s=google header.b=e6H9RCuE; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCmSZ-00054c-Dh for patch@linaro.org; Mon, 31 Aug 2020 12:15:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCmKF-00047A-JS for qemu-devel@nongnu.org; Mon, 31 Aug 2020 12:06:31 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:54430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kCmKD-0005yF-8J for qemu-devel@nongnu.org; Mon, 31 Aug 2020 12:06:31 -0400 Received: by mail-pj1-x1036.google.com with SMTP id mm21so22366pjb.4 for ; Mon, 31 Aug 2020 09:06:28 -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=5ShF+BY48IwWmImvy13quKmLT6LR29ss78JGb2qClWk=; b=e6H9RCuEKvAL+dLt6N7M3C0TcE2anGkJN9Z91jPzXhZEYoyYmMu+DD394dp6CGlApu 04cwemSEhZ2q1QcrIrjbuCpF6UIYoMB0TiSyRGLGpA18eKJDefax0/LMj3p2E1STxzJl Ea5aPjD8n+Wgf4rrgXORlgUeHQxlwuAdLlqXDk+MPTwPLUzO3mXJJmt5aTijoZGS6UHw oSjpkmCMsA5kUNJKBty02udS1fhu9CVDsgiJnA62EUF/XB5A3Rucgu8MkG2IQhHIb7F3 Qa2KDzaelkVfWP2a7nE/MfMSN5PxO8cq9IeMLHdiqo0bDK4vU/di/xkk5u6XJVj4j2Zp 8cSg== 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=5ShF+BY48IwWmImvy13quKmLT6LR29ss78JGb2qClWk=; b=Fd7tInKS2d4TOR5LZQFEOY+e8WZzXah8nQTz7AWQ0W+bvKmbYgV0DIOSs2pP+dV8fn FdDQTGUPNxNYkseXfp0vT2gJ21EV+sB0O21kI83t9wepb4+vXZzvynLMxa0AFKR7mfIi tLSMvfAkYZEvKjVnmcpeDSaMai3xMDoPmF67A2QSj7eNCF2MU4SXyD9BNTJElTQhzP4y sMjaHEIO4/w1rL5Wn/XZudWi+cNL/kbGwmg7CBTib/5FK6QdzstLJao6zbzgi0YzL2OO gYPAiGgX3IoQBqx5FhF2pppzm00MhwmoGr3JKLPOGoxQSsqE/ZuKgYuMl4CMJbzeLd+S rVHA== X-Gm-Message-State: AOAM531xR2KIO2fDfW25A3XbZ6QXaVSOxPAyT2b+uynIGRmXVwwyknBH OQrlN907chO/nufb2yQh23QNSi1YOpbogg== X-Received: by 2002:a17:902:6ac3:: with SMTP id i3mr1591333plt.21.1598889987492; Mon, 31 Aug 2020 09:06:27 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id gt13sm17218pjb.43.2020.08.31.09.06.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 09:06:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 17/76] target/microblaze: Fix width of BTR Date: Mon, 31 Aug 2020 09:05:02 -0700 Message-Id: <20200831160601.833692-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200831160601.833692-1-richard.henderson@linaro.org> References: <20200831160601.833692-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.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 E . Iglesias" , peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The branch target register is only 32-bits wide. Do not use a 64-bit type to represent it. Since cpu_btr is only used during MSR and MTR instructions, we can just as easily use an explicit load and store, so eliminate the variable. Tested-by: Edgar E. Iglesias Reviewed-by: Edgar E. Iglesias Signed-off-by: Richard Henderson --- target/microblaze/cpu.h | 2 +- target/microblaze/translate.c | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index 34177f9b28..72f068a5fd 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -241,7 +241,7 @@ struct CPUMBState { uint64_t ear; uint32_t esr; uint32_t fsr; - uint64_t btr; + uint32_t btr; uint64_t edr; float_status fp_status; /* Stack protectors. Yes, it's a hw feature. */ diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 3fc2feda3d..a2bba0fe61 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -59,7 +59,6 @@ static TCGv_i32 cpu_pc; static TCGv_i32 cpu_msr; static TCGv_i64 cpu_ear; static TCGv_i32 cpu_esr; -static TCGv_i64 cpu_btr; static TCGv_i64 cpu_edr; static TCGv_i32 env_imm; static TCGv_i32 env_btaken; @@ -545,7 +544,8 @@ static void dec_msr(DisasContext *dc) cpu_env, offsetof(CPUMBState, fsr)); break; case SR_BTR: - tcg_gen_extu_i32_i64(cpu_btr, cpu_R[dc->ra]); + tcg_gen_st_i32(cpu_R[dc->ra], + cpu_env, offsetof(CPUMBState, btr)); break; case SR_EDR: tcg_gen_extu_i32_i64(cpu_edr, cpu_R[dc->ra]); @@ -587,7 +587,8 @@ static void dec_msr(DisasContext *dc) cpu_env, offsetof(CPUMBState, fsr)); break; case SR_BTR: - tcg_gen_extrl_i64_i32(cpu_R[dc->rd], cpu_btr); + tcg_gen_ld_i32(cpu_R[dc->rd], + cpu_env, offsetof(CPUMBState, btr)); break; case SR_EDR: tcg_gen_extrl_i64_i32(cpu_R[dc->rd], cpu_edr); @@ -1799,8 +1800,7 @@ void mb_cpu_dump_state(CPUState *cs, FILE *f, int flags) qemu_fprintf(f, "IN: PC=%x %s\n", env->pc, lookup_symbol(env->pc)); qemu_fprintf(f, "rmsr=%x resr=%x rear=%" PRIx64 " " - "debug=%x imm=%x iflags=%x fsr=%x " - "rbtr=%" PRIx64 "\n", + "debug=%x imm=%x iflags=%x fsr=%x rbtr=%x\n", env->msr, env->esr, env->ear, env->debug, env->imm, env->iflags, env->fsr, env->btr); @@ -1868,8 +1868,6 @@ void mb_tcg_init(void) tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, ear), "rear"); cpu_esr = tcg_global_mem_new_i32(cpu_env, offsetof(CPUMBState, esr), "resr"); - cpu_btr = - tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, btr), "rbtr"); cpu_edr = tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, edr), "redr"); }