From patchwork Thu Oct 24 16:26:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 177568 Delivered-To: patch@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp2425379ocf; Thu, 24 Oct 2019 10:02:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwIairayvZfALRaOoUm/BkL26AoAut80WrsZ5i9jDknd/n/j54ZRVEtnB7CzqhhfNvNvhqI X-Received: by 2002:a17:906:3285:: with SMTP id 5mr22506949ejw.143.1571936549990; Thu, 24 Oct 2019 10:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571936549; cv=none; d=google.com; s=arc-20160816; b=T/xqd21yG07qRJsYACSY5cxvkERcPlvvBnfZEaNTRE48FQKUyGAkMSDOdYKapt76Lw Ma6ELFTcfdud5A9j1xhNESNWzlLCd19UhFJKGNILleSkmCMZRzqXLcyIA+ec946jp+lP 1aAIaF5EGqhEx/9lKwLoLhshVzV8jUsNOjiBquYvOjtZjv+wfEhYLFlDDwOPGXfnefhT jlsMI1Nez7GolagyBFRYEi6Whk43c6WDFR7Vvw9A6GsS5mnG3PNfzOdmLqRtEMWSQek9 e7kMDyAw/CHybOMJQOf3azX/PKiUqvx7p77VrJu/u8w4d0KPKUP7w1r0HQbBioTgfEpR E+kw== 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:to:from :dkim-signature; bh=zVsNlJ5N2k9sc9bIq4CoBW6EYZLcHxwA40pi1YP50Gg=; b=J1FSP4cEWgPsphjT8KvfG4P4vWd1dZeq2MXrKA7Bk8bWyl9wtKj+uWItJbqyB8tz9g cnD9eqpkx01nghgOb36Yw44KWN96TygZLi4eWZYx1fjfzsWg4UVqVZQPaTAlkka/j3Ee dfof2Ls5ZF9OrK1hmL7bHdArogPy5Lqku16n685RfNSKbW6fRR9oHh5EAclE4KNHyIZb 3Xfnm8rLKBCFLqqw63ZiH1tsNhghtj7nGAALJPFdfk/EvAWQrqbUsBBhmOR0x1nnm8pO HF/q/GqJ3C1KBVQctRdEEY4nfM1k7Zs6xcf+fds1B6asb/VZzEOfJ+vuDS/fWsKHD/Ez E5qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f+xZduZy; 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 v6si10394823ejh.280.2019.10.24.10.02.29 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 10:02:29 -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=f+xZduZy; 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]:48216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNgVH-0000zd-T5 for patch@linaro.org; Thu, 24 Oct 2019 13:02:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57801) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNfxg-0007C5-OI for qemu-devel@nongnu.org; Thu, 24 Oct 2019 12:27:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNfxf-0000jo-K4 for qemu-devel@nongnu.org; Thu, 24 Oct 2019 12:27:44 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:39151) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNfxf-0000jJ-EF for qemu-devel@nongnu.org; Thu, 24 Oct 2019 12:27:43 -0400 Received: by mail-wm1-x342.google.com with SMTP id r141so3205804wme.4 for ; Thu, 24 Oct 2019 09:27:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=zVsNlJ5N2k9sc9bIq4CoBW6EYZLcHxwA40pi1YP50Gg=; b=f+xZduZykPOGzSiLR04A1ZUnnV/7uoM9IOOoGmqo+xFRQXg6O93/kE3z5SvWXNMsHV INvWCuMfjzyfoh4O0DUxs4T2tJgiwmLHhj1c5CIzrPmsTU53MxcOq0qiCF8dbm5Fqrq/ D9DT8EHjxdY1AU+evC4e9WahTtJ1oK9bcuTQHMMc22tlsHJQEObtqjwUAzrjOSpZreSS iKyaVeEM6Gj8LpxKUonTdo6vTlDPU4fNfwZzCi4D6Q0qS9PKouyqJKwQ7T+KZIL9/OWx 3ObNgZJL+TZob9dwhgyB2mO01Qt5hpi001+dfvZxUI2nnHguoRus53OqBzBPXmgcmiLT o5uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zVsNlJ5N2k9sc9bIq4CoBW6EYZLcHxwA40pi1YP50Gg=; b=mtbYPlEWvjgBAeiZ6Wc/gXKYFc1Ey7fLtm9I876aRildITG56Bo9cz3X9QqktfAeM3 ka8JFf8XHXj84Jhl+Dh5ijZGhHErTjoWQxbdTPF3UGzJGng98ZA638xHSHCs09K2Y5I/ XL+/4GWvCa6HqAEjpBgehg44k7e2aiIPvvTbftYzMwlRsvA+dk7i4xsngCN4LbR6kasz Lb4HIPK9EzpTNV7zjNK6vOhVpLs9ullc4gEgoCR/Klf8ftsS+fK+S8RBuLMyvPqXFddL HgcLaX0S47SLbPHjxkyCaCScRzfruoAvitljJiPUd6YKtno0EqTikl4dnzcAi8W9H9O0 m8cA== X-Gm-Message-State: APjAAAXqIRcdYJ9p1D7GFHlhIKGQjN9hqAqjN6D0isbM//S/+ClA0Ssx t+YNHmmZTIiJ4YmiIEKOrkiREh9/YII= X-Received: by 2002:a1c:2407:: with SMTP id k7mr5322298wmk.99.1571934461369; Thu, 24 Oct 2019 09:27:41 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id r27sm42606124wrc.55.2019.10.24.09.27.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 09:27:40 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 11/51] target/arm: Hoist XSCALE_CPAR, VECLEN, VECSTRIDE in cpu_get_tb_cpu_state Date: Thu, 24 Oct 2019 17:26:44 +0100 Message-Id: <20191024162724.31675-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191024162724.31675-1-peter.maydell@linaro.org> References: <20191024162724.31675-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson 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 Message-id: 20191023150057.25731-10-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) -- 2.20.1 diff --git a/target/arm/helper.c b/target/arm/helper.c index ddd21edfcf1..e2a62cf19a0 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