From patchwork Wed Oct 23 15:00:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 177301 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp877536ill; Wed, 23 Oct 2019 08:24:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqysqG6eMv0aC0FfzVs684bqKwOSTJHB8fDMNM6WoZz3bDrbfzgOdXALL08KL8vRUI230twM X-Received: by 2002:a50:9269:: with SMTP id j38mr19877216eda.5.1571844256012; Wed, 23 Oct 2019 08:24:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571844256; cv=none; d=google.com; s=arc-20160816; b=bPHTvC9aXolUkfom2MmAd3Wt2wGl4s6ONiN9crOy5lBIMDEvJrBZ96CoO7teKG5vXi q98mWR8nIDOyTYSafqH9lBkWJdBT5zCInhNMojPOb0FZUg3dIt20j0kMSfhruEUxronp 73AJe9yjCyuWZu+6i4HWmO2nhQu0imwoPWv2D2j/ExwwFnW8kx6YuHqPcpJy+OaTS9N3 /xSDNBJ2HLpLP0LFWehip7A4Onm5kpBLxyCApwbwhCz+tP8al4zhoVvjOxuT1p2f60v8 Cd5Xt/a2P4+p0ftGjoRtsitAlORS63ORIeoA+B6dEDGS1Pfy76UZPoNLZieHwPf0i4z7 4zdQ== 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=ig3JhtiF2abY+pdcIg6aGg18+lMLUw6R8S5DtGVAqpGNGn+M0XsoteufrDNyAtq8y1 BTUs3Z6MljnlyGo2xw9dfd/9gZ0xTInUTa4aVO6Q9nNrvwpbFdMhVcQQanzZXS51hpPe Ux2qh/vzLIXZ968fMc6rR2+CaX/ErFLftfEXjIoLw1J+TjJQYRJLDUbmn/w65cuJDzYI 2u5enmGIcw4xvyHkYRUZ652aQzip5B5LrJyvFjIINv4LiAB4que1i8jeqvFg3dDovbEr zmWxT5Q7ET6gt9/CC90Ghyc3TKIoHY99xpBGd+B1/eG7etTda8kZU0nHUzwLwxYJPnhN WIAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="tnqnVCH/"; 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 m1si8772932ejx.188.2019.10.23.08.24.15 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Oct 2019 08:24:16 -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="tnqnVCH/"; 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]:39403 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNIUf-0001xg-Sq for patch@linaro.org; Wed, 23 Oct 2019 11:24:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35238) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNI8u-000897-15 for qemu-devel@nongnu.org; Wed, 23 Oct 2019 11:01:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNI8r-0001FO-BG for qemu-devel@nongnu.org; Wed, 23 Oct 2019 11:01:43 -0400 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:44401) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNI8r-00014g-3T for qemu-devel@nongnu.org; Wed, 23 Oct 2019 11:01:41 -0400 Received: by mail-qt1-x842.google.com with SMTP id z22so12215931qtq.11 for ; Wed, 23 Oct 2019 08:01:16 -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=tnqnVCH/71/mrfaS0bcMDWr06WHHWLbRbkKUHXp/nAueUslzhqQ0NwfEE0F1M56+kq gYX1meHPZKyM23Qo/XT0jI+I14W7cfHxL7sK6cIkR8vY/fMIy+1xQicWP+AG+UwgValm NrbTS6WOHNZZIiBykpTj3IN1bb7m14dy9k1nMaX9mw8uBNIDEywxHS8JQw5CTeliZ+2d Etl6kQdEGr935xJIkYvaM4GZiDQX4m1rB/bZWEE/kH2Ws0fI31oXsdQOM1sSFiybAiW3 vhOSQ5424NdLolQlmBlVUfTtMDTLwZQ3uuZJ8To8BlchaBkcyxJvlF0+UKI5qqoze6HK +MsQ== 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=lqhExIn/7FhCuAOrqRfUOv6CbE8hUHSGws+u5AZcgazv6mtR/UND6nH0yp8iGMoxeC j4ocCnCgUzqTEFucf5BtYOX2P8Ic9fs1VLfxNurllnCKh4ySHsP40VonR0in5wiUNF4j cBvCYbrUl/zF8gKQcrNa2gFKFYpKPqK9kCDN/6Oc7Liylz/vCTmNtwCvRXgrz5nPfe1y 9oVkJ1sPM9YLeXJyNYAycffrZF1iXDDkpRUq50TTn5QEu6y2BDpeieACamZlA9BV5u1R OuvmDnjnqUF4jxcNM2cAPF15zb5RhLULdNOOBVZm/fYzU1j7Zk0tWU+7hyd+e96/glC4 tlNA== X-Gm-Message-State: APjAAAUDyJqyHv1d9x1aIm7kMGxKc1YDF+F3xyMPmWJs6wj7no317pfm pQHwnOV3iA0IzBe7qpIIVn2c+EqU+6E= X-Received: by 2002:ac8:664b:: with SMTP id j11mr9706105qtp.137.1571842874422; Wed, 23 Oct 2019 08:01:14 -0700 (PDT) Received: from localhost.localdomain (198-4-20-64.static.cosmoweb.net. [64.20.4.198]) by smtp.gmail.com with ESMTPSA id l189sm11030168qke.69.2019.10.23.08.01.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2019 08:01:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v9 09/24] target/arm: Hoist XSCALE_CPAR, VECLEN, VECSTRIDE in cpu_get_tb_cpu_state Date: Wed, 23 Oct 2019 11:00:42 -0400 Message-Id: <20191023150057.25731-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191023150057.25731-1-richard.henderson@linaro.org> References: <20191023150057.25731-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::842 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