From patchwork Fri Aug 28 14:18:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 248514 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp1124534ilg; Fri, 28 Aug 2020 07:22:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTt8hB9IHRvRv1kTGpLQwfVEWtmr3QiQRyEBt3ZVG7dQ1Z+m/TGpb5lppKbH2eSwQvNDez X-Received: by 2002:a25:c6cd:: with SMTP id k196mr2746951ybf.318.1598624529428; Fri, 28 Aug 2020 07:22:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598624529; cv=none; d=google.com; s=arc-20160816; b=jDLE6xsnpeRtXfMKV3CzB/AH9OoXSa4RoIsZw97NsiP8s5VItAAn7FW8mbI//SiGW7 foOHu0ocyHRKnOsSfsP5j8Vr2dhe8oX22Eb5LMXcPpwPLZ1IdYUkhSVug+xcoiRHLDyn TE8evcidk8wTYaaSogekxdNy+kyteDum81EicUvRQ1H1G7HDZCNdQRKFKC9sL7OnNq6s Fiw1aiONTbD/NK5TqpyuYedw8qfloI++3fSbLNsXrx73LH63xkMVoyEqtjWQUaoBk7Ib 57RMADTrz/CUymaXsm5W+jt9z6YZf81+N51h59H5FAPY7cvaC3pJwbiCQP10nVDx3tEd YUEA== 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=AF5wUNj1rfWDk74W8hKW9/y1FLbHGsX9t+9rRKYsDAE=; b=uV0yyl2C/ZQoX6VX0V60rxnYUFMVFgyipBWl//zFcAI3cGEJ5O8kjHK+wHrHfWUQN9 azFEV8NTXw26oVPGhKlfDY/YWMTuh3BZh/IBLPwVwaAd7DfBrHQbcuNCsU1qIis5dT43 hI0hI9xegiA+0QYjZcvlj35kLZtgInOKm1WrLX223m+MCOOCMUZXl7lGxBSnHtQps1We cDVepudZqmPx3vVShvpZbjA89UhCQUYjVkuBRcZXGVr6eClUTjDHY8fJDxuyHm+NIfQB t78YPOiV4NfvGUzDofdF/oGshbb1Z6vOtUqPvKE52cW+3aiuDF6ALXesYRsbRZB5bjPf IJ+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cSJPLrm9; 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 y83si1055805yby.351.2020.08.28.07.22.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Aug 2020 07:22:09 -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=cSJPLrm9; 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]:60286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBfGa-0004eB-RX for patch@linaro.org; Fri, 28 Aug 2020 10:22:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBfET-00007u-3j for qemu-devel@nongnu.org; Fri, 28 Aug 2020 10:19:57 -0400 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]:52175) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kBfER-000561-CS for qemu-devel@nongnu.org; Fri, 28 Aug 2020 10:19:56 -0400 Received: by mail-pj1-x1043.google.com with SMTP id ds1so564759pjb.1 for ; Fri, 28 Aug 2020 07:19:54 -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=AF5wUNj1rfWDk74W8hKW9/y1FLbHGsX9t+9rRKYsDAE=; b=cSJPLrm9GteLmp/zHcYXBP7RJR7B23j4r/EiC/h2x4srhE/XJSzyKYIm2vuVNjWSg+ vbqASILIB4TCQd6fuelOKhjCYpFZ170/obWyZNCxPEv5Z6bGpC3i/91BfafuJi33fMGi t5X2WnEW7RYHhzWjgpZAw9YzX3V1lflRQ28FtSYtbFiW3qCB3NU0XLbfm2vNHpH1Sj2A rDfNqk9uKagyhmCflNQeuiZP9rWXXwrNJ6U7WlITLS9fzRYLC2tlopXG9pXFyL0jNeaz Ubk3M/FvWCnTnaLB/AuEbQP6oRuP8OrwJlOvPSwmAl7MPgcI2o7zlnd2n14jApOvtynl 6Hvg== 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=AF5wUNj1rfWDk74W8hKW9/y1FLbHGsX9t+9rRKYsDAE=; b=TUUtZn7dUcn00esqgriMbdR4xhkhLKII2oTPYX1VYacOuz3/HnhGOJTyDOSK7QJ2jX bK7TRTd/sb9RlhBqFZ2NAdXmjCTbn/hIZd8VTNR4DEAnILPQt4absFtuTClvqWHDPwJE p0NNqvHi/G3yupWrLodZEqpCEauoS/N/maHzMBZnlv7betWcKxc99S5iL2Wqgwm3YIoC s8PKzVS4MWA5Y7eU/PQPz7rQvaVukkOb7h9wUDw1AWxLWMMpmviHJytA0pzSjxiUevQl x2gUeJg5AKsaF0Qbmb2ho6L/qxKUBFhPGueQS3QUdNUafb0I2H1CkdiI/c8GrruufBuX gWig== X-Gm-Message-State: AOAM531+aOt5eYROoBQQ2PwzEUrQO6lHg8PrD1hKw4Wqz+332mbce9rx d2t3nwtKd/sQcTDmTSPTZB9KADK57KYf2g== X-Received: by 2002:a17:90a:f28a:: with SMTP id fs10mr1331215pjb.219.1598624393664; Fri, 28 Aug 2020 07:19:53 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id j3sm1403080pjw.23.2020.08.28.07.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 07:19:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 17/76] target/microblaze: Fix width of BTR Date: Fri, 28 Aug 2020 07:18:30 -0700 Message-Id: <20200828141929.77854-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200828141929.77854-1-richard.henderson@linaro.org> References: <20200828141929.77854-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1043; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1043.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@xilinx.com 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. 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"); }