From patchwork Fri Oct 18 17:44:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 176923 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1185037ill; Fri, 18 Oct 2019 10:50:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCoPRYyvclaYSTXDMhYWGyzWtrVFOnnI/zyrE4G8UFdCgj/SrEg66DuHhlNVJufTo2iwLD X-Received: by 2002:a17:906:9aa:: with SMTP id q10mr9640054eje.93.1571421038772; Fri, 18 Oct 2019 10:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571421038; cv=none; d=google.com; s=arc-20160816; b=vBpzIdZpKnGfa+NYxlCTVwAMg344AFqTgqLCOKwAh35oAaabkXWk46AXm8144r+rrf vo6x0IkjdS8J2wFgi8mZROF11M8V/YnrKy+dDo/Md5hJYbYvHJxhXnUei8n7BPXJaJzj f7nySTITIF2d6SCb9SJElJ2ZmOddaaxQ5ezfyuz2lGRuMuFoblgDHlxBodzeH3iWdRl9 xVWy94/kNyFmLHbbMITK+i71CpzUoa+OwnsjLpatRkYDDPRkLfOGhjaCFT1mktXneEsr lnc/pwFBep7yZ8sGh0cxexnO8XQqGyW4NpcUdzlTK6xzn0u95VAnu7o+LC6GVg9EcFFE F34g== 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=+w+DpqTaqyThsFD3h0g6qTaqlae+kRMVgywC4mwAkDA=; b=oCN3tIr/V8nmKsxt8XhnHPFru/Ac/dol8w2Af8vx93zlmk0RNSbTk0a7HCh+Du2B6Y TvScJmr+0YHqCNzy/fcUixjHu1RxPByfnHkSny5iYNrQJsG6itDEyaxZ5deG6PMnrFWT 4GPXWGPuDMwQPFsGz311kmtrO2CD6cEY/+R47bGs8irbdyxa5v157CfA99/P5lSWY8zX raVQCelmM8xzD8vu7kVp04k39k3CWxMl+pC7G5iF1MYS1Pz05RCDcAZ96kvAcIdWz6Hm Ra97935Z1iDyUv16HAiHSvS8R/Y09AyTwfYk3Aqw0b/aBsL+CpBbp4Ma1GxKAxdf+0Xo WEwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XRL03tO8; 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 pw28si3865721ejb.43.2019.10.18.10.50.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Oct 2019 10:50:38 -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=XRL03tO8; 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]:44292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLWOb-0003I2-4A for patch@linaro.org; Fri, 18 Oct 2019 13:50:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59248) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLWIw-0006YF-M4 for qemu-devel@nongnu.org; Fri, 18 Oct 2019 13:44:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLWIu-0005Rr-Ri for qemu-devel@nongnu.org; Fri, 18 Oct 2019 13:44:46 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:35604) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iLWIu-0005QW-Mj for qemu-devel@nongnu.org; Fri, 18 Oct 2019 13:44:44 -0400 Received: by mail-pf1-x441.google.com with SMTP id 205so4324305pfw.2 for ; Fri, 18 Oct 2019 10:44:44 -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=+w+DpqTaqyThsFD3h0g6qTaqlae+kRMVgywC4mwAkDA=; b=XRL03tO8pYpwmYBVCiyu9Lv8vVDOHUC7ETMWAW7W1kc8cD43sIBCE0sWA3+7pu2dB7 o0hkTWRIMmT/oMAPLYyHMBhvV66LFxSnNM0JYwwXGSQC4mOb2cH7Piku0f/HWqAzoz0j c8ViFL4Q+ohaJW9+58VcFaGAc1IJl9NEeddcAEZbpTujNH8WHR3HUc6k7Z0C8wdf5s5N MpgJM8k5CvUqak5s9CyqlLbClfN4BtqoUT8Y6nrPIgxR1vdImJUkBqQCLLZo9RLD7WXC /7UfyEoLA9MePfONCv1BsJ8FRSzf6v9WPYXSj4rSzE2Cc0KP05VNs2SCiXcs5CYZ1ov5 xKgA== 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=+w+DpqTaqyThsFD3h0g6qTaqlae+kRMVgywC4mwAkDA=; b=aosH+gi21GO2qpAUtAUZD2SNezPjJu9XClpkr9MEAdJd2lmRJv6X6WWP4V0CgBdPWw XbcEWlVCTA8Jvum/sjBS74/s6NxovkAtPkKIZsOQ0aukqfH72Odo6cZnf3fIxoMLpMOm Rc/4RTAYOmCynxqCMiNRULeD9/1BlY9RkJOFit0kzGMHv3fJXoZkyHHDb0mHcEmPLHuG vxchvWcTEsfT52lTXi7wNlMrNMLcS10ZWXIggX9/HO0fixX+L/E8nPNu6Tw+uKfuzf+r ykGaadVsjEN1TnejcdgXbDhmJgsPj8kTITx7BxjQVW/TF7HsGohUik6AP1RM21tY2Ugp KhnA== X-Gm-Message-State: APjAAAVKwaoOzqdBusujYVuxZB8hpvQIM7qQutrw9bRSq7OThQsQhtc5 CNhbK7XPw1WadmIAfQGrlV5EFhrZSmk= X-Received: by 2002:a62:b504:: with SMTP id y4mr7982540pfe.124.1571420683357; Fri, 18 Oct 2019 10:44:43 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id d20sm7857534pfq.88.2019.10.18.10.44.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2019 10:44:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v8 09/22] target/arm: Hoist XSCALE_CPAR, VECLEN, VECSTRIDE in cpu_get_tb_cpu_state Date: Fri, 18 Oct 2019 10:44:18 -0700 Message-Id: <20191018174431.1784-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191018174431.1784-1-richard.henderson@linaro.org> References: <20191018174431.1784-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::441 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: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We do not need to compute any of these values for M-profile. Further, XSCALE_CPAR overlaps VECSTRIDE so obviously the two sets must be mutually exclusive. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- target/arm/helper.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/target/arm/helper.c b/target/arm/helper.c index ddd21edfcf..e2a62cf19a 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -11235,21 +11235,28 @@ void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc, } } else { flags = rebuild_hflags_a32(env, fp_el, mmu_idx); + + /* + * Note that XSCALE_CPAR shares bits with VECSTRIDE. + * Note that VECLEN+VECSTRIDE are RES0 for M-profile. + */ + if (arm_feature(env, ARM_FEATURE_XSCALE)) { + flags = FIELD_DP32(flags, TBFLAG_A32, + XSCALE_CPAR, env->cp15.c15_cpar); + } else { + flags = FIELD_DP32(flags, TBFLAG_A32, VECLEN, + env->vfp.vec_len); + flags = FIELD_DP32(flags, TBFLAG_A32, VECSTRIDE, + env->vfp.vec_stride); + } } flags = FIELD_DP32(flags, TBFLAG_A32, THUMB, env->thumb); - flags = FIELD_DP32(flags, TBFLAG_A32, VECLEN, env->vfp.vec_len); - flags = FIELD_DP32(flags, TBFLAG_A32, VECSTRIDE, env->vfp.vec_stride); flags = FIELD_DP32(flags, TBFLAG_A32, CONDEXEC, env->condexec_bits); if (env->vfp.xregs[ARM_VFP_FPEXC] & (1 << 30) || arm_el_is_aa64(env, 1) || arm_feature(env, ARM_FEATURE_M)) { flags = FIELD_DP32(flags, TBFLAG_A32, VFPEN, 1); } - /* Note that XSCALE_CPAR shares bits with VECSTRIDE */ - if (arm_feature(env, ARM_FEATURE_XSCALE)) { - flags = FIELD_DP32(flags, TBFLAG_A32, - XSCALE_CPAR, env->cp15.c15_cpar); - } } /* The SS_ACTIVE and PSTATE_SS bits correspond to the state machine