From patchwork Fri Feb 14 18:15:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183519 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2131699ile; Fri, 14 Feb 2020 10:25:05 -0800 (PST) X-Google-Smtp-Source: APXvYqweUlaHIzY17mOWML9abyuqUA2AXwXcEqKP/2I3TLVYP8ErTQoKBitOwdSFIBjpIBfTEmfQ X-Received: by 2002:a37:40c:: with SMTP id 12mr3888402qke.212.1581704705338; Fri, 14 Feb 2020 10:25:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704705; cv=none; d=google.com; s=arc-20160816; b=pnOAM/lAFK7usyZ/zRoBXtLgFy0aj5qSHhDpi3NgTclZSZFXU3pRLGnjZYXuP+3fi+ 4ne3Zn7oXx7qSH0EYL7E6aB7/6E/zYOKmvw/PqNaMcfckSBaXjotKWvXY+gT12BWM521 i8POiFdejDCIM/RUx1KZcP6ecKHq6ELIS2KmOsq1Gp1kMLv+nXd7sdAniiqapZkI711c d4LFgNE1e7EdaGGCOc+do8Fk1CfAMELGNreCd4faagG+xxFDMVDoyEKbuBs+88niU2yt rNDv/YF1yS8ge00BObLDN7waKe1hzAFnKcrXKdbfQNvnYGKCp36Csd8JV5bIMbjy2YUV D85Q== 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=jaAC4b+WQDjTB8KwLDIOWST2Ik8xCOfklX+0EF0qKFI=; b=c+KqH/iHIaQJ5xFXzO0qvf/UZhEbPGyC2ym/d3OBF7fnnKsCj0BeRMpd2TKiPBZ7/d M4qoDBKGO6eGowx9h24P1DkhbY5zfSH3kMp+4Q4qQScMGULbUXo3u/XPOZTTkc9zGj7J 1mnEqEkqPrV9zUNpk4bEWsNSSk5vqxRtRIkQdBzAUGAmYjb1788HIihdv8IPXXJ4XblM SxOE2UDZFl6pMbM4/cPJGBcL7hTM3MKaVFT0HBp6lZmgehsngwEg7jSxUKH/3meIk8PV EVjmim97LO8zsjjWjfnyfm4BHDyefj//k/aAgNWbwRPlQQKMgRsmQpUNmmt0axhqVF9p 57NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iYdkLkx9; 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 m26si1266593qka.296.2020.02.14.10.25.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:25:05 -0800 (PST) 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=iYdkLkx9; 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]:43756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2feC-0005Qn-SW for patch@linaro.org; Fri, 14 Feb 2020 13:25:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60884) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVU-0004RT-Eo for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVS-0000Eo-1A for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:04 -0500 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]:55927) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVR-0000EW-Pc for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:01 -0500 Received: by mail-pj1-x1043.google.com with SMTP id d5so4191272pjz.5 for ; Fri, 14 Feb 2020 10:16:01 -0800 (PST) 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=jaAC4b+WQDjTB8KwLDIOWST2Ik8xCOfklX+0EF0qKFI=; b=iYdkLkx91FTUw8c8aBjrmN1KPeXf/SG3+sU1Yc9XDgtYaNpxxaimOW3oXl0srjnFaS yO6s7pv4yulfxaEMidlD+sGi1+IDu7sxa3ipRq2LWe5sNxJQ5egSnP/qG/vQKfgchhLX f8E5m+APpOS3UzDT5hpdCakIQHO2iRP3qwsE3gIVK82+wXRpJzSQ6BieWbj0e8SBrlJy KHIbK2/+oErmPRQXYfJLpH7Z53yvmRNgr3Fl/dPVBPQkwA93WYqSFNgjjwLkiraLceUw UCp2N/QBGAPNZaGCIcMDwnWMsBu1FFEvkwOlODZHE86mIgIJodckAt7rybURduIKcfuv mN8Q== 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=jaAC4b+WQDjTB8KwLDIOWST2Ik8xCOfklX+0EF0qKFI=; b=dzVGicuCzXw9SQcOaDo4nq/h2PYNpBZ3xVpyXS4DPaOwr2XJh0vuhsfRR4zZWF0zG9 p28yRCiKXck5Q/u9EeeiyEHkVrVQMD5w1h3VuHtRaDu8qX83UOmB+CDnI9HnJ9H4u4MK fDSfUeewqINWKyaKg2O6oT3AteNAZO2pEGd+QFg2kHT2ecX+s6rCkTLVYCqdNpWPzl8Z tAKq2enJEiWN0p7x96p1aGZJL8B4lJkLKKPhfiNeqgLsJAC9M7sPXCmUAoEBtJ+hZyro 9HrVIGyubq0I2Th2kKLS5sQwfeMzrwea1ggR6Yl3ldLSy+ElflnY2ZHQq9SsjBxFmXjK mdHA== X-Gm-Message-State: APjAAAVbNEDJFuQnGi91sonwgGLtU7uiUE8X+vZREQMVVL9y09hpoBRE /PUHBxolkKZlvFRrnsDOC/9Ushu8p7E= X-Received: by 2002:a17:90a:628c:: with SMTP id d12mr5123055pjj.59.1581704160272; Fri, 14 Feb 2020 10:16:00 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id i3sm7525123pfg.94.2020.02.14.10.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:15:59 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 10/19] target/arm: Add missing checks for fpsp_v2 Date: Fri, 14 Feb 2020 10:15:38 -0800 Message-Id: <20200214181547.21408-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200214181547.21408-1-richard.henderson@linaro.org> References: <20200214181547.21408-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::1043 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We will eventually remove the early ARM_FEATURE_VFP test, so add a proper test for each trans_* that does not already have another ISA test. Signed-off-by: Richard Henderson --- target/arm/translate-vfp.inc.c | 78 ++++++++++++++++++++++++++++++---- 1 file changed, 69 insertions(+), 9 deletions(-) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index 9e5516f208..8913320259 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -555,6 +555,13 @@ static bool trans_VMOV_to_gp(DisasContext *s, arg_VMOV_to_gp *a) int pass; uint32_t offset; + /* SIZE == 2 is a VFP instruction; otherwise NEON. */ + if (a->size == 2 + ? !dc_isar_feature(aa32_fpsp_v2, s) + : !arm_dc_feature(s, ARM_FEATURE_NEON)) { + return false; + } + /* UNDEF accesses to D16-D31 if they don't exist */ if (!dc_isar_feature(aa32_simd_r32, s) && (a->vn & 0x10)) { return false; @@ -564,10 +571,6 @@ static bool trans_VMOV_to_gp(DisasContext *s, arg_VMOV_to_gp *a) pass = extract32(offset, 2, 1); offset = extract32(offset, 0, 2) * 8; - if (a->size != 2 && !arm_dc_feature(s, ARM_FEATURE_NEON)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -614,6 +617,13 @@ static bool trans_VMOV_from_gp(DisasContext *s, arg_VMOV_from_gp *a) int pass; uint32_t offset; + /* SIZE == 2 is a VFP instruction; otherwise NEON. */ + if (a->size == 2 + ? !dc_isar_feature(aa32_fpsp_v2, s) + : !arm_dc_feature(s, ARM_FEATURE_NEON)) { + return false; + } + /* UNDEF accesses to D16-D31 if they don't exist */ if (!dc_isar_feature(aa32_simd_r32, s) && (a->vn & 0x10)) { return false; @@ -623,10 +633,6 @@ static bool trans_VMOV_from_gp(DisasContext *s, arg_VMOV_from_gp *a) pass = extract32(offset, 2, 1); offset = extract32(offset, 0, 2) * 8; - if (a->size != 2 && !arm_dc_feature(s, ARM_FEATURE_NEON)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -700,6 +706,10 @@ static bool trans_VMSR_VMRS(DisasContext *s, arg_VMSR_VMRS *a) TCGv_i32 tmp; bool ignore_vfp_enabled = false; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + if (arm_dc_feature(s, ARM_FEATURE_M)) { /* * The only M-profile VFP vmrs/vmsr sysreg is FPSCR. @@ -844,6 +854,10 @@ static bool trans_VMOV_single(DisasContext *s, arg_VMOV_single *a) { TCGv_i32 tmp; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + if (!vfp_access_check(s)) { return true; } @@ -873,6 +887,10 @@ static bool trans_VMOV_64_sp(DisasContext *s, arg_VMOV_64_sp *a) { TCGv_i32 tmp; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + /* * VMOV between two general-purpose registers and two single precision * floating point registers @@ -908,8 +926,12 @@ static bool trans_VMOV_64_dp(DisasContext *s, arg_VMOV_64_dp *a) /* * VMOV between two general-purpose registers and one double precision - * floating point register + * floating point register. Note that this does not require support + * for double precision arithmetic. */ + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } /* UNDEF accesses to D16-D31 if they don't exist */ if (!dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { @@ -946,6 +968,10 @@ static bool trans_VLDR_VSTR_sp(DisasContext *s, arg_VLDR_VSTR_sp *a) uint32_t offset; TCGv_i32 addr, tmp; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + if (!vfp_access_check(s)) { return true; } @@ -977,6 +1003,11 @@ static bool trans_VLDR_VSTR_dp(DisasContext *s, arg_VLDR_VSTR_dp *a) TCGv_i32 addr; TCGv_i64 tmp; + /* Note that this does not require support for double arithmetic. */ + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + /* UNDEF accesses to D16-D31 if they don't exist */ if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { return false; @@ -1013,6 +1044,10 @@ static bool trans_VLDM_VSTM_sp(DisasContext *s, arg_VLDM_VSTM_sp *a) TCGv_i32 addr, tmp; int i, n; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + n = a->imm; if (n == 0 || (a->vd + n) > 32) { @@ -1086,6 +1121,11 @@ static bool trans_VLDM_VSTM_dp(DisasContext *s, arg_VLDM_VSTM_dp *a) TCGv_i64 tmp; int i, n; + /* Note that this does not require support for double arithmetic. */ + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + n = a->imm >> 1; if (n == 0 || (a->vd + n) > 32 || n > 16) { @@ -1234,6 +1274,10 @@ static bool do_vfp_3op_sp(DisasContext *s, VFPGen3OpSPFn *fn, TCGv_i32 f0, f1, fd; TCGv_ptr fpst; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + if (!dc_isar_feature(aa32_fpshvec, s) && (veclen != 0 || s->vec_stride != 0)) { return false; @@ -1388,6 +1432,10 @@ static bool do_vfp_2op_sp(DisasContext *s, VFPGen2OpSPFn *fn, int vd, int vm) int veclen = s->vec_len; TCGv_i32 f0, fd; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + if (!dc_isar_feature(aa32_fpshvec, s) && (veclen != 0 || s->vec_stride != 0)) { return false; @@ -2021,6 +2069,10 @@ static bool trans_VCMP_sp(DisasContext *s, arg_VCMP_sp *a) { TCGv_i32 vd, vm; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + /* Vm/M bits must be zero for the Z variant */ if (a->z && a->vm != 0) { return false; @@ -2464,6 +2516,10 @@ static bool trans_VCVT_int_sp(DisasContext *s, arg_VCVT_int_sp *a) TCGv_i32 vm; TCGv_ptr fpst; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + if (!vfp_access_check(s)) { return true; } @@ -2682,6 +2738,10 @@ static bool trans_VCVT_sp_int(DisasContext *s, arg_VCVT_sp_int *a) TCGv_i32 vm; TCGv_ptr fpst; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + if (!vfp_access_check(s)) { return true; }