From patchwork Fri Feb 14 18:15:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183503 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2124833ile; Fri, 14 Feb 2020 10:17:43 -0800 (PST) X-Google-Smtp-Source: APXvYqzAE4Mw2lXEL40MjHFqlnv7nIcVZw7whjLXr//nuJaUs1wwAWFGWHRU+nSrpX0qdasJjNFr X-Received: by 2002:ac8:7b4f:: with SMTP id m15mr3760676qtu.48.1581704263429; Fri, 14 Feb 2020 10:17:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704263; cv=none; d=google.com; s=arc-20160816; b=I2YVzXQkTqRTD7wV6nLOe8Cus51fzQDSmfN4YyhcBXntWvCY+/fSlr1QoQuGqLJyl6 yn4R6xyqb7b6ExCNlUOqsIxfH2q5x8kr7nm2kKRmsQCchIFTvqCM8NDfgCJiWobtSK/w hsGysGsFO6twdF+WF+a1dW1/mbhSenKHZuYDl8Rs31W0XjE+j/4lJvP8kU2dsfg9lCyF ECcAF7AkZz1krE/zJMLqzDEyVgjajvEZmp9vg94JmATMiVjIVZavzbpxQw5iP1X+ukRJ rTCsVcaG6J+vP3IQ/jD1z5tCBtZukHPuVx+2/cr41rcj02gY7/y5O4ImJlZbS/SAQ4Yy cIOg== 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=RVsYrCWRH15jUkV+nOTPRiB+8FHjPwEImYNiw048qj0=; b=REoBfHEdr+KmUVZHhm7aOBILvJjVj+t8v9XfMI65Nv678SZvw61vB5TnijjjFqApjj tuQgIa+DarrM2N5nibAdPXDR/7ktowetcoO0f6F+K48TbGJ4ihj6V2l38L68tnzpn444 Ks/VY0VkRGpQH9tY1XXQPq42zNkJJYJ5248KcyaInLHEGEb06vnuAyPlclSh2Mn/DMf5 y28n6OiMWW0jcTB/OcsmeUnmAR+FDvbK9k6NA/IJKu/9/FMjq/5i+GNavhHYY6EwoYUz fJ19fPumXVk5kMwQJtxn2QedCAaYAfAL3l+7dE9kWUlkEViBpI105Shbxrl6EQcPNfa/ jadw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kaX2BiSm; 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 u126si3401789qka.57.2020.02.14.10.17.43 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:17:43 -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=kaX2BiSm; 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]:43518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fX4-0007s4-Jr for patch@linaro.org; Fri, 14 Feb 2020 13:17:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60749) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVI-0004Dg-Ij for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:15:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVH-0008UP-Fc for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:15:52 -0500 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]:37085) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVH-0008U2-A6 for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:15:51 -0500 Received: by mail-pj1-x1043.google.com with SMTP id m13so4258490pjb.2 for ; Fri, 14 Feb 2020 10:15:51 -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=RVsYrCWRH15jUkV+nOTPRiB+8FHjPwEImYNiw048qj0=; b=kaX2BiSmMPf/dfANlgf46MUoRKKJDjpVu6h1ilLmhlQBV4XnDzZZWN9aBQNbaFjb4O /J4/zU3BOhvSmsgPTaR+FW3TMwszwTCJjT6AW9m8TjuYtPNNO/bunaoEs9QOThwbzYeF v8aZ1dyAXdI5lZGbb2bKLgMPJlZ8RQwdAjNtUdgRDZsfvd2Lw66BoI7cUigQFSMRWlOp mzm93p2rYHQypeJPShBHctNU9eRYN03cIDsAU/9FDYFucEJm/hEyznn8ZDWkw7GAzGik xX9PBH8w/pdnVXzALsg0QWNrktrWW9MS/+H7vZzChZhyKeIyUugB+CdDIQVY7B1LmJ1E bDyw== 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=RVsYrCWRH15jUkV+nOTPRiB+8FHjPwEImYNiw048qj0=; b=rJVat+HxPp0VL4GYSdL72N2q4lrv88Gd7nxrNYrhF9pPlOqcpTf4XTASMC0o/eRQvN i6SeRMa5BaGC6XeZy/ErBmmKr+Cc+Asik3+V/w6+glzcPPMs9CZ+L+R12mRbYKT8jo0R /ZIoTHrkdyD/31PueQqythagrX0STzIztx0iwbhQL8Wyzjl3lCqPijX5rRB2omZ5iEEL 3Gj10cnuY6fbEUcCr3o3TvH7w5cyZvJObohqOlJhBb26i+RcVUXE9F4C4/xzSt6aiLTq wWzJO8MrCaldAP/wVO3LWYw9FscaYfXfQxg+d2e+eJXH2DuwTDkteJg2eZwFuXYFPDo8 GD1g== X-Gm-Message-State: APjAAAV1gLByxS1F/+dV2SmDJmff+KD18nevOrVp9+WkZMtOcB5r91f5 1muFIHf+nSzEQ1kwQNEwHVlwa+vWyfQ= X-Received: by 2002:a17:902:b116:: with SMTP id q22mr4689987plr.324.1581704149957; Fri, 14 Feb 2020 10:15:49 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:15:49 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 01/19] target/arm: Fix field extract from MVFR[0-2] Date: Fri, 14 Feb 2020 10:15:29 -0800 Message-Id: <20200214181547.21408-2-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" These registers are 32-bits wide. Cut and paste used FIELD_EX64 instead of the more proper FIELD_EX32. In practice all this did was use an unnecessary 64-bit operation, producing correct results. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/target/arm/cpu.h b/target/arm/cpu.h index e943ffe8a9..28cb2be6fc 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3415,18 +3415,18 @@ static inline bool isar_feature_aa32_fp16_arith(const ARMISARegisters *id) static inline bool isar_feature_aa32_fp_d32(const ARMISARegisters *id) { /* Return true if D16-D31 are implemented */ - return FIELD_EX64(id->mvfr0, MVFR0, SIMDREG) >= 2; + return FIELD_EX32(id->mvfr0, MVFR0, SIMDREG) >= 2; } static inline bool isar_feature_aa32_fpshvec(const ARMISARegisters *id) { - return FIELD_EX64(id->mvfr0, MVFR0, FPSHVEC) > 0; + return FIELD_EX32(id->mvfr0, MVFR0, FPSHVEC) > 0; } static inline bool isar_feature_aa32_fpdp(const ARMISARegisters *id) { /* Return true if CPU supports double precision floating point */ - return FIELD_EX64(id->mvfr0, MVFR0, FPDP) > 0; + return FIELD_EX32(id->mvfr0, MVFR0, FPDP) > 0; } /* @@ -3436,32 +3436,32 @@ static inline bool isar_feature_aa32_fpdp(const ARMISARegisters *id) */ static inline bool isar_feature_aa32_fp16_spconv(const ARMISARegisters *id) { - return FIELD_EX64(id->mvfr1, MVFR1, FPHP) > 0; + return FIELD_EX32(id->mvfr1, MVFR1, FPHP) > 0; } static inline bool isar_feature_aa32_fp16_dpconv(const ARMISARegisters *id) { - return FIELD_EX64(id->mvfr1, MVFR1, FPHP) > 1; + return FIELD_EX32(id->mvfr1, MVFR1, FPHP) > 1; } static inline bool isar_feature_aa32_vsel(const ARMISARegisters *id) { - return FIELD_EX64(id->mvfr2, MVFR2, FPMISC) >= 1; + return FIELD_EX32(id->mvfr2, MVFR2, FPMISC) >= 1; } static inline bool isar_feature_aa32_vcvt_dr(const ARMISARegisters *id) { - return FIELD_EX64(id->mvfr2, MVFR2, FPMISC) >= 2; + return FIELD_EX32(id->mvfr2, MVFR2, FPMISC) >= 2; } static inline bool isar_feature_aa32_vrint(const ARMISARegisters *id) { - return FIELD_EX64(id->mvfr2, MVFR2, FPMISC) >= 3; + return FIELD_EX32(id->mvfr2, MVFR2, FPMISC) >= 3; } static inline bool isar_feature_aa32_vminmaxnm(const ARMISARegisters *id) { - return FIELD_EX64(id->mvfr2, MVFR2, FPMISC) >= 4; + return FIELD_EX32(id->mvfr2, MVFR2, FPMISC) >= 4; } static inline bool isar_feature_aa32_pan(const ARMISARegisters *id) From patchwork Fri Feb 14 18:15:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183507 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2126898ile; Fri, 14 Feb 2020 10:19:48 -0800 (PST) X-Google-Smtp-Source: APXvYqxZ2bxzn+U3fpg5jjo8sJc4Mu5LUt69b3ycMK4Q3Glm0eTpJC5E6byp2V3TVr1L/WBl7RCw X-Received: by 2002:a05:620a:41b:: with SMTP id 27mr3880519qkp.349.1581704388294; Fri, 14 Feb 2020 10:19:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704388; cv=none; d=google.com; s=arc-20160816; b=DmZYaEiYlaxxcUdTU2kPDmE6ydLjUrwPCIJyxqSZ2y/fN5ImDfpVg22Ws/RUjfKyqp AcmTo69F5NfbKSuv8OmPxUmwrmbdVZBP85wiacGvOD4OPiYL3yIXy4xHiKIiKwgzslcW KW7XVp1ntLCI/OdG6Y6Ndb33oZGq39AflX/IyyINUXASD006VfeNdpGv6eRuj7DQ27GC UT20Kr0tcGXsw1myY1pCoZCBsX6OPdKfjYfQpWKUuSTq9zUvOsNUfnQrQ/3bNUUlbflo XvgLmeMEUazqyctlWBlImi10rWXCJ9OUr+BDtQXmwMIF4D8OjjGYthigUJMDLxx/TFuy 9JbQ== 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=NUF6GFUiKTx14rAhTmcqLDxmnGq1A1fKejGqoveF2Lc=; b=z32zx3OqmlALpmQ/5CgFmrHM40uGEcm4kk8mdSckXLe3ynEROwRabmm8ZS/tcvPrZf 0BUfLmi1QTiJm47xaDsBFmNCHXmeyBvQgQDpk8+gEpILtK1L0vAk9nKnYDxpvXWwmEpR DY7pMnwgCU2nDdbTRRSbzCVi9kYLVjLZGOq4VUIOFZDt4pAvRjsOEe8DI/sstYoQjFZD WdVmznl/0YqgA4DXFnxZAPn2rvmYHvCoimV72kWuFsSXVI1myKdBMQrcjnqAFXmh4B+V gHu7/pKY/zU5Wt3GnlDJ+bNZPZ9OQbkKDNORWMNloRgj8sXcXbJhcYjd4Br5xLxtMTob /T3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cVrQCDHF; 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 b5si2843516qtq.28.2020.02.14.10.19.48 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:19:48 -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=cVrQCDHF; 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]:43576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fZ5-00032D-NR for patch@linaro.org; Fri, 14 Feb 2020 13:19:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60770) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVK-0004Du-Fu for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:15:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVI-0008VC-QV for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:15:54 -0500 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:36870) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVI-0008Up-IV for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:15:52 -0500 Received: by mail-pl1-x641.google.com with SMTP id c23so4018197plz.4 for ; Fri, 14 Feb 2020 10:15:52 -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=NUF6GFUiKTx14rAhTmcqLDxmnGq1A1fKejGqoveF2Lc=; b=cVrQCDHFGN60z+AcOJDcrqN52UvAmXhlhWhM7f8XzcL9OyJeoSH/YlH63GXx0yxZbu g9DFvLbRbAjoiqZEANi8Fat2RparP5X+w6vDo6BNrKRryv1+YeMHZ0Gb18xWiNAPrpkq F4TxXapjBRDmWpMjDYuVuXadFC1TPfzvXTHikfmKy8iqNVL25sj5Yw+53f1c17Ugf1eZ Zdm1BzfaZbAq++GWXs3jJaGypYNFLCopasG7NfQ7wzDQ3MZnNyWawI46END2f4b4zKMs EzM7Hfl9+6glifyGJtYYE3MrTFl7jk8fghHe9JaB2NCE44vzJufyINgFCIv+mVmgRoi3 TAxw== 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=NUF6GFUiKTx14rAhTmcqLDxmnGq1A1fKejGqoveF2Lc=; b=T1ENW4PTC3a2uAwm2wZ0OyXFQO9Cn//vSMf90AD93v/BIX6aLlJ2ZmbZMyKf5Zc9ut xpJ9jfL5tNozKjqoT9gj2tzAIv1w8zYZh0V1imJCYT/Xe49qAPeUph+wXopNxGuTceMr oCXen8eaxhRi9W8d5x1YJ4ljxpARteyhjNCJ0nZVlWDABh24cV579AVNrkLhPrFKar1w nvXSg5zXg6TRa4laBl9ApgKAiRYliCPEDWhCabr082Yeo+V3bdaPJHCMOgqeON6GJFJ1 eWC+2GEtfC8+r32f3lvOjtBEioet2Lsp+GT7n3Nc2m5tbT1DKS1jVoAIcW3GtoyElJ2s 2YFg== X-Gm-Message-State: APjAAAWMmPomzkdRpZfdCVGnGpYHiF2hf+okD3mLzltBs4fq6lx2udYT h6xrC6X6keoRYM4npYx9xAaU9D6o8CI= X-Received: by 2002:a17:902:9b8a:: with SMTP id y10mr4357682plp.114.1581704151005; Fri, 14 Feb 2020 10:15:51 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:15:50 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 02/19] target/arm: Rename isar_feature_aa32_simd_r32 Date: Fri, 14 Feb 2020 10:15:30 -0800 Message-Id: <20200214181547.21408-3-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::641 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" The old name, isar_feature_aa32_fp_d32, does not reflect the MVFR0 field name, SIMDReg. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 2 +- target/arm/translate-vfp.inc.c | 52 +++++++++++++++++----------------- 2 files changed, 27 insertions(+), 27 deletions(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 28cb2be6fc..f7139db02d 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3412,7 +3412,7 @@ static inline bool isar_feature_aa32_fp16_arith(const ARMISARegisters *id) return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, FP) == 1; } -static inline bool isar_feature_aa32_fp_d32(const ARMISARegisters *id) +static inline bool isar_feature_aa32_simd_r32(const ARMISARegisters *id) { /* Return true if D16-D31 are implemented */ return FIELD_EX32(id->mvfr0, MVFR0, SIMDREG) >= 2; diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index bf90ac0e5b..96a1d727c6 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -201,7 +201,7 @@ static bool trans_VSEL(DisasContext *s, arg_VSEL *a) } /* UNDEF accesses to D16-D31 if they don't exist */ - if (dp && !dc_isar_feature(aa32_fp_d32, s) && + if (dp && !dc_isar_feature(aa32_simd_r32, s) && ((a->vm | a->vn | a->vd) & 0x10)) { return false; } @@ -334,7 +334,7 @@ static bool trans_VMINMAXNM(DisasContext *s, arg_VMINMAXNM *a) } /* UNDEF accesses to D16-D31 if they don't exist */ - if (dp && !dc_isar_feature(aa32_fp_d32, s) && + if (dp && !dc_isar_feature(aa32_simd_r32, s) && ((a->vm | a->vn | a->vd) & 0x10)) { return false; } @@ -420,7 +420,7 @@ static bool trans_VRINT(DisasContext *s, arg_VRINT *a) } /* UNDEF accesses to D16-D31 if they don't exist */ - if (dp && !dc_isar_feature(aa32_fp_d32, s) && + if (dp && !dc_isar_feature(aa32_simd_r32, s) && ((a->vm | a->vd) & 0x10)) { return false; } @@ -484,7 +484,7 @@ static bool trans_VCVT(DisasContext *s, arg_VCVT *a) } /* UNDEF accesses to D16-D31 if they don't exist */ - if (dp && !dc_isar_feature(aa32_fp_d32, s) && (a->vm & 0x10)) { + if (dp && !dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { return false; } @@ -556,7 +556,7 @@ static bool trans_VMOV_to_gp(DisasContext *s, arg_VMOV_to_gp *a) uint32_t offset; /* UNDEF accesses to D16-D31 if they don't exist */ - if (!dc_isar_feature(aa32_fp_d32, s) && (a->vn & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vn & 0x10)) { return false; } @@ -615,7 +615,7 @@ static bool trans_VMOV_from_gp(DisasContext *s, arg_VMOV_from_gp *a) uint32_t offset; /* UNDEF accesses to D16-D31 if they don't exist */ - if (!dc_isar_feature(aa32_fp_d32, s) && (a->vn & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vn & 0x10)) { return false; } @@ -662,7 +662,7 @@ static bool trans_VDUP(DisasContext *s, arg_VDUP *a) } /* UNDEF accesses to D16-D31 if they don't exist */ - if (!dc_isar_feature(aa32_fp_d32, s) && (a->vn & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vn & 0x10)) { return false; } @@ -912,7 +912,7 @@ static bool trans_VMOV_64_dp(DisasContext *s, arg_VMOV_64_dp *a) */ /* UNDEF accesses to D16-D31 if they don't exist */ - if (!dc_isar_feature(aa32_fp_d32, s) && (a->vm & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { return false; } @@ -978,7 +978,7 @@ static bool trans_VLDR_VSTR_dp(DisasContext *s, arg_VLDR_VSTR_dp *a) TCGv_i64 tmp; /* UNDEF accesses to D16-D31 if they don't exist */ - if (!dc_isar_feature(aa32_fp_d32, s) && (a->vd & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { return false; } @@ -1101,7 +1101,7 @@ static bool trans_VLDM_VSTM_dp(DisasContext *s, arg_VLDM_VSTM_dp *a) } /* UNDEF accesses to D16-D31 if they don't exist */ - if (!dc_isar_feature(aa32_fp_d32, s) && (a->vd + n) > 16) { + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd + n) > 16) { return false; } @@ -1309,7 +1309,7 @@ static bool do_vfp_3op_dp(DisasContext *s, VFPGen3OpDPFn *fn, TCGv_ptr fpst; /* UNDEF accesses to D16-D31 if they don't exist */ - if (!dc_isar_feature(aa32_fp_d32, s) && ((vd | vn | vm) & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && ((vd | vn | vm) & 0x10)) { return false; } @@ -1458,7 +1458,7 @@ static bool do_vfp_2op_dp(DisasContext *s, VFPGen2OpDPFn *fn, int vd, int vm) TCGv_i64 f0, fd; /* UNDEF accesses to D16-D31 if they don't exist */ - if (!dc_isar_feature(aa32_fp_d32, s) && ((vd | vm) & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && ((vd | vm) & 0x10)) { return false; } @@ -1822,7 +1822,7 @@ static bool trans_VFM_dp(DisasContext *s, arg_VFM_dp *a) } /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_fp_d32, s) && ((a->vd | a->vn | a->vm) & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && ((a->vd | a->vn | a->vm) & 0x10)) { return false; } @@ -1921,7 +1921,7 @@ static bool trans_VMOV_imm_dp(DisasContext *s, arg_VMOV_imm_dp *a) vd = a->vd; /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_fp_d32, s) && (vd & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && (vd & 0x10)) { return false; } @@ -2065,7 +2065,7 @@ static bool trans_VCMP_dp(DisasContext *s, arg_VCMP_dp *a) } /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_fp_d32, s) && ((a->vd | a->vm) & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && ((a->vd | a->vm) & 0x10)) { return false; } @@ -2138,7 +2138,7 @@ static bool trans_VCVT_f64_f16(DisasContext *s, arg_VCVT_f64_f16 *a) } /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_fp_d32, s) && (a->vd & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { return false; } @@ -2204,7 +2204,7 @@ static bool trans_VCVT_f16_f64(DisasContext *s, arg_VCVT_f16_f64 *a) } /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_fp_d32, s) && (a->vm & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { return false; } @@ -2264,7 +2264,7 @@ static bool trans_VRINTR_dp(DisasContext *s, arg_VRINTR_dp *a) } /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_fp_d32, s) && ((a->vd | a->vm) & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && ((a->vd | a->vm) & 0x10)) { return false; } @@ -2325,7 +2325,7 @@ static bool trans_VRINTZ_dp(DisasContext *s, arg_VRINTZ_dp *a) } /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_fp_d32, s) && ((a->vd | a->vm) & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && ((a->vd | a->vm) & 0x10)) { return false; } @@ -2384,7 +2384,7 @@ static bool trans_VRINTX_dp(DisasContext *s, arg_VRINTX_dp *a) } /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_fp_d32, s) && ((a->vd | a->vm) & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && ((a->vd | a->vm) & 0x10)) { return false; } @@ -2412,7 +2412,7 @@ static bool trans_VCVT_sp(DisasContext *s, arg_VCVT_sp *a) TCGv_i32 vm; /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_fp_d32, s) && (a->vd & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { return false; } @@ -2440,7 +2440,7 @@ static bool trans_VCVT_dp(DisasContext *s, arg_VCVT_dp *a) TCGv_i32 vd; /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_fp_d32, s) && (a->vm & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { return false; } @@ -2494,7 +2494,7 @@ static bool trans_VCVT_int_dp(DisasContext *s, arg_VCVT_int_dp *a) TCGv_ptr fpst; /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_fp_d32, s) && (a->vd & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { return false; } @@ -2534,7 +2534,7 @@ static bool trans_VJCVT(DisasContext *s, arg_VJCVT *a) } /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_fp_d32, s) && (a->vm & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { return false; } @@ -2627,7 +2627,7 @@ static bool trans_VCVT_fix_dp(DisasContext *s, arg_VCVT_fix_dp *a) } /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_fp_d32, s) && (a->vd & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { return false; } @@ -2723,7 +2723,7 @@ static bool trans_VCVT_dp_int(DisasContext *s, arg_VCVT_dp_int *a) TCGv_ptr fpst; /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_fp_d32, s) && (a->vm & 0x10)) { + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { return false; } From patchwork Fri Feb 14 18:15:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183506 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2126863ile; Fri, 14 Feb 2020 10:19:46 -0800 (PST) X-Google-Smtp-Source: APXvYqzbZnX++EMLnb7Y+IpYkfM/womoVU+XPaZgj46jPAEXLr/mXEIJeLfinvOhTcFRg1+39Yz8 X-Received: by 2002:a0c:fe8e:: with SMTP id d14mr3371498qvs.106.1581704386079; Fri, 14 Feb 2020 10:19:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704386; cv=none; d=google.com; s=arc-20160816; b=g1wb2Z0FNN5Gwkk0EUAk4s2BYgqlSPFBxBtPQSDAtfKl5i/ZIw5l2RJUryQhEpAUJ/ CBHMRF0hbiV6h58IDNBgLt+ENQp3DEN5kGKEU1Y9TKewVAASRsR2wKCI0r/l8/XwtoXY FaHJjgjw/MVDSLgMGaTgMglAgahQi55dlJ3OFyJBTzS6dmq+P1JVnE1Yh2YKbBVFZJG8 J+7HZwFQAbSFFFtrEHoqZn5u57zxVjDR7UutHNZ2qMWQT8m3x0XqXHVXSC5wREP+WDRk Z/MYxlqFIjJhOtMC1FRPwN8be/KOWPleMPE7ierFLF7ozzp80swMWBNrfdvaGQAYzkEe gHRw== 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=5fLn0UXMjSHE5U0IwLqHf4IaIEWWE0KQrcA+POHthnY=; b=CgA5jCTDLonesPaxvokosJ4UnbPf7Femdl6/y+qQa7PukgHjV+tPZ4Si05yYCtXNx6 Em5Fkrc5vxT+oqT/EPtyw9BB06DBfVBKWpdTCfIOepFhA8fbTx9aybRuAaxPyMeV7m43 D4ceoJKD3dORoDv8x4glL5M2wtTsgGtVR91Wy4vmu93le6QedBPDelZxvbdUoH6hdVQj I6FSP9p/1ErvKXeSJ57SE+5xm5TY/HsIKmCdITjwy4WWgXTXhZdBnCqBimkRY4bQ7Cy+ 0+j40SU9TGhKmo8NgV1VhMFt7S+9v4v+zMn7JTIRiIyJi1lejEUtEcmO1v/wr4hIoWJ3 7yIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=do1S7mng; 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 v78si3480508qkb.58.2020.02.14.10.19.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:19:46 -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=do1S7mng; 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]:43572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fZ3-0002xv-IP for patch@linaro.org; Fri, 14 Feb 2020 13:19:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60779) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVL-0004Gp-2T for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:15:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVJ-0008W5-Te for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:15:54 -0500 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]:54489) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVJ-0008VZ-Mv for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:15:53 -0500 Received: by mail-pj1-x1043.google.com with SMTP id dw13so4186236pjb.4 for ; Fri, 14 Feb 2020 10:15:53 -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=5fLn0UXMjSHE5U0IwLqHf4IaIEWWE0KQrcA+POHthnY=; b=do1S7mngwHwsUTsAmswxZIjWpSdFYZnLCYR1NddDX+iS1/Gw+R31l747vG8/0z7ORB IEajb831aH8oM3BStDZawaBfh9s8jYBzxWVfQ1qEqNrrQyxpNANIWHcFJuL9izQpaHAi Wew71zSPptaqJuawcYh9Oi4NpZ+9Y2bY09cGHQzyPM/5ilGYWDZQ2+D/xQ9KF+EiaCli 1MGfjVyOEjHrFY6Ru+vnZfmUctubMIEVgNwjXyCaRuG/WRXuWeLyiRuwLpafwJ9IsfLe Z7rTnHQnt4lofiG5POoPUS2SKzZ2iXdOk7oUZf29ZdQH7ej/XxfOqs3eR0mSbrdnI8Hh RhrA== 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=5fLn0UXMjSHE5U0IwLqHf4IaIEWWE0KQrcA+POHthnY=; b=nzaQXBDLE9Uj8AyEiXzpil6kKUrGXtNTZxYuBBxzgoK0IbYeV/2UgC/52IAHMt9lO5 zK65ApjMcS4Ug59Tb+/JOjP88IIbtpiD2erkv2jTwlNFSqbljf5jAm7KTEwS++JNDHtf LT3z1rVViWFmFKeYzKHQMCmCjCrMVXz7aec9QwaBJyupeQeQfxIRl1EHxgZoKmaR8b8y XOEvOZt4UNQKQiZn1xnfT8Ld44+n14gn02mEDSuCpixSdoGQce6eB5frM/pRNOY9fGvl HcwgoiTE9/CQ1dcEWQ7F5r3X45EU8ggfmCzOU7t/hbkpwKy8EBMubDf8cuFFV8B3hcJC eo3A== X-Gm-Message-State: APjAAAUDtLrxa+CSs+w0kS/4OAccIgJ1EbkVeT0NoAAqL23kz4nxL3N0 ZecrfBTwlsgZgZuP5T4mdF3PT5nfXsE= X-Received: by 2002:a17:902:8f94:: with SMTP id z20mr4695199plo.62.1581704152332; Fri, 14 Feb 2020 10:15:52 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:15:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 03/19] target/arm: Use isar_feature_aa32_simd_r32 more places Date: Fri, 14 Feb 2020 10:15:31 -0800 Message-Id: <20200214181547.21408-4-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" Many uses of ARM_FEATURE_VFP3 are testing for the number of simd registers implemented. Use the proper test vs MVCR0.SIMDReg. Signed-off-by: Richard Henderson --- target/arm/cpu.c | 9 ++++----- target/arm/helper.c | 13 ++++++------- target/arm/translate.c | 2 +- 3 files changed, 11 insertions(+), 13 deletions(-) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/target/arm/cpu.c b/target/arm/cpu.c index de733aceeb..f0bd419dd8 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1009,11 +1009,10 @@ static void arm_cpu_dump_state(CPUState *cs, FILE *f, int flags) if (flags & CPU_DUMP_FPU) { int numvfpregs = 0; - if (arm_feature(env, ARM_FEATURE_VFP)) { - numvfpregs += 16; - } - if (arm_feature(env, ARM_FEATURE_VFP3)) { - numvfpregs += 16; + if (cpu_isar_feature(aa32_simd_r32, cpu)) { + numvfpregs = 32; + } else if (arm_feature(env, ARM_FEATURE_VFP)) { + numvfpregs = 16; } for (i = 0; i < numvfpregs; i++) { uint64_t v = *aa32_vfp_dreg(env, i); diff --git a/target/arm/helper.c b/target/arm/helper.c index 366dbcf460..0eeedc3c18 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -49,10 +49,10 @@ static void switch_mode(CPUARMState *env, int mode); static int vfp_gdb_get_reg(CPUARMState *env, uint8_t *buf, int reg) { - int nregs; + ARMCPU *cpu = env_archcpu(env); + int nregs = cpu_isar_feature(aa32_simd_r32, cpu) ? 32 : 16; /* VFP data registers are always little-endian. */ - nregs = arm_feature(env, ARM_FEATURE_VFP3) ? 32 : 16; if (reg < nregs) { stq_le_p(buf, *aa32_vfp_dreg(env, reg)); return 8; @@ -77,9 +77,9 @@ static int vfp_gdb_get_reg(CPUARMState *env, uint8_t *buf, int reg) static int vfp_gdb_set_reg(CPUARMState *env, uint8_t *buf, int reg) { - int nregs; + ARMCPU *cpu = env_archcpu(env); + int nregs = cpu_isar_feature(aa32_simd_r32, cpu) ? 32 : 16; - nregs = arm_feature(env, ARM_FEATURE_VFP3) ? 32 : 16; if (reg < nregs) { *aa32_vfp_dreg(env, reg) = ldq_le_p(buf); return 8; @@ -905,8 +905,7 @@ static void cpacr_write(CPUARMState *env, const ARMCPRegInfo *ri, /* VFPv3 and upwards with NEON implement 32 double precision * registers (D0-D31). */ - if (!arm_feature(env, ARM_FEATURE_NEON) || - !arm_feature(env, ARM_FEATURE_VFP3)) { + if (!cpu_isar_feature(aa32_simd_r32, env_archcpu(env))) { /* D32DIS [30] is RAO/WI if D16-31 are not implemented. */ value |= (1 << 30); } @@ -7755,7 +7754,7 @@ void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu) } else if (arm_feature(env, ARM_FEATURE_NEON)) { gdb_register_coprocessor(cs, vfp_gdb_get_reg, vfp_gdb_set_reg, 51, "arm-neon.xml", 0); - } else if (arm_feature(env, ARM_FEATURE_VFP3)) { + } else if (cpu_isar_feature(aa32_simd_r32, cpu)) { gdb_register_coprocessor(cs, vfp_gdb_get_reg, vfp_gdb_set_reg, 35, "arm-vfp3.xml", 0); } else if (arm_feature(env, ARM_FEATURE_VFP)) { diff --git a/target/arm/translate.c b/target/arm/translate.c index 20f89ace2f..3b9bf13933 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -2612,7 +2612,7 @@ static int disas_dsp_insn(DisasContext *s, uint32_t insn) #define VFP_SREG(insn, bigbit, smallbit) \ ((VFP_REG_SHR(insn, bigbit - 1) & 0x1e) | (((insn) >> (smallbit)) & 1)) #define VFP_DREG(reg, insn, bigbit, smallbit) do { \ - if (arm_dc_feature(s, ARM_FEATURE_VFP3)) { \ + if (dc_isar_feature(aa32_simd_r32, s)) { \ reg = (((insn) >> (bigbit)) & 0x0f) \ | (((insn) >> ((smallbit) - 4)) & 0x10); \ } else { \ From patchwork Fri Feb 14 18:15:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183511 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2128222ile; Fri, 14 Feb 2020 10:21:17 -0800 (PST) X-Google-Smtp-Source: APXvYqzwKsMl3nVZ/p0vTyUdgf9otoCGzwZN2F3UKOz8UtkmIKD/Er/hclPMP2AWDJHI0xHL7gD0 X-Received: by 2002:a37:9d4b:: with SMTP id g72mr3660329qke.195.1581704477409; Fri, 14 Feb 2020 10:21:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704477; cv=none; d=google.com; s=arc-20160816; b=MZnkJf0O0dzbRHECJYSx3sFJ6+f4UkiqOKOJiJR0EfHPBqTI8Xc5Jdi8Sweq1DVB01 s/8OkAGBLp4iaEtXkcaQO/weyD1mGKugaH4mXz/NavqXGqPeXYoqOOQM1rGH5mloCuyU 7ff8c6AIFfu6Ot8xOvtCZ76qbDhCHgXBHGKjQqkcPRGDWYYxXAwkvV083EpjcjAaw+B9 Ms5dkFDLqDJwYHMhRmzHQw+JueK6VzWcJTqj+o3u3Q2APj+hlSVMOUevb+/wYfeuNxUc gnIR7vpeBI/owD38R8rrXRlp8JvDuOIJYsPogEJ1/RmGNi3EMLI7i+8yA0+Ml144LQGg rPkg== 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=WVNZD9ad+przMHF0OKz5odOrKHpFBH9KJ8cJLa9N9Zg=; b=XiTEQz5eHpN0ua3FqPDZ7IuM01SOrL6oQZbaNkhboPkmaeeg4u1p9/n3c74N6O7ySm zCkFthMGofEffWqy0PAApBoOikGPDDq4V09c7uJp2No0esHs3H31kDUxRWCPrg6NDkbA KTtMViqP0TuGqSEdr+GXJaXHSJpZz2FLqgc1uMoQyZ5907BYQEAerAwOYH9os9YGXFCU oaARlLeeKrhIgScCND7/bNdL5V2H69n57mPVWzkqR5EUmTyd0cGJMn1xojRVKoRnRHu8 8wJ6nbiQYm/We6KJhqhgwTxTk+0LrHymHgoZsGmx/4ov4/gARe6I+HLwkkTe+V0Utf7x vPLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KT9j2Mfj; 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 a7si3083374qtm.175.2020.02.14.10.21.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:21:17 -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=KT9j2Mfj; 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]:43644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2faW-0006hL-Ui for patch@linaro.org; Fri, 14 Feb 2020 13:21:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60794) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVL-0004I9-Sp for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:15:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVK-00004z-UH for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:15:55 -0500 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:43505) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVK-0008WF-Om for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:15:54 -0500 Received: by mail-pl1-x643.google.com with SMTP id p11so4004581plq.10 for ; Fri, 14 Feb 2020 10:15:54 -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=WVNZD9ad+przMHF0OKz5odOrKHpFBH9KJ8cJLa9N9Zg=; b=KT9j2MfjOXeXJVi7VqQjJ+K0N41/v9gusJAx9FpN1q/USdFibu9jrzKIfZM0v4a2Ok p2eySqyoiz7Yiri6CiPyvpxk3JDU9HKC0D452cUFpm+mk6/vfGiBRvbdaGRze4ih7+B4 UFfVJtA0PM45PmHV0uFOEWHXmTEzR6ScLf6BS6zAo8LWv23q1vHsigLr00ahcDX4mhVv ZkO2cJZv4RC4QlzNNtGsTV+BpxuHVjss7Lyoq7JiZ0hjzPJlP3QRWkVK+3wshi7pSUuy IQxR5g5P5y9cBOVLB5jEfuY1uIePXS8MN9MPPmLTAXC8sQr7w30P9MPCsSszHPpPZK4F /zcw== 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=WVNZD9ad+przMHF0OKz5odOrKHpFBH9KJ8cJLa9N9Zg=; b=GsEGPIMnjym9xZK39gVAI3jx85OYvWwsVu0ToyZVDtjVzcVxZQd+5+gxO1UIvBfM0F XGEJkUGR3Nk6rO2hkS5Z5PQF9S12eEVoinRka6XCCbPsBebFRzCFdqFStavKU1AjbV9I fgR4kEOSEh6t+2vncHXQ0VB7INAgE/IZAfoDilyJyJuzZAq27OQf4u+lXJVmdOjtJeuE Mx3LAD26Pyo/51pOAAdz6qY1q4qTqRPbmZtbG0bQp8leoxUZ+QSFBq44mM8vrWKZE5l9 LnNKjkp069ONAeQmtuvVP5gy3gDolkU8GAdb+V9+5kav1QXT742pWuf4Ip9WRqnBpQI9 E00A== X-Gm-Message-State: APjAAAVjhJyeJu+HsxZFbX88+9yKSis1FD1IZjViAArL7ffr3PICzkPL 6fZcZutBcxnqZXxWR1DAyYYVieieXnc= X-Received: by 2002:a17:902:6ac7:: with SMTP id i7mr4479347plt.66.1581704153452; Fri, 14 Feb 2020 10:15:53 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:15:52 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 04/19] target/arm: Set MVFR0.FPSP for ARMv5 cpus Date: Fri, 14 Feb 2020 10:15:32 -0800 Message-Id: <20200214181547.21408-5-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::643 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 are going to convert FEATURE tests to ISAR tests, so FPSP needs to be set for these cpus, like we have already for FPDP. Signed-off-by: Richard Henderson --- target/arm/cpu.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/target/arm/cpu.c b/target/arm/cpu.c index f0bd419dd8..92006e56c8 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1869,10 +1869,11 @@ static void arm926_initfn(Object *obj) */ cpu->isar.id_isar1 = FIELD_DP32(cpu->isar.id_isar1, ID_ISAR1, JAZELLE, 1); /* - * Similarly, we need to set MVFR0 fields to enable double precision - * and short vector support even though ARMv5 doesn't have this register. + * Similarly, we need to set MVFR0 fields to enable vfp and short vector + * support even though ARMv5 doesn't have this register. */ cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPSHVEC, 1); + cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPSP, 1); cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPDP, 1); } @@ -1911,10 +1912,11 @@ static void arm1026_initfn(Object *obj) */ cpu->isar.id_isar1 = FIELD_DP32(cpu->isar.id_isar1, ID_ISAR1, JAZELLE, 1); /* - * Similarly, we need to set MVFR0 fields to enable double precision - * and short vector support even though ARMv5 doesn't have this register. + * Similarly, we need to set MVFR0 fields to enable vfp and short vector + * support even though ARMv5 doesn't have this register. */ cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPSHVEC, 1); + cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPSP, 1); cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPDP, 1); { From patchwork Fri Feb 14 18:15:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183515 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2129527ile; Fri, 14 Feb 2020 10:22:41 -0800 (PST) X-Google-Smtp-Source: APXvYqzGe8NqfL/ZWnGRt9P50/54k2fjfXaFZRdIVMtCSBFESiRLmasLOqhGMoPNHYKDrXCp0T2H X-Received: by 2002:ac8:3fa9:: with SMTP id d38mr3431918qtk.333.1581704561435; Fri, 14 Feb 2020 10:22:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704561; cv=none; d=google.com; s=arc-20160816; b=s+JG83/B3ANvH7Z06Fss6NLJDOuu5A5LF1GdPH0yZpS6xibTp4yrEisodFb34soMAX SANpxFTUyCYX+o04egVShtPFbpzPGFC1YGRWCA7wE3kqbw6QWTB9mslDf+kQdn7vsRPG D+VHdjp9XTuN3AjZhko2JpVwnIIVYIpHAVICDnxns32JDBiP0rjoyztkxuW9tvHdWgDy WBFyfl9NsykbbPKo6U5cP2TR+VpqTh6S+UqrnuWLEBJEEzkXLdJh/WOxAg7R/S2Kgll5 hsnAHPjl1hvYt3irLCbUAr5rFXlwhmCZqMSbMZqbX+Z7hcx7CHtuQ7X47zNjb1AfebNI 72VA== 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=yuUusOCzpkaCF7XSY4s6jOjJNMax37vMLlyW3jWBGpE=; b=BKQN2E5JcQpzUdAmyLYafw20a1wBlkTtNWmRt7DI0SEvllF94ERh82p58I3KU4E36E /8Eo1ldPjAORW3duT3h34bhuHeCkCaNMBSTWyRJ/1lrftsubsEE8EdhObVM9KhcNrDVo YIVD7cMvcRernmjbQAJEzHhj7J+7bQYs49LtSkcQ/BAJMVJMj2XeEMEpo+DdSgLhYS8G kO0TcFgXwd/58U8/T8HYO6p6lk9l+xDQKohcjC71f2v68uTRKhUg2o72qamZtvH53B+3 maScn/aWCiD7VTHyZteyFyNqSmCUmOFO7upbOVw0jSMNni/aMgKsOD8ZgD0Hlv2neQdH pRbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RwlhFhZI; 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 o18si3375766qkh.26.2020.02.14.10.22.41 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:22:41 -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=RwlhFhZI; 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]:43700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fbs-0001EF-Vo for patch@linaro.org; Fri, 14 Feb 2020 13:22:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60826) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVO-0004Kp-PL for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVM-000062-S1 for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:15:58 -0500 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:36589) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVM-00005e-Ja for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:15:56 -0500 Received: by mail-pg1-x544.google.com with SMTP id d9so5353830pgu.3 for ; Fri, 14 Feb 2020 10:15:56 -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=yuUusOCzpkaCF7XSY4s6jOjJNMax37vMLlyW3jWBGpE=; b=RwlhFhZIemAzDANaXXLgLvrWJdhU1rS2aHWE37Z5bcpzOPNKprdcW+w16M49XbCVkq ZxrIKzCnjgC5IOta7QZpQSS9PJCsQl9YggHWwSf0VWqxYpSo1gpz2SOihf2svhVvI6ZG 2fLNTRyWKwUofQFyMWX/9ZoOBF/f57IllmX2/HcMG+4nEXV0QU8nUzOlxU3mMmhpXjhZ oHFVxpxxs10iqAG+Qi1igT3HInBjj0yt5DymxJ2cdVYHxchKnhxXnjbRaPtECeD13h02 XFPI6qtAgmr5vxeIwtJ4VNkVaqpNS6zsYf87g0fODRPAltR4yeDf808qx279TeTYpyYb Fduw== 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=yuUusOCzpkaCF7XSY4s6jOjJNMax37vMLlyW3jWBGpE=; b=cRPzQRnyxoebGFX8lK1qmw/kumj5/R2Y8cHvr2Iflf9mI0RakxI4wdcaSks03pZjRc kHJ/AcwOHEdryHv439V/9VzXPxusvwG1jhws+qN8OJUnAijTiSaW2zMDdvu3yYf5zKoX zDfg0uStLtuXt7o99OD0DSjZvEzrIB4FaWXtU4siFILTlejNyUTdnCx7mxvbXzPWoG4Y q6xCTKthjR753UoCXUOUWOFBjzPlzIlotNafpJHjycti/yn2lT1NCM62uFjbd21Rh3gm wNcmc4ikJq51R7fVB7wK7sWppFtY++Ey7ngwOAyH/RyFZMPWhiTd7Izdn4ij7fcY8fBn 6u2g== X-Gm-Message-State: APjAAAWMNsm8B50PCT6e9PfKv3mkGOTER0AI9THh2ZDWPbmQosdAYcla 7PKdG5GKURj6BoRSAYS5DYe67q0SyrQ= X-Received: by 2002:a65:4b83:: with SMTP id t3mr4718725pgq.195.1581704154773; Fri, 14 Feb 2020 10:15:54 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:15:54 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 05/19] target/arm: Add isar_feature_aa32_simd_r16 Date: Fri, 14 Feb 2020 10:15:33 -0800 Message-Id: <20200214181547.21408-6-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::544 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" Use this in the places that were checking ARM_FEATURE_VFP, and are obviously testing for the existance of the register set as opposed to testing for some particular instruction extension. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 6 ++++++ hw/intc/armv7m_nvic.c | 20 ++++++++++---------- linux-user/arm/signal.c | 4 ++-- target/arm/arch_dump.c | 11 ++++++----- target/arm/cpu.c | 8 ++++---- target/arm/helper.c | 4 ++-- target/arm/m_helper.c | 11 ++++++----- target/arm/machine.c | 3 +-- 8 files changed, 37 insertions(+), 30 deletions(-) -- 2.20.1 diff --git a/target/arm/cpu.h b/target/arm/cpu.h index f7139db02d..85b90eaed2 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3412,6 +3412,12 @@ static inline bool isar_feature_aa32_fp16_arith(const ARMISARegisters *id) return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, FP) == 1; } +static inline bool isar_feature_aa32_simd_r16(const ARMISARegisters *id) +{ + /* Return true if D0-D15 are implemented */ + return FIELD_EX32(id->mvfr0, MVFR0, SIMDREG) > 0; +} + static inline bool isar_feature_aa32_simd_r32(const ARMISARegisters *id) { /* Return true if D16-D31 are implemented */ diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c index f9e0eeaace..e5da962bb6 100644 --- a/hw/intc/armv7m_nvic.c +++ b/hw/intc/armv7m_nvic.c @@ -1262,12 +1262,12 @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) case 0xd84: /* CSSELR */ return cpu->env.v7m.csselr[attrs.secure]; case 0xd88: /* CPACR */ - if (!arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (!cpu_isar_feature(aa32_simd_r16, cpu)) { return 0; } return cpu->env.v7m.cpacr[attrs.secure]; case 0xd8c: /* NSACR */ - if (!attrs.secure || !arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (!attrs.secure || !cpu_isar_feature(aa32_simd_r16, cpu)) { return 0; } return cpu->env.v7m.nsacr; @@ -1417,7 +1417,7 @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) } return cpu->env.v7m.sfar; case 0xf34: /* FPCCR */ - if (!arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (!cpu_isar_feature(aa32_simd_r16, cpu)) { return 0; } if (attrs.secure) { @@ -1444,12 +1444,12 @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) return value; } case 0xf38: /* FPCAR */ - if (!arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (!cpu_isar_feature(aa32_simd_r16, cpu)) { return 0; } return cpu->env.v7m.fpcar[attrs.secure]; case 0xf3c: /* FPDSCR */ - if (!arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (!cpu_isar_feature(aa32_simd_r16, cpu)) { return 0; } return cpu->env.v7m.fpdscr[attrs.secure]; @@ -1711,13 +1711,13 @@ static void nvic_writel(NVICState *s, uint32_t offset, uint32_t value, } break; case 0xd88: /* CPACR */ - if (arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_simd_r16, cpu)) { /* We implement only the Floating Point extension's CP10/CP11 */ cpu->env.v7m.cpacr[attrs.secure] = value & (0xf << 20); } break; case 0xd8c: /* NSACR */ - if (attrs.secure && arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (attrs.secure && cpu_isar_feature(aa32_simd_r16, cpu)) { /* We implement only the Floating Point extension's CP10/CP11 */ cpu->env.v7m.nsacr = value & (3 << 10); } @@ -1951,7 +1951,7 @@ static void nvic_writel(NVICState *s, uint32_t offset, uint32_t value, break; } case 0xf34: /* FPCCR */ - if (arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_simd_r16, cpu)) { /* Not all bits here are banked. */ uint32_t fpccr_s; @@ -2005,13 +2005,13 @@ static void nvic_writel(NVICState *s, uint32_t offset, uint32_t value, } break; case 0xf38: /* FPCAR */ - if (arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_simd_r16, cpu)) { value &= ~7; cpu->env.v7m.fpcar[attrs.secure] = value; } break; case 0xf3c: /* FPDSCR */ - if (arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_simd_r16, cpu)) { value &= 0x07c00000; cpu->env.v7m.fpdscr[attrs.secure] = value; } diff --git a/linux-user/arm/signal.c b/linux-user/arm/signal.c index b0e753801b..2871a7cc21 100644 --- a/linux-user/arm/signal.c +++ b/linux-user/arm/signal.c @@ -346,7 +346,7 @@ static void setup_sigframe_v2(struct target_ucontext_v2 *uc, setup_sigcontext(&uc->tuc_mcontext, env, set->sig[0]); /* Save coprocessor signal frame. */ regspace = uc->tuc_regspace; - if (arm_feature(env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_simd_r16, env_archcpu(env))) { regspace = setup_sigframe_v2_vfp(regspace, env); } if (arm_feature(env, ARM_FEATURE_IWMMXT)) { @@ -671,7 +671,7 @@ static int do_sigframe_return_v2(CPUARMState *env, /* Restore coprocessor signal frame */ regspace = uc->tuc_regspace; - if (arm_feature(env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_simd_r16, env_archcpu(env))) { regspace = restore_sigframe_v2_vfp(env, regspace); if (!regspace) { return 1; diff --git a/target/arm/arch_dump.c b/target/arm/arch_dump.c index 2345dec3c2..a5a4f4e1f8 100644 --- a/target/arm/arch_dump.c +++ b/target/arm/arch_dump.c @@ -363,9 +363,11 @@ int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, int cpuid, void *opaque) { struct arm_note note; - CPUARMState *env = &ARM_CPU(cs)->env; + ARMCPU *cpu = ARM_CPU(cs); + CPUARMState *env = &cpu->env; DumpState *s = opaque; - int ret, i, fpvalid = !!arm_feature(env, ARM_FEATURE_VFP); + int ret, i; + bool fpvalid = cpu_isar_feature(aa32_simd_r16, cpu); arm_note_init(¬e, s, "CORE", 5, NT_PRSTATUS, sizeof(note.prstatus)); @@ -444,7 +446,6 @@ int cpu_get_dump_info(ArchDumpInfo *info, ssize_t cpu_get_note_size(int class, int machine, int nr_cpus) { ARMCPU *cpu = ARM_CPU(first_cpu); - CPUARMState *env = &cpu->env; size_t note_size; if (class == ELFCLASS64) { @@ -452,12 +453,12 @@ ssize_t cpu_get_note_size(int class, int machine, int nr_cpus) note_size += AARCH64_PRFPREG_NOTE_SIZE; #ifdef TARGET_AARCH64 if (cpu_isar_feature(aa64_sve, cpu)) { - note_size += AARCH64_SVE_NOTE_SIZE(env); + note_size += AARCH64_SVE_NOTE_SIZE(&cpu->env); } #endif } else { note_size = ARM_PRSTATUS_NOTE_SIZE; - if (arm_feature(env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_simd_r16, cpu)) { note_size += ARM_VFP_NOTE_SIZE; } } diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 92006e56c8..8d3eff8cb3 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -293,7 +293,7 @@ static void arm_cpu_reset(CPUState *s) env->v7m.ccr[M_REG_S] |= R_V7M_CCR_UNALIGN_TRP_MASK; } - if (arm_feature(env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_simd_r16, cpu)) { env->v7m.fpccr[M_REG_NS] = R_V7M_FPCCR_ASPEN_MASK; env->v7m.fpccr[M_REG_S] = R_V7M_FPCCR_ASPEN_MASK | R_V7M_FPCCR_LSPEN_MASK | R_V7M_FPCCR_S_MASK; @@ -1011,7 +1011,7 @@ static void arm_cpu_dump_state(CPUState *cs, FILE *f, int flags) int numvfpregs = 0; if (cpu_isar_feature(aa32_simd_r32, cpu)) { numvfpregs = 32; - } else if (arm_feature(env, ARM_FEATURE_VFP)) { + } else if (cpu_isar_feature(aa32_simd_r16, cpu)) { numvfpregs = 16; } for (i = 0; i < numvfpregs; i++) { @@ -1260,7 +1260,7 @@ void arm_cpu_post_init(Object *obj) * KVM does not currently allow us to lie to the guest about its * ID/feature registers, so the guest always sees what the host has. */ - if (arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_simd_r16, cpu)) { cpu->has_vfp = true; if (!kvm_enabled()) { qdev_property_add_static(DEVICE(obj), &arm_cpu_has_vfp_property); @@ -1634,7 +1634,7 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) * We rely on no XScale CPU having VFP so we can use the same bits in the * TB flags field for VECSTRIDE and XSCALE_CPAR. */ - assert(!(arm_feature(env, ARM_FEATURE_VFP) && + assert(!(cpu_isar_feature(aa32_simd_r16, cpu) && arm_feature(env, ARM_FEATURE_XSCALE))); if (arm_feature(env, ARM_FEATURE_V7) && diff --git a/target/arm/helper.c b/target/arm/helper.c index 0eeedc3c18..3f0b8eee8c 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -893,7 +893,7 @@ static void cpacr_write(CPUARMState *env, const ARMCPRegInfo *ri, * ASEDIS [31] and D32DIS [30] are both UNK/SBZP without VFP. * TRCDIS [28] is RAZ/WI since we do not implement a trace macrocell. */ - if (arm_feature(env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_simd_r16, env_archcpu(env))) { /* VFP coprocessor: cp10 & cp11 [23:20] */ mask |= (1 << 31) | (1 << 30) | (0xf << 20); @@ -7757,7 +7757,7 @@ void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu) } else if (cpu_isar_feature(aa32_simd_r32, cpu)) { gdb_register_coprocessor(cs, vfp_gdb_get_reg, vfp_gdb_set_reg, 35, "arm-vfp3.xml", 0); - } else if (arm_feature(env, ARM_FEATURE_VFP)) { + } else if (cpu_isar_feature(aa32_simd_r16, cpu)) { gdb_register_coprocessor(cs, vfp_gdb_get_reg, vfp_gdb_set_reg, 19, "arm-vfp.xml", 0); } diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c index 33d414a684..c024970221 100644 --- a/target/arm/m_helper.c +++ b/target/arm/m_helper.c @@ -738,7 +738,8 @@ static uint32_t v7m_integrity_sig(CPUARMState *env, uint32_t lr) */ uint32_t sig = 0xfefa125a; - if (!arm_feature(env, ARM_FEATURE_VFP) || (lr & R_V7M_EXCRET_FTYPE_MASK)) { + if (!cpu_isar_feature(aa32_simd_r16, env_archcpu(env)) + || (lr & R_V7M_EXCRET_FTYPE_MASK)) { sig |= 1; } return sig; @@ -841,7 +842,7 @@ static void v7m_exception_taken(ARMCPU *cpu, uint32_t lr, bool dotailchain, if (dotailchain) { /* Sanitize LR FType and PREFIX bits */ - if (!arm_feature(env, ARM_FEATURE_VFP)) { + if (!cpu_isar_feature(aa32_simd_r16, cpu)) { lr |= R_V7M_EXCRET_FTYPE_MASK; } lr = deposit32(lr, 24, 8, 0xff); @@ -1373,7 +1374,7 @@ static void do_v7m_exception_exit(ARMCPU *cpu) ftype = excret & R_V7M_EXCRET_FTYPE_MASK; - if (!arm_feature(env, ARM_FEATURE_VFP) && !ftype) { + if (!ftype && !cpu_isar_feature(aa32_simd_r16, cpu)) { qemu_log_mask(LOG_GUEST_ERROR, "M profile: zero FTYPE in exception " "exit PC value 0x%" PRIx32 " is UNPREDICTABLE " "if FPU not present\n", @@ -2450,7 +2451,7 @@ void HELPER(v7m_msr)(CPUARMState *env, uint32_t maskreg, uint32_t val) * SFPA is RAZ/WI from NS. FPCA is RO if NSACR.CP10 == 0, * RES0 if the FPU is not present, and is stored in the S bank */ - if (arm_feature(env, ARM_FEATURE_VFP) && + if (cpu_isar_feature(aa32_simd_r16, env_archcpu(env)) && extract32(env->v7m.nsacr, 10, 1)) { env->v7m.control[M_REG_S] &= ~R_V7M_CONTROL_FPCA_MASK; env->v7m.control[M_REG_S] |= val & R_V7M_CONTROL_FPCA_MASK; @@ -2565,7 +2566,7 @@ void HELPER(v7m_msr)(CPUARMState *env, uint32_t maskreg, uint32_t val) env->v7m.control[env->v7m.secure] &= ~R_V7M_CONTROL_NPRIV_MASK; env->v7m.control[env->v7m.secure] |= val & R_V7M_CONTROL_NPRIV_MASK; } - if (arm_feature(env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_simd_r16, env_archcpu(env))) { /* * SFPA is RAZ/WI from NS or if no FPU. * FPCA is RO if NSACR.CP10 == 0, RES0 if the FPU is not present. diff --git a/target/arm/machine.c b/target/arm/machine.c index 241890ac8c..7050bde459 100644 --- a/target/arm/machine.c +++ b/target/arm/machine.c @@ -9,9 +9,8 @@ static bool vfp_needed(void *opaque) { ARMCPU *cpu = opaque; - CPUARMState *env = &cpu->env; - return arm_feature(env, ARM_FEATURE_VFP); + return cpu_isar_feature(aa32_simd_r16, cpu); } static int get_fpscr(QEMUFile *f, void *opaque, size_t size, From patchwork Fri Feb 14 18:15:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183513 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2128464ile; Fri, 14 Feb 2020 10:21:31 -0800 (PST) X-Google-Smtp-Source: APXvYqyD5MEtf3/45r/PAcfSo0V0Zo5YDPmFK5ct9kbWJitHOil1jaNmq4bnbxdD1pdgrKfGCUIr X-Received: by 2002:aed:2dc2:: with SMTP id i60mr3564823qtd.8.1581704491028; Fri, 14 Feb 2020 10:21:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704491; cv=none; d=google.com; s=arc-20160816; b=XPJ9KCikwN1yPzvCFB++RArRWdjeiKpmLp1dlrL5YrM4QcHl1hJhx9Q5CEsIoWbr9x 3wGcGYm68eL1ALhhJ3QQaAYgtlzuCtz2cSFQ7RcnDIZIVZL9ik2AyQCIdALV6VVxR61I hEsTlR7buACR4qSl9tx7+MYP2GRtC3IPqFAODysSjxLo61wpXMBmlcoh4Okvxqh/DkTV sgKh+FU11BKs/68RFM3oTtfzaBuRjDm229mHuP88IgSrv6EWTjS9vpQWgX2AxPBrbPsl 4z3vlwx7X+icPNHKbfxhBTP46xRHMhy90RG0nQMFahFv4xnePYhR5FiTwV4JtQPILx7Z hdoA== 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=bLNTrgdvvZF7PnSY+r2yk4nJu3Fd25nqdhwKgVxP4y8=; b=mZcU/RmqUWqUdfZoFad5gyFfYy9Y5q5Tm2L+yy0CAh4xCA7zFCgGX2C/ausQc4XD7c esR17opcAWEu450hwXwnbKemoTRZLGhwjzmjX8u+jjyOhbHJE3xE/1VjOP3+4f8gfbP1 rCGM2BbpD1CCuC55J25qWVig46fZoXIXjw0Vp8GqlwDZg2h0ysWP9VbUbm1uugqghSie LeXuFR797kuPubTJ+tok2otkZE5RnBqvWPN8yZDiTYGYi0hYl/uODWZbSomM626QZKZJ aOv++gBTHRyeorJcBgSxjV2qQ4VxGok4kGzGwDU06uE8effwbrmcgT812legL9QZKFpO kEPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GYKE089k; 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 m13si2775743qvm.160.2020.02.14.10.21.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:21:30 -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=GYKE089k; 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]:43652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fak-0006u1-HE for patch@linaro.org; Fri, 14 Feb 2020 13:21:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60832) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVP-0004LD-1L for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVN-00006I-GB for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:15:58 -0500 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:44087) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVN-00005y-9p for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:15:57 -0500 Received: by mail-pg1-x543.google.com with SMTP id g3so5208354pgs.11 for ; Fri, 14 Feb 2020 10:15:57 -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=bLNTrgdvvZF7PnSY+r2yk4nJu3Fd25nqdhwKgVxP4y8=; b=GYKE089kTv91kmETyK0jyL74T8rE1zGRPjFKDuqFK8x9NzrPETSanVvoPuwszh31Qd DYH0f2BzDma5lvrDsxbW/qo5QHMoq98SXd5BE9hxCz4QhG2s3RmsySrQ/A6639kLyqkV wOXnN/9z77VRB4xks2cayOhzcySgt3hSD5KpYkPDS/HX+ABuC3emLNWzwauHFs+wLB5h D0t0aN59cZBO6Yj+ze09kLd37i8dmkxaDJQ0zLxiEPANyeJIBQTs+1R3/xPnYesUo3mi tQgT0nVXebtfJfw8NwTT+w9+vX5OcmI5rjB0/ZRbPCyAyeujbEujodmrVU8dkWkx2HW3 HPZg== 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=bLNTrgdvvZF7PnSY+r2yk4nJu3Fd25nqdhwKgVxP4y8=; b=fWt4oPGEqkJgZg3aXYfoE5+cvUp2JNBMQX9bhjw7MOsX8OhV6jD7MuCGbBku1G+YGL 3zY7FDdMEy/SNNPfsrxUKfb4kzYFhrIipHFtvwmgot2Ev3XxnCJWaeMShKaQyipVXpKo xaY3Muy7sYF0P9NvmyamP2sFWp5FPM+FwHngmDk0luYb6VzvE432n+Lq5E38GdgMEr9U M5/gTLCNwe+rAAIW/AS/Q4tBfy0SJ9tlBWzja2Gj+m5nrZW+uPqZjHXM4d4t7sNm/VQc /2O/T+ZR/cv57+oULeN4iJLmjlnSVzrcby6l36TH3UnbOGqXen/X3VHynGLJdjIvfVSS NVoA== X-Gm-Message-State: APjAAAVVZSU9DZd3ysyAcu6yPTK5X89TSl14wK/VZif8CazBjK6aeM6Z I9PS46mqWSQoSYO67xWoLiq0s6+CNWc= X-Received: by 2002:a63:9257:: with SMTP id s23mr5037458pgn.0.1581704155908; Fri, 14 Feb 2020 10:15:55 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:15:55 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 06/19] target/arm: Rename isar_feature_aa32_fpdp_v2 Date: Fri, 14 Feb 2020 10:15:34 -0800 Message-Id: <20200214181547.21408-7-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::543 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" The old name, isar_feature_aa32_fpdp, does not reflect that the test includes VFPv2. We will introduce another feature tests for VFPv3. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 4 ++-- target/arm/translate-vfp.inc.c | 40 +++++++++++++++++----------------- 2 files changed, 22 insertions(+), 22 deletions(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 85b90eaed2..5f08cbd2d8 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3429,9 +3429,9 @@ static inline bool isar_feature_aa32_fpshvec(const ARMISARegisters *id) return FIELD_EX32(id->mvfr0, MVFR0, FPSHVEC) > 0; } -static inline bool isar_feature_aa32_fpdp(const ARMISARegisters *id) +static inline bool isar_feature_aa32_fpdp_v2(const ARMISARegisters *id) { - /* Return true if CPU supports double precision floating point */ + /* Return true if CPU supports double precision floating point, VFPv2 */ return FIELD_EX32(id->mvfr0, MVFR0, FPDP) > 0; } diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index 96a1d727c6..5290828d0d 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -206,7 +206,7 @@ static bool trans_VSEL(DisasContext *s, arg_VSEL *a) return false; } - if (dp && !dc_isar_feature(aa32_fpdp, s)) { + if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -339,7 +339,7 @@ static bool trans_VMINMAXNM(DisasContext *s, arg_VMINMAXNM *a) return false; } - if (dp && !dc_isar_feature(aa32_fpdp, s)) { + if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -425,7 +425,7 @@ static bool trans_VRINT(DisasContext *s, arg_VRINT *a) return false; } - if (dp && !dc_isar_feature(aa32_fpdp, s)) { + if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -488,7 +488,7 @@ static bool trans_VCVT(DisasContext *s, arg_VCVT *a) return false; } - if (dp && !dc_isar_feature(aa32_fpdp, s)) { + if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -1313,7 +1313,7 @@ static bool do_vfp_3op_dp(DisasContext *s, VFPGen3OpDPFn *fn, return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -1462,7 +1462,7 @@ static bool do_vfp_2op_dp(DisasContext *s, VFPGen2OpDPFn *fn, int vd, int vm) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -1826,7 +1826,7 @@ static bool trans_VFM_dp(DisasContext *s, arg_VFM_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -1925,7 +1925,7 @@ static bool trans_VMOV_imm_dp(DisasContext *s, arg_VMOV_imm_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2069,7 +2069,7 @@ static bool trans_VCMP_dp(DisasContext *s, arg_VCMP_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2142,7 +2142,7 @@ static bool trans_VCVT_f64_f16(DisasContext *s, arg_VCVT_f64_f16 *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2208,7 +2208,7 @@ static bool trans_VCVT_f16_f64(DisasContext *s, arg_VCVT_f16_f64 *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2268,7 +2268,7 @@ static bool trans_VRINTR_dp(DisasContext *s, arg_VRINTR_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2329,7 +2329,7 @@ static bool trans_VRINTZ_dp(DisasContext *s, arg_VRINTZ_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2388,7 +2388,7 @@ static bool trans_VRINTX_dp(DisasContext *s, arg_VRINTX_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2416,7 +2416,7 @@ static bool trans_VCVT_sp(DisasContext *s, arg_VCVT_sp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2444,7 +2444,7 @@ static bool trans_VCVT_dp(DisasContext *s, arg_VCVT_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2498,7 +2498,7 @@ static bool trans_VCVT_int_dp(DisasContext *s, arg_VCVT_int_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2538,7 +2538,7 @@ static bool trans_VJCVT(DisasContext *s, arg_VJCVT *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2631,7 +2631,7 @@ static bool trans_VCVT_fix_dp(DisasContext *s, arg_VCVT_fix_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2727,7 +2727,7 @@ static bool trans_VCVT_dp_int(DisasContext *s, arg_VCVT_dp_int *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } From patchwork Fri Feb 14 18:15:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183505 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2125160ile; Fri, 14 Feb 2020 10:18:05 -0800 (PST) X-Google-Smtp-Source: APXvYqyxHbdArZqHrE+o4bhdIQ6voL8OYdaC+Ylo8eKd98UMS6Ezu2F5VEOJyLGauxsB3ZcNRY+C X-Received: by 2002:a0c:ead1:: with SMTP id y17mr3174466qvp.210.1581704285555; Fri, 14 Feb 2020 10:18:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704285; cv=none; d=google.com; s=arc-20160816; b=cO4uJnpsipn6bTLpqkL0sgtuxD3Ax8GLcQfWCvcqApo/JsoHtk8FiDDsVm80uYkWrw E0eRxWoS78A9/oH0fk5TB5/GbPKPf+8C3F8a5jtmodPdz2b+80axZV8B61wN1m/wzKxe 2IiZwTkuNcevTGRaNtrcnnWpkuiWUEjekg/iXRZiSmA2ghzkWdJ7g3TBb4Dnm+I1EfCT dX3PjHxuIZQQhaKyqVxYj2e6Rp0X/sn3Fmca9RCJUOMvftFc8Es8WGMb44kDxRZo3yVj nJ+DYtRu4NzOHKTqShAgmHaSUFdc5O4grvbJ71ULyVi1ROqJdI9FJwMI25bumaRKjFqj hp8Q== 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=bFodYZjZFzCVB6GfD5JV/0vM0v0zus5xTQluYRgEuVA=; b=vzcu5JryhIlssZ8feoSADMAc/yw0PHihyz2NfA+hSVR3gEr6e1XTQrJr9zktIxl8LD R1OPx/zgIugoVcpIWa5qV/mWRKvJAJ2Hw4F+XqE9gv08BsGPcdUeaHIML7QM7RXDVWKE 4Q132CtrF+PINS8hZXYxpLXyit62n0bwQA3KxssLVzWUxO6S9zTs6z48bnD2zbz7rMNz GVlLoBeNOlQORe6VTkWO8BY0g1w7ynlJ3Gw/mpD0qdRYRUiHT1PT3G3vz5dMk9y5iz1R cvGd+EbOZOLPLWz7hKK9pXbkCeLdCWkG9QgoeIyhebRI+NuSd6KpCQ+22MwrSGRPirNo Gv5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=mn3JnS8J; 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 z16si3022656qtu.200.2020.02.14.10.18.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:18: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=fail header.i=@linaro.org header.s=google header.b=mn3JnS8J; 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]:43538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fXR-0008Oh-0n for patch@linaro.org; Fri, 14 Feb 2020 13:18:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60835) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVP-0004LF-Es for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVO-00006p-EG for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:15:59 -0500 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:33087) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVO-00006X-8s for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:15:58 -0500 Received: by mail-pg1-x541.google.com with SMTP id 6so5358938pgk.0 for ; Fri, 14 Feb 2020 10:15:58 -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=bFodYZjZFzCVB6GfD5JV/0vM0v0zus5xTQluYRgEuVA=; b=mn3JnS8Jvr4MDWK75x/kpAf+V1CcrWOmtB8fH9hTWJDDutpUIdanPEueHvcfjp8xWC UDtDMGKyC3jkuHnsuJKxYdK6yBkhQzwwrL4ABIqP4I65X0vOjoeLVg/mWF5gllcQQl+3 rIl2Re3huWwrV5d3Wpi0q2FeRWX/IVMAsk0NS1ViyETsYI1isb8D94TlexzfNK6xLP6S mfcMwIOMO+Bye+yvxxPm0mb1jbtfzlLU2EoTg8jqxPw2RpzfLZlZEqVctCgw8vugy4ee F/FczYcXN5yy4OUKkCZsyaDxmc9D9QqqpZRt44/CPrVix0Lekh3LRwBUmuFJ2FLIDBiY PteQ== 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=bFodYZjZFzCVB6GfD5JV/0vM0v0zus5xTQluYRgEuVA=; b=RgsOpeTxZ7qODK/3u4EdtrO/Ru8MuZZkR00O634QgugcoLqqK01sXzk7dGDzKz82o4 hvdQHdGwYxbhZSRyFsHL0A8wgJKcl9tN5ZKkK8/DNG0fUKt9UFWC0qnDnuWRWG8cEDTZ aKVQbOUQ6XGY1RwMuD7BfOdQ62ahJbdRqc2vG3Z3vsumeDXSQkDwUfQffWNGTgGAK701 QGqXzRhonnmwh0u2roQnz/6aqD8Lc8l/V9bEmR2OHIzvEBRv1vskD0Tvj/+vSqy2hZQw Y595+qsp1ylw4Pq4lk4oK0F8Zf7wfd1RFmjkx9g4WodSmX06Rk+SHhv8fkRk/bakwe2k aWbQ== X-Gm-Message-State: APjAAAVM1K/xoFlZ1jJoW1HrtrU1P98RV++2nMhs2zCf+Gig3wiBdoMq QrVCPpqQN3ihLvjWELulsIxKoBDtYTI= X-Received: by 2002:a63:4525:: with SMTP id s37mr4756791pga.418.1581704157012; Fri, 14 Feb 2020 10:15:57 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:15:56 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 07/19] target/arm: Add isar_feature_aa32_{fpsp_v2, fpsp_v3, fpdp_v3} Date: Fri, 14 Feb 2020 10:15:35 -0800 Message-Id: <20200214181547.21408-8-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::541 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 shortly use these to test for VFPv2 and VFPv3 in different situations. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 5f08cbd2d8..4ff28418df 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3429,12 +3429,30 @@ static inline bool isar_feature_aa32_fpshvec(const ARMISARegisters *id) return FIELD_EX32(id->mvfr0, MVFR0, FPSHVEC) > 0; } +static inline bool isar_feature_aa32_fpsp_v2(const ARMISARegisters *id) +{ + /* Return true if CPU supports single precision floating point, VFPv2 */ + return FIELD_EX32(id->mvfr0, MVFR0, FPSP) > 0; +} + +static inline bool isar_feature_aa32_fpsp_v3(const ARMISARegisters *id) +{ + /* Return true if CPU supports single precision floating point, VFPv3 */ + return FIELD_EX32(id->mvfr0, MVFR0, FPSP) >= 2; +} + static inline bool isar_feature_aa32_fpdp_v2(const ARMISARegisters *id) { /* Return true if CPU supports double precision floating point, VFPv2 */ return FIELD_EX32(id->mvfr0, MVFR0, FPDP) > 0; } +static inline bool isar_feature_aa32_fpdp_v3(const ARMISARegisters *id) +{ + /* Return true if CPU supports double precision floating point, VFPv3 */ + return FIELD_EX32(id->mvfr0, MVFR0, FPDP) >= 2; +} + /* * We always set the FP and SIMD FP16 fields to indicate identical * levels of support (assuming SIMD is implemented at all), so From patchwork Fri Feb 14 18:15:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183512 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2128272ile; Fri, 14 Feb 2020 10:21:19 -0800 (PST) X-Google-Smtp-Source: APXvYqz0UH0oEw58kbS6XZnxZbKy2BeTTaxaoplsCZrKhuWF24EMPnUSAKdicf/GslMQkPBpa84r X-Received: by 2002:ac8:4cc9:: with SMTP id l9mr3541184qtv.207.1581704479603; Fri, 14 Feb 2020 10:21:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704479; cv=none; d=google.com; s=arc-20160816; b=GHRSREAUVsMCy561A8HpLsDmKzmPttAjqGaqQ5zT3JHCTQrDANTlpzqBOmVMK57zn3 fcwhKRAx1kO4nm0AFPakUTuocVXVI40lMqTntcljTWPu6i67j47irQJy0NceSxHPQd4r otQnZVPaUyO9NhPgqnCZN8YsVRmzOSwamRCZoJeniaquyjtRIPmnQqDk81sNSixRX8R+ RiYG+2+9ik6JoLYsR5wM1rQQrhK51t7yuvEumg5MpIcf002MVyXm06hapyB8QC0tVjEy X4bLEz+nNJDwdwFAiN9xoRCmpIGnIlJugqvoZZWEpRQJ7mkGciNJMzUhgghm5I8Da9cu lbrA== 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=MPCJ7dRq2fpTnBkIuHG7jADk+0h3hLWHD3XSDLeSg9g=; b=yM0HVDlZZnEUyhbNW9mQXlBQD3zXojTrZtPRny4siTD+BlzzDzVhINyd4aayWITPTs qCxnRzGV7xjHikR9ojJhUGqeUA+twm+8PSl7k26J7zeOH2O9JCC1HqOJCZ2E8EyM4zsT MI/jsWQssvm1rlOKO028uxkJPu9RT88UlMZucnxoLFIY5jQXlsXYlf0Ygn+IX1eKvrv6 0o0AmlOZ8EIY/yoCAynjBvnSO+W6QpHKBHx6NZ2USMafZAB7K8lmKSNgqHVBlbv+QoAc XOrBmtNJL0bh4NvO0DHy7FrdGg6781tGll9uNVeWWGBhLRIsMLCNPts+M0yzGXLQ3v4n O5qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UI6JmzRn; 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 s13si2836168qvw.50.2020.02.14.10.21.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:21:19 -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=UI6JmzRn; 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]:43648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2faZ-0006il-3I for patch@linaro.org; Fri, 14 Feb 2020 13:21:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60866) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVS-0004Nu-2r for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVQ-0000Cx-4b for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:01 -0500 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:35527) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVP-00009V-Sa for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:00 -0500 Received: by mail-pf1-x441.google.com with SMTP id y73so5269407pfg.2 for ; Fri, 14 Feb 2020 10:15:59 -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=MPCJ7dRq2fpTnBkIuHG7jADk+0h3hLWHD3XSDLeSg9g=; b=UI6JmzRnpNrL7G0Cvnr4KMvYPBy9+Wy+5LG6IQOz9Yxa8YAmXA7C7YYVFDx0Uy4/W6 YAX1WRpxfid8LtBratA385xm2d/in01gRJxsQRznOBhuUAPVs6sDMk5xxSkWgQWtxujS MsLBTKdCIx80dlURaYh5Oew7gQU2FMJPwRyLBoxexKOzLsFAeKiOIajMsA651WCfuyTz HbE+rlmfulxXmrjI6pmKiTlYzQfIyTA3aGLsaim6QYApiSvAo7AkBYIklQCRF7zVAr7H xGMLB3m6wY81mCMQ+AXxg3T1vGwiisHVR0GVpdE1lfPR1vZ72alTLfo1c12Fypxkp3rx Arjw== 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=MPCJ7dRq2fpTnBkIuHG7jADk+0h3hLWHD3XSDLeSg9g=; b=S3XafJrtvIz5mHfgg+szSPNj693zuIw/G8h4tQXr9+8k+yZo0zExjrorzZrqq84b2s BZYmBnnFUTl26iUESkC2sfN8yJSJKGZJSgOxlTAYmNiV1o8XWIGXrdCcYsZO2LCARfJ5 FWCMyI2BVkTU/aioWGI0WqSJNGwPLHVDSgvbfi3ZuiwliYMo2hkkNH90ZRN20/PbbIqd BQmBC2MXUMz4XOJdf/SBXF3zuppuLzIDFUeqSQZOJSRfrl6oVGnBEWCgTd/CdWXDIlXi g2qm31WlIXx0Lks85WMev+9RjMlUQ9xHSqOhuEc+tzvCvfHf+Wq+3kHNUjLvA6r/heVK 7cZQ== X-Gm-Message-State: APjAAAVF7RgheAsDzMfdurMkNBTS8rwR7zd71iyTaBImHwpGg+4tyOcv oUWRzIOS3rbvhHXWOC4wYnMiM04U/Ck= X-Received: by 2002:a63:451b:: with SMTP id s27mr4713938pga.233.1581704158059; Fri, 14 Feb 2020 10:15:58 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:15:57 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 08/19] target/arm: Perform fpdp_v2 check first Date: Fri, 14 Feb 2020 10:15:36 -0800 Message-Id: <20200214181547.21408-9-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::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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Shuffle the order of the checks so that we test the ISA before we test anything else, such as the register arguments. Signed-off-by: Richard Henderson --- target/arm/translate-vfp.inc.c | 143 +++++++++++++++++---------------- 1 file changed, 72 insertions(+), 71 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 5290828d0d..0c55140127 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -200,13 +200,13 @@ static bool trans_VSEL(DisasContext *s, arg_VSEL *a) return false; } - /* UNDEF accesses to D16-D31 if they don't exist */ - if (dp && !dc_isar_feature(aa32_simd_r32, s) && - ((a->vm | a->vn | a->vd) & 0x10)) { + if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist */ + if (dp && !dc_isar_feature(aa32_simd_r32, s) && + ((a->vm | a->vn | a->vd) & 0x10)) { return false; } @@ -333,13 +333,13 @@ static bool trans_VMINMAXNM(DisasContext *s, arg_VMINMAXNM *a) return false; } - /* UNDEF accesses to D16-D31 if they don't exist */ - if (dp && !dc_isar_feature(aa32_simd_r32, s) && - ((a->vm | a->vn | a->vd) & 0x10)) { + if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist */ + if (dp && !dc_isar_feature(aa32_simd_r32, s) && + ((a->vm | a->vn | a->vd) & 0x10)) { return false; } @@ -419,13 +419,13 @@ static bool trans_VRINT(DisasContext *s, arg_VRINT *a) return false; } - /* UNDEF accesses to D16-D31 if they don't exist */ - if (dp && !dc_isar_feature(aa32_simd_r32, s) && - ((a->vm | a->vd) & 0x10)) { + if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist */ + if (dp && !dc_isar_feature(aa32_simd_r32, s) && + ((a->vm | a->vd) & 0x10)) { return false; } @@ -483,12 +483,12 @@ static bool trans_VCVT(DisasContext *s, arg_VCVT *a) return false; } - /* UNDEF accesses to D16-D31 if they don't exist */ - if (dp && !dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { + if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist */ + if (dp && !dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { return false; } @@ -1308,12 +1308,12 @@ static bool do_vfp_3op_dp(DisasContext *s, VFPGen3OpDPFn *fn, TCGv_i64 f0, f1, fd; TCGv_ptr fpst; - /* UNDEF accesses to D16-D31 if they don't exist */ - if (!dc_isar_feature(aa32_simd_r32, s) && ((vd | vn | vm) & 0x10)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist */ + if (!dc_isar_feature(aa32_simd_r32, s) && ((vd | vn | vm) & 0x10)) { return false; } @@ -1457,12 +1457,12 @@ static bool do_vfp_2op_dp(DisasContext *s, VFPGen2OpDPFn *fn, int vd, int vm) int veclen = s->vec_len; TCGv_i64 f0, fd; - /* UNDEF accesses to D16-D31 if they don't exist */ - if (!dc_isar_feature(aa32_simd_r32, s) && ((vd | vm) & 0x10)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist */ + if (!dc_isar_feature(aa32_simd_r32, s) && ((vd | vm) & 0x10)) { return false; } @@ -1821,12 +1821,13 @@ static bool trans_VFM_dp(DisasContext *s, arg_VFM_dp *a) return false; } - /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_simd_r32, s) && ((a->vd | a->vn | a->vm) & 0x10)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist. */ + if (!dc_isar_feature(aa32_simd_r32, s) && + ((a->vd | a->vn | a->vm) & 0x10)) { return false; } @@ -1920,12 +1921,12 @@ static bool trans_VMOV_imm_dp(DisasContext *s, arg_VMOV_imm_dp *a) vd = a->vd; - /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_simd_r32, s) && (vd & 0x10)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist. */ + if (!dc_isar_feature(aa32_simd_r32, s) && (vd & 0x10)) { return false; } @@ -2059,6 +2060,10 @@ static bool trans_VCMP_dp(DisasContext *s, arg_VCMP_dp *a) { TCGv_i64 vd, vm; + if (!dc_isar_feature(aa32_fpdp_v2, s)) { + return false; + } + /* Vm/M bits must be zero for the Z variant */ if (a->z && a->vm != 0) { return false; @@ -2069,10 +2074,6 @@ static bool trans_VCMP_dp(DisasContext *s, arg_VCMP_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -2133,6 +2134,10 @@ static bool trans_VCVT_f64_f16(DisasContext *s, arg_VCVT_f64_f16 *a) TCGv_i32 tmp; TCGv_i64 vd; + if (!dc_isar_feature(aa32_fpdp_v2, s)) { + return false; + } + if (!dc_isar_feature(aa32_fp16_dpconv, s)) { return false; } @@ -2142,10 +2147,6 @@ static bool trans_VCVT_f64_f16(DisasContext *s, arg_VCVT_f64_f16 *a) return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -2199,6 +2200,10 @@ static bool trans_VCVT_f16_f64(DisasContext *s, arg_VCVT_f16_f64 *a) TCGv_i32 tmp; TCGv_i64 vm; + if (!dc_isar_feature(aa32_fpdp_v2, s)) { + return false; + } + if (!dc_isar_feature(aa32_fp16_dpconv, s)) { return false; } @@ -2208,10 +2213,6 @@ static bool trans_VCVT_f16_f64(DisasContext *s, arg_VCVT_f16_f64 *a) return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -2259,6 +2260,10 @@ static bool trans_VRINTR_dp(DisasContext *s, arg_VRINTR_dp *a) TCGv_ptr fpst; TCGv_i64 tmp; + if (!dc_isar_feature(aa32_fpdp_v2, s)) { + return false; + } + if (!dc_isar_feature(aa32_vrint, s)) { return false; } @@ -2268,10 +2273,6 @@ static bool trans_VRINTR_dp(DisasContext *s, arg_VRINTR_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -2320,6 +2321,10 @@ static bool trans_VRINTZ_dp(DisasContext *s, arg_VRINTZ_dp *a) TCGv_i64 tmp; TCGv_i32 tcg_rmode; + if (!dc_isar_feature(aa32_fpdp_v2, s)) { + return false; + } + if (!dc_isar_feature(aa32_vrint, s)) { return false; } @@ -2329,10 +2334,6 @@ static bool trans_VRINTZ_dp(DisasContext *s, arg_VRINTZ_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -2379,6 +2380,10 @@ static bool trans_VRINTX_dp(DisasContext *s, arg_VRINTX_dp *a) TCGv_ptr fpst; TCGv_i64 tmp; + if (!dc_isar_feature(aa32_fpdp_v2, s)) { + return false; + } + if (!dc_isar_feature(aa32_vrint, s)) { return false; } @@ -2388,10 +2393,6 @@ static bool trans_VRINTX_dp(DisasContext *s, arg_VRINTX_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -2411,12 +2412,12 @@ static bool trans_VCVT_sp(DisasContext *s, arg_VCVT_sp *a) TCGv_i64 vd; TCGv_i32 vm; - /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist. */ + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { return false; } @@ -2439,12 +2440,12 @@ static bool trans_VCVT_dp(DisasContext *s, arg_VCVT_dp *a) TCGv_i64 vm; TCGv_i32 vd; - /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist. */ + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { return false; } @@ -2493,12 +2494,12 @@ static bool trans_VCVT_int_dp(DisasContext *s, arg_VCVT_int_dp *a) TCGv_i64 vd; TCGv_ptr fpst; - /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist. */ + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { return false; } @@ -2529,6 +2530,10 @@ static bool trans_VJCVT(DisasContext *s, arg_VJCVT *a) TCGv_i32 vd; TCGv_i64 vm; + if (!dc_isar_feature(aa32_fpdp_v2, s)) { + return false; + } + if (!dc_isar_feature(aa32_jscvt, s)) { return false; } @@ -2538,10 +2543,6 @@ static bool trans_VJCVT(DisasContext *s, arg_VJCVT *a) return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -2622,6 +2623,10 @@ static bool trans_VCVT_fix_dp(DisasContext *s, arg_VCVT_fix_dp *a) TCGv_ptr fpst; int frac_bits; + if (!dc_isar_feature(aa32_fpdp_v2, s)) { + return false; + } + if (!arm_dc_feature(s, ARM_FEATURE_VFP3)) { return false; } @@ -2631,10 +2636,6 @@ static bool trans_VCVT_fix_dp(DisasContext *s, arg_VCVT_fix_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -2722,12 +2723,12 @@ static bool trans_VCVT_dp_int(DisasContext *s, arg_VCVT_dp_int *a) TCGv_i64 vm; TCGv_ptr fpst; - /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist. */ + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { return false; } From patchwork Fri Feb 14 18:15:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183517 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2131525ile; Fri, 14 Feb 2020 10:24:55 -0800 (PST) X-Google-Smtp-Source: APXvYqy/GQEqtTHyxQ/jvUh4c3RKYXJYaj7/kiLkHyyZlOoSNVu6o0Aa22+AYYl5mq9lRDCK0SB1 X-Received: by 2002:a05:620a:545:: with SMTP id o5mr3728860qko.27.1581704695163; Fri, 14 Feb 2020 10:24:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704695; cv=none; d=google.com; s=arc-20160816; b=cW881aAJoz3QfBzVsGoKm2npRyeiEgp7xZMWVLSxLJwG82RuJG508ppeizOI6EgQ6u 4OPOchE7Bk8tFnffrAv4LbmYLYQZwklTnGQrC4zY+oOPhFkvbiE+RK+RvIG4Py/862/Z Ivg2e8elhR5KgHCzW2xIkisWwZpmTh+5W+sjBsxy1dPZ9n7hImFV3EAt0uG5v80pEte3 Waz1YuYdgR8twGqv0RWzF1Aa+9rcxE9PURa9IlZGyvfx6QnfrF6DhBm81WxdkG0HJCgC 5bIaNAqZ01XoX6CzlADRhWHJYgBJTwksOLA3Q5THsiQKAmtbaIjeC9TkC2z134FQatAF FsPA== 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=pElnR5+ZNReOFV25D5Wd4OZyDSMZOeR76smz6O5bwn4=; b=vwfHun71GLDbdBzXlFA+nyyvf876MHZThiyGOQmfEa36cOsTOI+jEPTydOu7Prk7xQ mRSx5giR+Uby+IVDlJlDKqAQKUCrt5/4M24VjPXseYRxOEquenCWYtKjpWUJ+qzpfjzC A7I/RMPUW/XvM4zrfnfqFo5bR2P/edSmULcoOr8ZomyysM+dRKhicSS2AaxKaZwGTdld uHGpf05J66S7kOfyac1JpCgADkgEmO421qGd9H1VmCNxQhOwUy/fjdDC6Yblhjlp1bQT OcyTd/nGmTPr7nq9+FFUqHoiXTi/HpLNvh63W3mFaFkfDowalxyU1sRemU33NgMXn7d1 Alsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hjUdmAd3; 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 1si3211485qki.364.2020.02.14.10.24.55 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:24:55 -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=fail header.i=@linaro.org header.s=google header.b=hjUdmAd3; 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]:43752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fe2-0005FH-Mj for patch@linaro.org; Fri, 14 Feb 2020 13:24:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60865) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVS-0004Nr-2B for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVQ-0000Dw-N4 for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:01 -0500 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:41000) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVQ-0000Ci-GS for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:00 -0500 Received: by mail-pl1-x644.google.com with SMTP id t14so4012132plr.8 for ; Fri, 14 Feb 2020 10:16:00 -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=pElnR5+ZNReOFV25D5Wd4OZyDSMZOeR76smz6O5bwn4=; b=hjUdmAd37aNlIq8IPlsbcSfAKHSjpi6isiDOKLK17Crix6/2Ymba1cQmYhnge/Av9z WQmvvodmneZ9sDBJo/ItH1l55Zg63Ygi0+aR+eMbROTckEjyrWpFgNKdMJIGLQn9tMez IrU7qvvsbODT/yzg4IwAVlcy2NQDaLZuA8FDOGhcZeZqkK6uqRTrgjE+7MNAodMAzUw2 ZGI8HiYrrMVoVr5jW+/IKGGml4jA7vlmGuLfGs1jZFtgXen0dibBseQpFqEtx36IE2Ls mq/7ueBm4EK1aDCvaXfde3W9bsXd++1055DVx9I/B5RKfo58VP1nEVS3D5J0UfZuefVZ P5Zg== 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=pElnR5+ZNReOFV25D5Wd4OZyDSMZOeR76smz6O5bwn4=; b=G0HWUj22hzV3Altaznz3kdLgwYrJu0hzNjy0pRjXzlR4iiu8lyXjMTF11RQ5sxJYL3 9gAuFcrR26mt7Xj8mnwC8+Iaku5ddqfQdKJT8YDGlbp8W5s3TwMztNX1NXiqOAkarF2I OTsqWKu0IKn19upbYeOBeQ3iH9JZV6mpmCs0MR59rTs6lPMfClp6PvfW46sZlUOHLSQY 6Uac0OcxbH8B49uGVQbq5J7GUiwYEc1GKTLIY9uDnBsEEokTMTvz0JMFlUwrf9AbdOdj /tZi7gF6LUoSzSQ+pTXuAn/3cYwFyjKtjh7iol22NZTEsYWnFm9DeFtq/IJknAl0U0vb FV6g== X-Gm-Message-State: APjAAAWfFbMJ4MbwbGHEXtKD7oHyFRxn5hnw3wayHAaiTqadzSqIAmKm NSlhkoRIqDnPgq4B2x/XRfWEfAfyNT0= X-Received: by 2002:a17:902:7b92:: with SMTP id w18mr4534765pll.72.1581704159122; Fri, 14 Feb 2020 10:15:59 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:15:58 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 09/19] target/arm: Replace ARM_FEATURE_VFP3 checks with fp{sp, dp}_v3 Date: Fri, 14 Feb 2020 10:15:37 -0800 Message-Id: <20200214181547.21408-10-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::644 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" Sort this check to the start of a trans_* function. Merge this with any existing test for fpdp_v2. Signed-off-by: Richard Henderson --- target/arm/translate-vfp.inc.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 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 0c55140127..9e5516f208 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -717,7 +717,7 @@ static bool trans_VMSR_VMRS(DisasContext *s, arg_VMSR_VMRS *a) * VFPv2 allows access to FPSID from userspace; VFPv3 restricts * all ID registers to privileged access only. */ - if (IS_USER(s) && arm_dc_feature(s, ARM_FEATURE_VFP3)) { + if (IS_USER(s) && dc_isar_feature(aa32_fpsp_v3, s)) { return false; } ignore_vfp_enabled = true; @@ -746,7 +746,7 @@ static bool trans_VMSR_VMRS(DisasContext *s, arg_VMSR_VMRS *a) case ARM_VFP_FPINST: case ARM_VFP_FPINST2: /* Not present in VFPv3 */ - if (IS_USER(s) || arm_dc_feature(s, ARM_FEATURE_VFP3)) { + if (IS_USER(s) || dc_isar_feature(aa32_fpsp_v3, s)) { return false; } break; @@ -1871,12 +1871,12 @@ static bool trans_VMOV_imm_sp(DisasContext *s, arg_VMOV_imm_sp *a) vd = a->vd; - if (!dc_isar_feature(aa32_fpshvec, s) && - (veclen != 0 || s->vec_stride != 0)) { + if (!dc_isar_feature(aa32_fpsp_v3, s)) { return false; } - if (!arm_dc_feature(s, ARM_FEATURE_VFP3)) { + if (!dc_isar_feature(aa32_fpshvec, s) && + (veclen != 0 || s->vec_stride != 0)) { return false; } @@ -1921,7 +1921,7 @@ static bool trans_VMOV_imm_dp(DisasContext *s, arg_VMOV_imm_dp *a) vd = a->vd; - if (!dc_isar_feature(aa32_fpdp_v2, s)) { + if (!dc_isar_feature(aa32_fpdp_v3, s)) { return false; } @@ -1935,10 +1935,6 @@ static bool trans_VMOV_imm_dp(DisasContext *s, arg_VMOV_imm_dp *a) return false; } - if (!arm_dc_feature(s, ARM_FEATURE_VFP3)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -2563,7 +2559,7 @@ static bool trans_VCVT_fix_sp(DisasContext *s, arg_VCVT_fix_sp *a) TCGv_ptr fpst; int frac_bits; - if (!arm_dc_feature(s, ARM_FEATURE_VFP3)) { + if (!dc_isar_feature(aa32_fpsp_v3, s)) { return false; } @@ -2623,11 +2619,7 @@ static bool trans_VCVT_fix_dp(DisasContext *s, arg_VCVT_fix_dp *a) TCGv_ptr fpst; int frac_bits; - if (!dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - - if (!arm_dc_feature(s, ARM_FEATURE_VFP3)) { + if (!dc_isar_feature(aa32_fpdp_v3, s)) { return false; } 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; } From patchwork Fri Feb 14 18:15:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183508 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2126963ile; Fri, 14 Feb 2020 10:19:52 -0800 (PST) X-Google-Smtp-Source: APXvYqwNPLLmdKuTkgByvSXuqc/C7plHVP1YFt6tl7t5afrqd5A+wm1Nh06Lhohm3CdQHsf0/eor X-Received: by 2002:a05:620a:15e9:: with SMTP id p9mr3835128qkm.162.1581704392302; Fri, 14 Feb 2020 10:19:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704392; cv=none; d=google.com; s=arc-20160816; b=Facn+/cGWLjP31LPaMm7PIeq4KNgJ+mImm+wj+Aac5SutSGHWMhBjRauz5witzqKUl cSCbnttH+2DBWs73ofL8WTbQFuOnAJQ0nmCAkJzZQoc37r8i3D1vwsf0t61oKcDGhZPj f2vD/j55+24Ro/3aq8PnBtFDdrl3uW6WvEJ0tqjPwkJS1bxSn7lE7B2zS8/mYvvKYlph zl4Gasx5myNoWhDcofX0es6jZarqeQL9ZYpXMi9i8DBVtCERKfsl2Koq1qIWzyGDoaUt Ggg2MzOobAk/nHotZgEwRvWqq8a+aKZUCI1Beuz/0r7tTQXiP2xBFWssGXlheWTGTJQL O60g== 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=a/LcTtPEaSKt2TqD4S4P5QmkhybGw6G87ufOx2pyeQw=; b=o20ldDJ9ghgCrDNY21S2taxAIDdu//3p8H7BhG+eMncu0PuZjf7tjsflY4IIpORsK8 UlqlUJerTHoRJOJJcuTjms/WXWFs1QvKEfzohWr7pdkEojyoaFdyR8nF3Cr30a16Po4z wEEYoNgl17VWlvLuZd82dFBOkIjxg2yp7pv2Ljl5sGJdrwrmtcwdFagTQS1PqlQH1Ix9 OWoGC/ML4IBmxgHMa9eChDTmBbf1O6dpDVgG71Qik/QS0oCG+GgbfODtidaP/12qt2C8 QWR7916D7D7KP/BVybzIOc1V2CcugF4YDpe7CDc5L8GIUPFSTOr7nqrfdGNafLLF+FH/ 1T3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c61cqr0r; 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 g11si2957173qtu.289.2020.02.14.10.19.52 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:19:52 -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=c61cqr0r; 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]:43590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fZ9-0003Az-Qb for patch@linaro.org; Fri, 14 Feb 2020 13:19:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60909) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVW-0004Um-2d for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVV-0000Fx-03 for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:05 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:33990) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVU-0000F8-Q7 for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:04 -0500 Received: by mail-pl1-x62c.google.com with SMTP id j7so4026785plt.1 for ; Fri, 14 Feb 2020 10:16:04 -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=a/LcTtPEaSKt2TqD4S4P5QmkhybGw6G87ufOx2pyeQw=; b=c61cqr0ruFzGdXgVtkN+YNg//bdC9gjAflB/RTCR+hibxY6RdyOLFzZxon4u+hZ8C4 r4B3GUR2u/8Q8sD98MpGvpSbBFNCvrd+j5uRXOJBKXBTAblu8bALN3mfmTWof1kYQzsv N14y+wrNtk3HE6x41aUIwxr7+llq4sU7UHqnKUFFS4TaV6nHAG4gOIt4J+XJiRrM/xg0 81DHM+qp0ujOaFXhAKQWymt5b6+/kzNndYYYYC7iayt1zOVtq8CfhY07ocvvdzNKDrDG DAuqpuRD8mzqRSDJdf3pKUTnEQ9lJNp5CyaGuh43K6L+H/pysgLZ5l3fgElXeMlHZa/I a1lA== 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=a/LcTtPEaSKt2TqD4S4P5QmkhybGw6G87ufOx2pyeQw=; b=mGCWy+LfcC/6mvSZlUb3HxDOx9VL3zIzBjphzfIZ/3J5f70eLwbmZiaQiG5HyF50ng 8wrPCMG58qJiLe15z67ktiIDGjiBjNrmiHWcoZa32uJNeQaEhmWopzJ9ZTjrnWotX5mo Maahv2BF5jW09sxMuRZfDmTm9NoGyvOR/fHcD3WvwSWP8rWzvOm9hj5kfMoQrCx2TCc4 d/53DrrqZB4IPbpUQmnzRXhSYjNURKmH3osH/L+/F3HqUq+UHdWqgW43fZF/Rs4Dcsuc BFAAcoQLtn06jxAjubdxEIpesxX5q/z5jK0QIX4OceNd/Un06d/8xJ0We/2tzP1NU+f1 1zmA== X-Gm-Message-State: APjAAAXG7bU+4BZ/ML7vOoI4QAsrK/aoIFB2BEEtSPnjyvY1XfnZY95m oJSFGdoSmKFwFDIEYMQlMM/2FMYg4wY= X-Received: by 2002:a17:90b:87:: with SMTP id bb7mr5164459pjb.49.1581704161742; Fri, 14 Feb 2020 10:16:01 -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.16.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:16:00 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 11/19] target/arm: Replace ARM_FEATURE_VFP4 with isar_feature_aa32_simdfmac Date: Fri, 14 Feb 2020 10:15:39 -0800 Message-Id: <20200214181547.21408-12-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::62c 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" All remaining tests for VFP4 are for fused multiply-add insns. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 5 +++++ target/arm/translate-vfp.inc.c | 12 ++++++++---- target/arm/translate.c | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) -- 2.20.1 diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 4ff28418df..f27b8e35df 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3468,6 +3468,11 @@ static inline bool isar_feature_aa32_fp16_dpconv(const ARMISARegisters *id) return FIELD_EX32(id->mvfr1, MVFR1, FPHP) > 1; } +static inline bool isar_feature_aa32_simdfmac(const ARMISARegisters *id) +{ + return FIELD_EX32(id->mvfr1, MVFR1, SIMDFMAC) != 0; +} + static inline bool isar_feature_aa32_vsel(const ARMISARegisters *id) { return FIELD_EX32(id->mvfr2, MVFR2, FPMISC) >= 1; diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index 8913320259..f6f7601fe2 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -1806,8 +1806,10 @@ static bool trans_VFM_sp(DisasContext *s, arg_VFM_sp *a) * In v7A, UNPREDICTABLE with non-zero vector length/stride; from * v8A, must UNDEF. We choose to UNDEF for both v7A and v8A. */ - if (!arm_dc_feature(s, ARM_FEATURE_VFP4) || - (s->vec_len != 0 || s->vec_stride != 0)) { + if (!dc_isar_feature(aa32_simdfmac, s)) { + return false; + } + if (s->vec_len != 0 || s->vec_stride != 0) { return false; } @@ -1864,8 +1866,10 @@ static bool trans_VFM_dp(DisasContext *s, arg_VFM_dp *a) * In v7A, UNPREDICTABLE with non-zero vector length/stride; from * v8A, must UNDEF. We choose to UNDEF for both v7A and v8A. */ - if (!arm_dc_feature(s, ARM_FEATURE_VFP4) || - (s->vec_len != 0 || s->vec_stride != 0)) { + if (!dc_isar_feature(aa32_simdfmac, s)) { + return false; + } + if (s->vec_len != 0 || s->vec_stride != 0) { return false; } diff --git a/target/arm/translate.c b/target/arm/translate.c index 3b9bf13933..0da780102c 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -4877,7 +4877,7 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) } break; case NEON_3R_VFM_VQRDMLSH: - if (!arm_dc_feature(s, ARM_FEATURE_VFP4)) { + if (!dc_isar_feature(aa32_simdfmac, s)) { return 1; } break; From patchwork Fri Feb 14 18:15:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183502 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2123452ile; Fri, 14 Feb 2020 10:16:21 -0800 (PST) X-Google-Smtp-Source: APXvYqxDBhmJDZY/bJfbKsYFiQWLMj4kd49ewyfWcM4nE+xP0hLXTwpounF/lwbyMw3BZM/IxVOw X-Received: by 2002:ae9:f205:: with SMTP id m5mr3882630qkg.152.1581704181347; Fri, 14 Feb 2020 10:16:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704181; cv=none; d=google.com; s=arc-20160816; b=eI24T/gXPjloFzEDKBJ2xaVi4WHU372XJYRtM1E9r7WxpJehXuvH7zLPJvf99GRtlJ jiEdVcqrXGnK1fxi6dQnffcbTrigavLM/kllLCvYeoe2sYlfRWDCDn5Nb75JHscxNOpt 8KdUhmUIuVc4HK76o4LODtXZA6dcUTWmEGmoHDsZmo/xH+HikwgDLWbLCzXhKrM1pldq uhSq8TBSIHtg/HqJtbpFZ2WoZWc8el2IHh1LPAraJNASPZGv4fxEhvGivqo9/XW2nD5c yAqDMiKMf2QD40e3RnoKxfRAJG28NqAjtUcluBKvWlXFb+VbdIwQ3cuLyhFSENNdXzqe CEMA== 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=hc+/AucXa0inxq9dbV/arLbbzIae9WxdVjI4zl5RMxY=; b=iWBeJAKX6ZiCX5bGX8HQFu9+3mc2+lqeF8ReQAOapryuoJ41Lb+Gy9qhsgA83lzkf/ DVLocbvQbmE8Rc8zIbcHZ4ujL9SFBqL8A1aL+l5XtJXVISq18I27AD9oFyXBtBRISWP/ N01JmiTcsFs6VOzQVfV8XYay26nGR5jR54diSnfd3aaGjQLFHZBk8cUvL4g40iQs9i1h Wl0/TsLD/xy/JzvuspgV4TR9qBEN2Q/all095YY3XakpomyKpwoQiC501IpDH8L8eAIl qbXoc7Fme8vvo4YEoocNCS7r9j0eOnO5kRho3Q/kdgLctVJxUw2woBy1fMa2MMBh8qej tpuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=upfqOujZ; 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 f1si2900100qvx.0.2020.02.14.10.16.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:16:21 -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=upfqOujZ; 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]:43456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVk-0004Za-RF for patch@linaro.org; Fri, 14 Feb 2020 13:16:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60894) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVV-0004TM-BA for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVU-0000FY-Dm for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:05 -0500 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:33297) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVU-0000FK-7H for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:04 -0500 Received: by mail-pl1-x644.google.com with SMTP id ay11so4028780plb.0 for ; Fri, 14 Feb 2020 10:16:04 -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=hc+/AucXa0inxq9dbV/arLbbzIae9WxdVjI4zl5RMxY=; b=upfqOujZGWqMRFNIe2Y4HrByxOI+hj3ayK33nXTKGLh9nQgtl7T2uG7bkQyxpUfpgE ZmgP10cb/8yOXuRakIVq4khHPFm/Wx0fOdOuvYJtthyjxbYjVPu9fLAJ6R66UMxjGQm6 u83i07TWr+DXx7tjIGC0AObz47i7a90B0tdWpb51vFN4wFQIzQjknvGNkvJcUItzhqpz P+hA0TvbSKBomcEECSUbRln2jdEU7krQ+XMVN26zQUje6KWoq9+DPzAjesGKRB25Nm4v ccdFeIo8jKQpVqX1b9mkuz7KLDnQhJblXLxhXF8AXrLHj9bBlTQVw1nAzyr7vOtWYjEH XF1A== 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=hc+/AucXa0inxq9dbV/arLbbzIae9WxdVjI4zl5RMxY=; b=KncrELX3+PPxgMbagT80tmnezGRC8brw7NmroCN8yrW65/BLQoGRgAD/Wlfkuakb96 I3cZbVNKOI/fXnuHcmqa2zjudjHM+XP7BVRbHYkZs/KBM6D1ccOdLFkCLxuUwT/pOu8M TY9xJc2YvJ4VUakHl2/xUaIuW9ZWM8mdeLr5OfZZotiegy8+gqaJ4lzmeWB1z76XXd5w 4JoWIjQ8KMDaoMG7YUbH1MTbhTOaCC6E7EXzV8Zeg3eLYVfNOpazbDKabvzYcbbW2G0h fLRpSo2InlwRnHmxc2O4kaDaSSmKPxu8qFNizSwO3sc/86DMq31KH7WUEoLfKSuWBanC 76FA== X-Gm-Message-State: APjAAAVyy5hLW3VG6VNEPI2XOfOJ2CVL0aPqf/Xv4kZ4lL38p/R2QPRs Ccu37QufgxZwByub9vO3IAK43sqsPX8= X-Received: by 2002:a17:902:a5c4:: with SMTP id t4mr4694242plq.242.1581704162920; Fri, 14 Feb 2020 10:16:02 -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.16.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:16:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 12/19] target/arm: Remove ARM_FEATURE_VFP check from disas_vfp_insn Date: Fri, 14 Feb 2020 10:15:40 -0800 Message-Id: <20200214181547.21408-13-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::644 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 now have proper ISA checks within each trans_* function. Signed-off-by: Richard Henderson --- target/arm/translate.c | 4 ---- 1 file changed, 4 deletions(-) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate.c b/target/arm/translate.c index 0da780102c..e8c3d4f26f 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -2652,10 +2652,6 @@ static void gen_neon_dup_high16(TCGv_i32 var) */ static int disas_vfp_insn(DisasContext *s, uint32_t insn) { - if (!arm_dc_feature(s, ARM_FEATURE_VFP)) { - return 1; - } - /* * If the decodetree decoder handles this insn it will always * emit code to either execute the insn or generate an appropriate From patchwork Fri Feb 14 18:15:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183514 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2128476ile; Fri, 14 Feb 2020 10:21:32 -0800 (PST) X-Google-Smtp-Source: APXvYqzTNh2kTfcZs2RcE54FVOUB9wm9i6VFR6FwaTqcdUjjZQDV+uzRBbXgOegMbxLKWhQ398Ww X-Received: by 2002:ac8:6f5b:: with SMTP id n27mr3427158qtv.96.1581704492409; Fri, 14 Feb 2020 10:21:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704492; cv=none; d=google.com; s=arc-20160816; b=RRYDb2JVqEI+cHrekTkc59YfRzma2//kuYA568GLMvPjRS8eB53HjGlJKXpBVT+6w3 AyV+xKsq6MTmjYRBwlKB6ty/gmQoWgYw2+zqaSP+UYyUjyNpZn/xwncCWpznZfxqMXdB 9wJPW4P3fT7EoRZI5sLa+ziuO/sTUGrh0ROSMWidO4YK3EMix/vEtdRhTa7ZLJz5BS1p Oj1cL/1czUw2ErEw92xefUgztFFDu2GbqoLULDNj0LJgT3sIsOwbVFKxcZqKX4V6pkhO S6J2C3GVRbESyzoBY/0HgmyUpiSHZFGxnFvrdbYhFsin3TqWXMH/0YHk5w9+oqBycX4V NfrA== 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=KNXQ9uIT7Co5CZWLUxtFqeHCHOoXldJvxdr++tcI33U=; b=Q8tGLdar0Z/9qshfaOvWh18Ds8/F4Wnk3NMp5rjQ6wzuEimsKFxJj3Noz4aNGJDQ49 sXOl0gYM/xBH9ARcAM7atfVLAUGpautw+2MFhpwTlSPgwlpvsmWQDZd45N79EEVETxNC v3aitfK4vhaHO79MM/L4OtLmzwBbYQGhJEVThmTFTg6fI6v9UDOPokEhQMDezT6bSG/w eYRIoGNAiQ22nZwWy5mbUHByt1lke8NxcZxHFD9dVxXvUS1l+mVPcw2NuPbZAF8CV4xH Owm1s1sCGmELsQ1G9zV3FdWFjb+k7VBXte3LrTbgZMYdFXfae9WG8F5WIh46rbiTYXOo a1cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p0TaMt+f; 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 j2si3314016qkg.4.2020.02.14.10.21.32 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:21:32 -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=p0TaMt+f; 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]:43660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fal-0006zw-Sf for patch@linaro.org; Fri, 14 Feb 2020 13:21:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60921) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVW-0004Vs-Vx for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVV-0000GM-Lm for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:06 -0500 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:37088) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVV-0000Fu-FM for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:05 -0500 Received: by mail-pf1-x444.google.com with SMTP id p14so5264995pfn.4 for ; Fri, 14 Feb 2020 10:16:05 -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=KNXQ9uIT7Co5CZWLUxtFqeHCHOoXldJvxdr++tcI33U=; b=p0TaMt+fQy9mNLg6/mlONYUBZ8Ubz9qwoEP++u5+q95ZSw4TxN78D30n9LgP0kSIXB c/B16AWveocGQ/PH60hrOV/Hceqe4EAmCqJWcHndjka8Q3io0iGeba03jZafyvruNZaY Lnvo+6nGlcjQu9fCWefveEVTZI6tt53R3RWpmvXd4Hw013bDHu0tHgn6i8cjsl5gf7gM HHIXeEm3YarIz8BAGKec1I09BtV50tQLMU+7LMyULJXG2TrL7aCKOQ/yxbYCuNLkdbFk jrz/omI5pC9V5fg9CWHYFWZ7xTUOWj7NGPNfjsWHvsscP/k/Eq5LE3xzLv4QqcQvU2oZ YtRA== 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=KNXQ9uIT7Co5CZWLUxtFqeHCHOoXldJvxdr++tcI33U=; b=tH3eB+7WX2oRoSbZoMi/bH2mlZXftsIbfTSfJ4xog9xGhQswwIi3rptOJ6ykXW3GRR j3+vBVV0WoStx8b64DumDCYzsnXBp8bqRr/qBCODNbPPnvTZl97gRqXWbQ7GbgeqVSOi MrF68UIzuWe7RbT5mj+XdJsYIDzTmpUc16TK70bSttMdSSHSTcmNPXW+lPICRFR37lXw aPizTmiYeplC/WqitbkactQZdNVEqxnMN2gRDqoUsgnPNiUlAD8v0otBgKuG9M6QKW0H DelZQxAqZ9BC49EjiwkNGbr7L8y5nrkmBpEEa0yEfzdE0XyYQCX5LUzyF/9jXd5QBqL7 hHFg== X-Gm-Message-State: APjAAAW4/PK0EG/Kbzd5UapSs55Dh5/5ovBit6wZ27H12w7i9hdKXiKW /R3HIIhx/1+6qtuIVtWjcxUpdGI9P6w= X-Received: by 2002:a65:6147:: with SMTP id o7mr5138480pgv.442.1581704164122; Fri, 14 Feb 2020 10:16:04 -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.16.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:16:03 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 13/19] target/arm: Move VLLDM and VLSTM to vfp.decode Date: Fri, 14 Feb 2020 10:15:41 -0800 Message-Id: <20200214181547.21408-14-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::444 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" Now that we no longer have an early check for ARM_FEATURE_VFP, we can use the proper ISA check in trans_VLLDM_VLSTM. Signed-off-by: Richard Henderson --- target/arm/vfp.decode | 2 ++ target/arm/translate-vfp.inc.c | 35 ++++++++++++++++++++++ target/arm/translate.c | 53 ++++++---------------------------- 3 files changed, 46 insertions(+), 44 deletions(-) -- 2.20.1 diff --git a/target/arm/vfp.decode b/target/arm/vfp.decode index a67b3f29ee..592fe9e1e4 100644 --- a/target/arm/vfp.decode +++ b/target/arm/vfp.decode @@ -242,3 +242,5 @@ VCVT_sp_int ---- 1110 1.11 110 s:1 .... 1010 rz:1 1.0 .... \ vd=%vd_sp vm=%vm_sp VCVT_dp_int ---- 1110 1.11 110 s:1 .... 1011 rz:1 1.0 .... \ vd=%vd_sp vm=%vm_dp + +VLLDM_VLSTM 1110 1100 001 l:1 rn:4 0000 1010 0000 0000 diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index f6f7601fe2..8f2b97e0e7 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -2816,3 +2816,38 @@ static bool trans_VCVT_dp_int(DisasContext *s, arg_VCVT_dp_int *a) tcg_temp_free_ptr(fpst); return true; } + +/* + * Decode VLLDM of VLSTM are nonstandard because: + * * if there is no FPU then these insns must NOP in + * Secure state and UNDEF in Nonsecure state + * * if there is an FPU then these insns do not have + * the usual behaviour that disas_vfp_insn() provides of + * being controlled by CPACR/NSACR enable bits or the + * lazy-stacking logic. + */ +static bool trans_VLLDM_VLSTM(DisasContext *s, arg_VLLDM_VLSTM *a) +{ + TCGv_i32 fptr; + + if (!arm_dc_feature(s, ARM_FEATURE_M) || + !arm_dc_feature(s, ARM_FEATURE_V8)) { + return false; + } + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + /* No FPU: NOP if secure, otherwise UNDEF. */ + return s->v8m_secure; + } + + fptr = load_reg(s, a->rn); + if (a->l) { + gen_helper_v7m_vlldm(cpu_env, fptr); + } else { + gen_helper_v7m_vlstm(cpu_env, fptr); + } + tcg_temp_free_i32(fptr); + + /* End the TB, because we have updated FP control bits */ + s->base.is_jmp = DISAS_UPDATE; + return true; +} diff --git a/target/arm/translate.c b/target/arm/translate.c index e8c3d4f26f..b2641b4262 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10708,53 +10708,18 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) goto illegal_op; /* op0 = 0b11 : unallocated */ } - /* - * Decode VLLDM and VLSTM first: these are nonstandard because: - * * if there is no FPU then these insns must NOP in - * Secure state and UNDEF in Nonsecure state - * * if there is an FPU then these insns do not have - * the usual behaviour that disas_vfp_insn() provides of - * being controlled by CPACR/NSACR enable bits or the - * lazy-stacking logic. - */ - if (arm_dc_feature(s, ARM_FEATURE_V8) && - (insn & 0xffa00f00) == 0xec200a00) { - /* 0b1110_1100_0x1x_xxxx_xxxx_1010_xxxx_xxxx - * - VLLDM, VLSTM - * We choose to UNDEF if the RAZ bits are non-zero. - */ - if (!s->v8m_secure || (insn & 0x0040f0ff)) { + if (disas_vfp_insn(s, insn)) { + if (((insn >> 8) & 0xe) == 10 && + dc_isar_feature(aa32_fpsp_v2, s)) { + /* FP, and the CPU supports it */ goto illegal_op; + } else { + /* All other insns: NOCP */ + gen_exception_insn(s, s->pc_curr, EXCP_NOCP, + syn_uncategorized(), + default_exception_el(s)); } - - if (arm_dc_feature(s, ARM_FEATURE_VFP)) { - uint32_t rn = (insn >> 16) & 0xf; - TCGv_i32 fptr = load_reg(s, rn); - - if (extract32(insn, 20, 1)) { - gen_helper_v7m_vlldm(cpu_env, fptr); - } else { - gen_helper_v7m_vlstm(cpu_env, fptr); - } - tcg_temp_free_i32(fptr); - - /* End the TB, because we have updated FP control bits */ - s->base.is_jmp = DISAS_UPDATE; - } - break; } - if (arm_dc_feature(s, ARM_FEATURE_VFP) && - ((insn >> 8) & 0xe) == 10) { - /* FP, and the CPU supports it */ - if (disas_vfp_insn(s, insn)) { - goto illegal_op; - } - break; - } - - /* All other insns: NOCP */ - gen_exception_insn(s, s->pc_curr, EXCP_NOCP, syn_uncategorized(), - default_exception_el(s)); break; } if ((insn & 0xfe000a00) == 0xfc000800 From patchwork Fri Feb 14 18:15:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183520 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2133632ile; Fri, 14 Feb 2020 10:27:09 -0800 (PST) X-Google-Smtp-Source: APXvYqweItwFGJu6MV7euElxnrYOPSfizobSXvMib5ivX0ScYAtKrmKSJsihaE8My0X2Ir5O9uT6 X-Received: by 2002:ae9:e602:: with SMTP id z2mr3931955qkf.50.1581704829552; Fri, 14 Feb 2020 10:27:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704829; cv=none; d=google.com; s=arc-20160816; b=VzHf98aZhhUoONR+qbOQ33pDV56yHQ8Y3fq0D8CgcnwTydDdVxXB1aXscAxSUICfb8 vpAjbb98K5vJUuRJj5gT67/tQYLokI1HspZHUiQIH66tRHMIRn7c0lsKeV2H4sY7A/Hc /SpnN+Z/PuEKIeSg1APphCsAwp5vFAv5Wat3QDZiLfFjtbR7eVmsGUEjMNz9RAwIIG+9 Wct+IZvDIgxUd44xjlu6DpqUbzCofRuxtd3FJabzEDgYYPPqcg5KcSNR41SyBZmp4Xom cjv6tJYug1W9/3Yg0eV31oJSSR8yniCCXEYVDe9OCWQVrVhJb3hq9pRX8ugvHBfb2WTy ir3A== 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=2kZ9BsLAsFQXYPLtyMT3ZoVnOYLNLzYgitMu8C6B1ag=; b=eF56d5/QQ6GaouuUkE+0UPA0qPhUZuuzxBdX4XUbuZwiC4sFPJjyo1TiwbAAj6GfJi CDlrd2Z4LxYDsSww7V/wPp+LVMq4D5CtWsTIMqnFORXKg32FlOwvY3XLCUTpprXWERUS Za2LDQb9uWNqEZ5JA/g3eF5x3vCr5GMaxPo7pynefH4q1XjEyQ3wTMvCmD7WKPVOcnm9 yS79khZvHRV1tQSgSvvCeEK3a4Y6Dqs+RlgcleTAuuX0YXmxWJ3Hh7nsn8zkyREWDydh gymjVtmh5GPvEakLuGq4CK4MsHcQiO+1a+TXScMM+YqRnABf3FgpYn6JTKsWckhemW0K EyLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="kfgDX/Av"; 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 s17si3245344qks.344.2020.02.14.10.27.09 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:27:09 -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="kfgDX/Av"; 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]:43820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fgD-0008Jz-3p for patch@linaro.org; Fri, 14 Feb 2020 13:27:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60934) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVY-0004aD-Cd for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVX-0000HG-1P for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:08 -0500 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:33844) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVW-0000Gh-Rq for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:06 -0500 Received: by mail-pf1-x441.google.com with SMTP id i6so5272579pfc.1 for ; Fri, 14 Feb 2020 10:16:06 -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=2kZ9BsLAsFQXYPLtyMT3ZoVnOYLNLzYgitMu8C6B1ag=; b=kfgDX/AvC7uAk2+/8dqYe+dRnlgoXukH0uruVMfMj9VSUyM3F2LxP3l93gzpy5mSH9 lbip3mDlr+1wqQ/v1DNOo9EwUYHQgLXFdcX3hyDbeTPIApbyVQVeyrlweUp7KT6yf6zw 3xVb8wDIHXqI0LYzLRJonFw/EasfWyN/0EWLwb48LRKYxUjozt+eAeabiM09Sdi4x/dZ 1Bu089O3lo1QXr1sJozglvqtK/rvVvXkN/t0rlQIGCjqOtHigUOK8ZbFDQ4oB9cRaRcs pLMNoeiKXmTbOgyK2eypewi5R+yvP83qlgak9nPikfJ5rVgxt2ZXHxH5zzLfNxn3w05S F/Rw== 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=2kZ9BsLAsFQXYPLtyMT3ZoVnOYLNLzYgitMu8C6B1ag=; b=qRjRh7y5yqMauDyRSv+IMV42yI1h2pkybxZdzVcusbTSu7ru7qQDzxaljfSfqCdaOu L0ttu6W8/Qs2jt7wyUZk1kua77WfD8PDHc+aZD34CToPB2yMqMrVcWbWHCmgmb4NOP7e CDP2WI4vynKxFZVxdbqlelT2rP0qDCzTxFopvdeBFA8TX/97aAn6bFZl/wSBu6ji0o4q nCJoIB9j67rBLz73fFr8pPWpi53NpTwlPUN85PtBPqOiPbzwUcQ62Qso3kesnKVc/9Km U2LR0AUqDdp6Gf/OjFOY/6KhkokN72pcnOe0wVBV+EbmNqrOrsWUKwxMtCg8rAQhFWb/ bd2Q== X-Gm-Message-State: APjAAAWRYIYr7aD/HWq/ym3pYDwxMiIGkRISTjVyW2tTUsw7WgBQBqRj jCwPyJX4t9dHmjmiC+PKxRw4ZMfp8s0= X-Received: by 2002:a65:68ce:: with SMTP id k14mr4655713pgt.336.1581704165314; Fri, 14 Feb 2020 10:16:05 -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.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:16:04 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 14/19] target/arm: Move the vfp decodetree calls next to the base isa Date: Fri, 14 Feb 2020 10:15:42 -0800 Message-Id: <20200214181547.21408-15-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::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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Have the calls adjacent as an intermediate step toward actually merging the decodes. Signed-off-by: Richard Henderson --- target/arm/translate.c | 80 +++++++++++++----------------------------- 1 file changed, 24 insertions(+), 56 deletions(-) -- 2.20.1 diff --git a/target/arm/translate.c b/target/arm/translate.c index b2641b4262..5cabe6b2e9 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -2646,31 +2646,6 @@ static void gen_neon_dup_high16(TCGv_i32 var) tcg_temp_free_i32(tmp); } -/* - * Disassemble a VFP instruction. Returns nonzero if an error occurred - * (ie. an undefined instruction). - */ -static int disas_vfp_insn(DisasContext *s, uint32_t insn) -{ - /* - * If the decodetree decoder handles this insn it will always - * emit code to either execute the insn or generate an appropriate - * exception; so we don't need to ever return non-zero to tell - * the calling code to emit an UNDEF exception. - */ - if (extract32(insn, 28, 4) == 0xf) { - if (disas_vfp_uncond(s, insn)) { - return 0; - } - } else { - if (disas_vfp(s, insn)) { - return 0; - } - } - /* If the decodetree decoder didn't handle this insn, it must be UNDEF */ - return 1; -} - static inline bool use_goto_tb(DisasContext *s, target_ulong dest) { #ifndef CONFIG_USER_ONLY @@ -10524,7 +10499,9 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) ARCH(5); /* Unconditional instructions. */ - if (disas_a32_uncond(s, insn)) { + /* TODO: Perhaps merge these into one decodetree output file. */ + if (disas_a32_uncond(s, insn) || + disas_vfp_uncond(s, insn)) { return; } /* fall back to legacy decoder */ @@ -10551,13 +10528,6 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) } return; } - if ((insn & 0x0f000e10) == 0x0e000a00) { - /* VFP. */ - if (disas_vfp_insn(s, insn)) { - goto illegal_op; - } - return; - } if ((insn & 0x0e000f00) == 0x0c000100) { if (arm_dc_feature(s, ARM_FEATURE_IWMMXT)) { /* iWMMXt register transfer. */ @@ -10588,7 +10558,9 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) arm_skip_unless(s, cond); } - if (disas_a32(s, insn)) { + /* TODO: Perhaps merge these into one decodetree output file. */ + if (disas_a32(s, insn) || + disas_vfp(s, insn)) { return; } /* fall back to legacy decoder */ @@ -10597,12 +10569,7 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) case 0xc: case 0xd: case 0xe: - if (((insn >> 8) & 0xe) == 10) { - /* VFP. */ - if (disas_vfp_insn(s, insn)) { - goto illegal_op; - } - } else if (disas_coproc_insn(s, insn)) { + if (((insn >> 8) & 0xe) != 10 && disas_coproc_insn(s, insn)) { /* Coprocessor. */ goto illegal_op; } @@ -10691,7 +10658,14 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) ARCH(6T2); } - if (disas_t32(s, insn)) { + /* + * TODO: Perhaps merge these into one decodetree output file. + * Note disas_vfp is written for a32 with cond field in the + * top nibble. The t32 encoding requires 0xe in the top nibble. + */ + if (disas_t32(s, insn) || + disas_vfp_uncond(s, insn) || + ((insn >> 28) == 0xe && disas_vfp(s, insn))) { return; } /* fall back to legacy decoder */ @@ -10708,17 +10682,15 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) goto illegal_op; /* op0 = 0b11 : unallocated */ } - if (disas_vfp_insn(s, insn)) { - if (((insn >> 8) & 0xe) == 10 && - dc_isar_feature(aa32_fpsp_v2, s)) { - /* FP, and the CPU supports it */ - goto illegal_op; - } else { - /* All other insns: NOCP */ - gen_exception_insn(s, s->pc_curr, EXCP_NOCP, - syn_uncategorized(), - default_exception_el(s)); - } + if (((insn >> 8) & 0xe) == 10 && + dc_isar_feature(aa32_fpsp_v2, s)) { + /* FP, and the CPU supports it */ + goto illegal_op; + } else { + /* All other insns: NOCP */ + gen_exception_insn(s, s->pc_curr, EXCP_NOCP, + syn_uncategorized(), + default_exception_el(s)); } break; } @@ -10740,10 +10712,6 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) if (disas_neon_data_insn(s, insn)) { goto illegal_op; } - } else if (((insn >> 8) & 0xe) == 10) { - if (disas_vfp_insn(s, insn)) { - goto illegal_op; - } } else { if (insn & (1 << 28)) goto illegal_op; From patchwork Fri Feb 14 18:15:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183510 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2127645ile; Fri, 14 Feb 2020 10:20:39 -0800 (PST) X-Google-Smtp-Source: APXvYqx1VAATTPyu58McYwY5kmunKprL3zy7UbAPqZcOQ9BR/soz7FOdIofwJ0HT1yWeho41v928 X-Received: by 2002:a05:620a:8ca:: with SMTP id z10mr3432594qkz.242.1581704438892; Fri, 14 Feb 2020 10:20:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704438; cv=none; d=google.com; s=arc-20160816; b=VGsuTcdCFFKR0tc+9+zp5BtpvfQtEANFWB8Co7nQg20Zzj/L+fS4/6Y8iA/hfB36rn 50WO6AMW2+Dg8w4/WYLnjsAsjNuTzzIruPoHApUY/x+HMp/TdMCmTbqaACi1Q7AGMQPa tzll9K3B/PaEHxjfT5xoYnBF+GmDLKiJmSv+RifynkgGwQyI+tQl7sD3aKVPkVIypPOz chVXzkt827F4w1hVgAdIz7q16zzWC0X4oQ/qev8+3wx19RY3aCxSf5bl5gvowJVfdgG5 eulGz6oJQDTrAydrvSyA+EQx6aD1yEmSF34XOl3dg+ASKJDOMUnITI2r6ogLD8uCVFWP SXGQ== 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=M8UM5e+3VRfykuEhj/KpHZJCPyatXYB/tx3EOhHQRHg=; b=Br4xz9/tIshDWUW0shLyCPQm6xjf3LehCEYMFaf3t3kOJl7BBoqsavLkD36FhyyOlv Z0tLpKhch1w5ZO91QnUYDsqiJEWSh0QM+Tmg4J5BsCGCHaEELVoZug+YUrToe25/eRaN qZO5s09l8mMKEgjv9V9qqhlm4eYcBZlSo59h2PbLe7Q0fJ4oNb2+rnYnzpfbuuYAlWjl ejT9r52AD5ar3oo9Qn93hR9Mn663se4ppeYBvOZgq+3Pq4Y1j41qCRKq//5YTQyUUBcb 7rCXr7jnl+I4H6A1N89pYjqCP5kBKhy+rydyZriwlzZ/FABrtkBUCWy3Lp8eg+41HJk9 48mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P2a3DJc5; 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 s189si3436203qke.311.2020.02.14.10.20.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:20:38 -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=P2a3DJc5; 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]:43624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fZu-0004iW-DK for patch@linaro.org; Fri, 14 Feb 2020 13:20:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60941) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVZ-0004cJ-3E for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVX-0000Hq-W1 for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:09 -0500 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:38895) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVX-0000HU-Pz for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:07 -0500 Received: by mail-pg1-x542.google.com with SMTP id d6so5339844pgn.5 for ; Fri, 14 Feb 2020 10:16:07 -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=M8UM5e+3VRfykuEhj/KpHZJCPyatXYB/tx3EOhHQRHg=; b=P2a3DJc5xDlZOW9ERiwMm2spp1DfTNP6HytA05EBy4VJ6VjnjDmpDWo3u1al6wnrcu 4eu6uz1lmVNk6+n8YQXvZiGj5XOPC6yDBt+InvAaKmEL8VzaJEqN8LYaPc5FyxFiTW8I jgC8s+c8/9a+WSFRPcmhBnXkeQY6VAmslVw/KczReCT3bLvNxKRXX3VkJA6TL3+Et0aF QZrP78lB5CGcujeJHbaIMvCTAPAi63ZochngZinYJgXgxCQIy+0lEC+TIDCZMYo08hpk 4dTnDb9lPrj94DvEAsVuo1/AUPjITVSIZqKsqpcvmr0uaCwPFCmfyIuoI17/snwsk3b4 +EzA== 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=M8UM5e+3VRfykuEhj/KpHZJCPyatXYB/tx3EOhHQRHg=; b=oNiJ7Ga/K1wtov2rRFMSHKTtD0/z3lEkwDJL32oN2ekmhDgNGwrWVOtgeLtM2UwqAD iIHhRYpLoiUpKC5UuNZypNjSdacoMLmc2MgVbEc72YP+r1XpldH8vq5pGYtOWkep8/pd I45o30G63gkuwEaiV8NJcXc1+Rh6R6F8YZPfccAI6LjkcYkKw343K3cufUtLRPWy1BbL PhwrgAP/MGmRQtzjapA6MgiVbky7rrehSh7eE4TR7litY717cz62BoNFqe7b2pGnAA11 fZqYzzbtmjjV/jr7nZ/RH/0Nqn3RNnGqF3wzcbaC/2dhc2TJvTLElAoo8wVDkCHaw3ma kMyg== X-Gm-Message-State: APjAAAXAjZSDaXHiZiFCIadShd9PJJGcbTbfFZloqqn5nZTzIg3RR4Bs OJKYK3Pyo6tNLsvU5FBqFY+Q6mB/Sbk= X-Received: by 2002:a63:5a65:: with SMTP id k37mr5002076pgm.264.1581704166488; Fri, 14 Feb 2020 10:16:06 -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.16.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:16:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 15/19] linux-user/arm: Replace ARM_FEATURE_VFP* tests for HWCAP Date: Fri, 14 Feb 2020 10:15:43 -0800 Message-Id: <20200214181547.21408-16-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::542 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" Use isar feature tests instead of feature bit tests. Although none of QEMUs current cpus have VFPv3 without D32, replace the large comment explaining why with one line that sets ARM_HWCAP_ARM_VFPv3D16 under the correct conditions. Mirror the test sequence used in the linux kernel. Signed-off-by: Richard Henderson --- linux-user/elfload.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) -- 2.20.1 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index f3080a1635..c52c814a2e 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -468,22 +468,28 @@ static uint32_t get_elf_hwcap(void) /* EDSP is in v5TE and above, but all our v5 CPUs are v5TE */ GET_FEATURE(ARM_FEATURE_V5, ARM_HWCAP_ARM_EDSP); - GET_FEATURE(ARM_FEATURE_VFP, ARM_HWCAP_ARM_VFP); GET_FEATURE(ARM_FEATURE_IWMMXT, ARM_HWCAP_ARM_IWMMXT); GET_FEATURE(ARM_FEATURE_THUMB2EE, ARM_HWCAP_ARM_THUMBEE); GET_FEATURE(ARM_FEATURE_NEON, ARM_HWCAP_ARM_NEON); - GET_FEATURE(ARM_FEATURE_VFP3, ARM_HWCAP_ARM_VFPv3); GET_FEATURE(ARM_FEATURE_V6K, ARM_HWCAP_ARM_TLS); - GET_FEATURE(ARM_FEATURE_VFP4, ARM_HWCAP_ARM_VFPv4); + GET_FEATURE(ARM_FEATURE_LPAE, ARM_HWCAP_ARM_LPAE); + GET_FEATURE_ID(arm_div, ARM_HWCAP_ARM_IDIVA); GET_FEATURE_ID(thumb_div, ARM_HWCAP_ARM_IDIVT); - /* All QEMU's VFPv3 CPUs have 32 registers, see VFP_DREG in translate.c. - * Note that the ARM_HWCAP_ARM_VFPv3D16 bit is always the inverse of - * ARM_HWCAP_ARM_VFPD32 (and so always clear for QEMU); it is unrelated - * to our VFP_FP16 feature bit. + /* + * Note that none of QEMU's cpus have double precision without single + * precision support in VFP, so only test the single precision field. */ - GET_FEATURE(ARM_FEATURE_VFP3, ARM_HWCAP_ARM_VFPD32); - GET_FEATURE(ARM_FEATURE_LPAE, ARM_HWCAP_ARM_LPAE); + GET_FEATURE_ID(aa32_fpsp_v2, ARM_HWCAP_ARM_VFP); + if (cpu_isar_feature(aa32_fpsp_v3, cpu)) { + hwcaps |= ARM_HWCAP_ARM_VFPv3; + if (cpu_isar_feature(aa32_simd_r32, cpu)) { + hwcaps |= ARM_HWCAP_ARM_VFPD32; + } else { + hwcaps |= ARM_HWCAP_ARM_VFPv3D16; + } + } + GET_FEATURE_ID(aa32_simdfmac, ARM_HWCAP_ARM_VFPv4); return hwcaps; } From patchwork Fri Feb 14 18:15:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183509 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2127024ile; Fri, 14 Feb 2020 10:19:56 -0800 (PST) X-Google-Smtp-Source: APXvYqxbuiHXw14KW3iCne4YwdZCLW4LGx2GOcHUXu71ZoG1BsyysqRBhCQ8uRdnJfYrBbHV7QOJ X-Received: by 2002:aed:2ae7:: with SMTP id t94mr3606092qtd.130.1581704396686; Fri, 14 Feb 2020 10:19:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704396; cv=none; d=google.com; s=arc-20160816; b=gMvn/C3yAeAPP5h/UDsiJlbmMVEhi5jyjaXcfRb0yNtQC2EtoB2EZ3jtE2JV/GutVs pqSCTCNBExLo4DQYs7Xs4ZZvje0JxvtyCm+jBlA6qmYxZggPXE1DXuGDlwUhoqCZiXxT wH4EUW8pGu4PB3f/vKEEX5ALpNvx9GOFS5HPhgjP8QZX5Vd/rS/LVuBz9kPYcoddS60R M4KAOxNwMOGtJbPEIJfgltl/YSfeH5z4FZG7jJp5s9JJf9pT/rTPeppzXJZ+Gnry9RKl UrwccHQuq/M/UTenpuQA3cAAMjb/Au4wsRdbhaSjdSOITtRO6q1IG0Dq9ZYvLCLJunQj UXlQ== 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=3XMTldT5aciMedkzJMCvbzI5Oq2p1yxlgK/fC8SFtRE=; b=yH3YMRdU6wgoeO9errfyHQ8V0b/npKQ7kIGGCeaysbkrIqoW1QAgINdxk4DkrrYs/l MHRYancxhitDu4fN8cbSGkij0x2MupsgG3C0WWQ9sczd1L6tSOmpEWPW70N6jgwHB/oN NN24q6gPZkSFoAq9yb9HIJ7+kV5OtMA/lN1nGqXpnx0bIYtQFfpkB/LhFKGF+XXXxALP Fnvj2bYuXEVPNHkVWsVVnl/3elYzkzh4EsYJZGnPm/PIAAsNNlO9VPWQM6iVT71zXoEQ k/aCED5Pq+vtw9NlKuIdTCIIacejXRwxfOn3wS8OkjR6t+tzfEKguRiE8ZnHTqLDys0n 1KLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DqVXLRHk; 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 p41si3177538qtk.205.2020.02.14.10.19.56 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:19:56 -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=DqVXLRHk; 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]:43600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fZE-0003Og-4I for patch@linaro.org; Fri, 14 Feb 2020 13:19:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60960) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVb-0004gX-B0 for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVZ-0000J9-Ej for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:11 -0500 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:43077) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVZ-0000IX-6u for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:09 -0500 Received: by mail-pf1-x442.google.com with SMTP id s1so5247084pfh.10 for ; Fri, 14 Feb 2020 10:16:09 -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=3XMTldT5aciMedkzJMCvbzI5Oq2p1yxlgK/fC8SFtRE=; b=DqVXLRHk2AH0TOk9roOM71XK1ogP/3Ai25uA6tTNypXI41T+M+J6t/afMcMMWYNAFV vHCuUhb6oWtcvads4BwBg8CUiJLn3SdfcGAvfpwKW086+rMgpawqDdfzcg4j+1JGRjqq v3hSfOOnZc/T1k+g6ONKUIISblkvzsiApDj2HoSIcjR/ol9mHLMou9P+jz1bcl4lg3og jkj2JHfz/xPB0Po+AWvSp+pIBFNKVZMeo9D6sz+qTcf/LBS8Eq6ricOWESWdySNx6xDW rIdzHWw3+v9t62EZ8LaTb+vqWzBqgTWtvuFPhzVzigcLetR/Zi4+Fxi9ZJaJEyP6icvi yU0g== 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=3XMTldT5aciMedkzJMCvbzI5Oq2p1yxlgK/fC8SFtRE=; b=LMC/Ahgq93SpcYPXo0ayD8THGND8SA65yRY5V+pl8fXiB2yXmfFBegNlZU4SqmGMdb DHhOUlddnimnTYU1MSnyoEhJGIQYTRSXc+zggVXkwOTAZCZZh7eLYoiWzLbC2ZJzWyqo X/oc3JJuo9AAI6JJY4QDOxbkqMQUwqbMZf46l0hxPGr1hMOHf+CILvstX14bv48Lmci2 NAJRlJRR1sIo8i1vaXFoaYDB8x6iZOwjco5+dkAXvBNUCxZkzMW/IEOMk68NBb3BHvAg pt/KT07K3Y6TvwKCIYiUbIDC18GsX74uHsYfh1/36yCiRbg4JSwvm/t2uYRoFrVYx0hC lAjg== X-Gm-Message-State: APjAAAWDMyZCnNnBGRnSp/o0Bin4Xdx1R+I2+yYch/hB+kBBHLM553C6 kbOMAHFXwOydT//65ITLrmbaKOFUlq4= X-Received: by 2002:a63:242:: with SMTP id 63mr4685514pgc.84.1581704167558; Fri, 14 Feb 2020 10:16:07 -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.16.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:16:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 16/19] target/arm: Remove ARM_FEATURE_VFP* Date: Fri, 14 Feb 2020 10:15:44 -0800 Message-Id: <20200214181547.21408-17-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::442 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 have converted all tests against these features to ISAR tests. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 3 --- target/arm/cpu.c | 25 ------------------------- target/arm/cpu64.c | 3 --- target/arm/kvm32.c | 5 ----- target/arm/kvm64.c | 1 - 5 files changed, 37 deletions(-) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/target/arm/cpu.h b/target/arm/cpu.h index f27b8e35df..571038d0de 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1858,7 +1858,6 @@ QEMU_BUILD_BUG_ON(ARRAY_SIZE(((ARMCPU *)0)->ccsidr) <= R_V7M_CSSELR_INDEX_MASK); * mapping in linux-user/elfload.c:get_elf_hwcap(). */ enum arm_features { - ARM_FEATURE_VFP, ARM_FEATURE_AUXCR, /* ARM1026 Auxiliary control register. */ ARM_FEATURE_XSCALE, /* Intel XScale extensions. */ ARM_FEATURE_IWMMXT, /* Intel iwMMXt extension. */ @@ -1867,7 +1866,6 @@ enum arm_features { ARM_FEATURE_V7, ARM_FEATURE_THUMB2, ARM_FEATURE_PMSA, /* no MMU; may have Memory Protection Unit */ - ARM_FEATURE_VFP3, ARM_FEATURE_NEON, ARM_FEATURE_M, /* Microcontroller profile. */ ARM_FEATURE_OMAPCP, /* OMAP specific CP15 ops handling. */ @@ -1878,7 +1876,6 @@ enum arm_features { ARM_FEATURE_V5, ARM_FEATURE_STRONGARM, ARM_FEATURE_VAPA, /* cp15 VA to PA lookups */ - ARM_FEATURE_VFP4, /* VFPv4 (implies that NEON is v2) */ ARM_FEATURE_GENERIC_TIMER, ARM_FEATURE_MVFR, /* Media and VFP Feature Registers 0 and 1 */ ARM_FEATURE_DUMMY_C15_REGS, /* RAZ/WI all of cp15 crn=15 */ diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 8d3eff8cb3..afb80d4636 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1208,13 +1208,6 @@ void arm_cpu_post_init(Object *obj) if (arm_feature(&cpu->env, ARM_FEATURE_M)) { set_feature(&cpu->env, ARM_FEATURE_PMSA); } - /* Similarly for the VFP feature bits */ - if (arm_feature(&cpu->env, ARM_FEATURE_VFP4)) { - set_feature(&cpu->env, ARM_FEATURE_VFP3); - } - if (arm_feature(&cpu->env, ARM_FEATURE_VFP3)) { - set_feature(&cpu->env, ARM_FEATURE_VFP); - } if (arm_feature(&cpu->env, ARM_FEATURE_CBAR) || arm_feature(&cpu->env, ARM_FEATURE_CBAR_RO)) { @@ -1440,10 +1433,6 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) uint64_t t; uint32_t u; - unset_feature(env, ARM_FEATURE_VFP); - unset_feature(env, ARM_FEATURE_VFP3); - unset_feature(env, ARM_FEATURE_VFP4); - t = cpu->isar.id_aa64isar1; t = FIELD_DP64(t, ID_AA64ISAR1, JSCVT, 0); cpu->isar.id_aa64isar1 = t; @@ -1855,7 +1844,6 @@ static void arm926_initfn(Object *obj) cpu->dtb_compatible = "arm,arm926"; set_feature(&cpu->env, ARM_FEATURE_V5); - set_feature(&cpu->env, ARM_FEATURE_VFP); set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); set_feature(&cpu->env, ARM_FEATURE_CACHE_TEST_CLEAN); cpu->midr = 0x41069265; @@ -1896,7 +1884,6 @@ static void arm1026_initfn(Object *obj) cpu->dtb_compatible = "arm,arm1026"; set_feature(&cpu->env, ARM_FEATURE_V5); - set_feature(&cpu->env, ARM_FEATURE_VFP); set_feature(&cpu->env, ARM_FEATURE_AUXCR); set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); set_feature(&cpu->env, ARM_FEATURE_CACHE_TEST_CLEAN); @@ -1944,7 +1931,6 @@ static void arm1136_r2_initfn(Object *obj) cpu->dtb_compatible = "arm,arm1136"; set_feature(&cpu->env, ARM_FEATURE_V6); - set_feature(&cpu->env, ARM_FEATURE_VFP); set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); set_feature(&cpu->env, ARM_FEATURE_CACHE_DIRTY_REG); set_feature(&cpu->env, ARM_FEATURE_CACHE_BLOCK_OPS); @@ -1976,7 +1962,6 @@ static void arm1136_initfn(Object *obj) cpu->dtb_compatible = "arm,arm1136"; set_feature(&cpu->env, ARM_FEATURE_V6K); set_feature(&cpu->env, ARM_FEATURE_V6); - set_feature(&cpu->env, ARM_FEATURE_VFP); set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); set_feature(&cpu->env, ARM_FEATURE_CACHE_DIRTY_REG); set_feature(&cpu->env, ARM_FEATURE_CACHE_BLOCK_OPS); @@ -2007,7 +1992,6 @@ static void arm1176_initfn(Object *obj) cpu->dtb_compatible = "arm,arm1176"; set_feature(&cpu->env, ARM_FEATURE_V6K); - set_feature(&cpu->env, ARM_FEATURE_VFP); set_feature(&cpu->env, ARM_FEATURE_VAPA); set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); set_feature(&cpu->env, ARM_FEATURE_CACHE_DIRTY_REG); @@ -2040,7 +2024,6 @@ static void arm11mpcore_initfn(Object *obj) cpu->dtb_compatible = "arm,arm11mpcore"; set_feature(&cpu->env, ARM_FEATURE_V6K); - set_feature(&cpu->env, ARM_FEATURE_VFP); set_feature(&cpu->env, ARM_FEATURE_VAPA); set_feature(&cpu->env, ARM_FEATURE_MPIDR); set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); @@ -2106,7 +2089,6 @@ static void cortex_m4_initfn(Object *obj) set_feature(&cpu->env, ARM_FEATURE_M); set_feature(&cpu->env, ARM_FEATURE_M_MAIN); set_feature(&cpu->env, ARM_FEATURE_THUMB_DSP); - set_feature(&cpu->env, ARM_FEATURE_VFP4); cpu->midr = 0x410fc240; /* r0p0 */ cpu->pmsav7_dregion = 8; cpu->isar.mvfr0 = 0x10110021; @@ -2137,7 +2119,6 @@ static void cortex_m7_initfn(Object *obj) set_feature(&cpu->env, ARM_FEATURE_M); set_feature(&cpu->env, ARM_FEATURE_M_MAIN); set_feature(&cpu->env, ARM_FEATURE_THUMB_DSP); - set_feature(&cpu->env, ARM_FEATURE_VFP4); cpu->midr = 0x411fc272; /* r1p2 */ cpu->pmsav7_dregion = 8; cpu->isar.mvfr0 = 0x10110221; @@ -2169,7 +2150,6 @@ static void cortex_m33_initfn(Object *obj) set_feature(&cpu->env, ARM_FEATURE_M_MAIN); set_feature(&cpu->env, ARM_FEATURE_M_SECURITY); set_feature(&cpu->env, ARM_FEATURE_THUMB_DSP); - set_feature(&cpu->env, ARM_FEATURE_VFP4); cpu->midr = 0x410fd213; /* r0p3 */ cpu->pmsav7_dregion = 16; cpu->sau_sregion = 8; @@ -2253,7 +2233,6 @@ static void cortex_r5f_initfn(Object *obj) ARMCPU *cpu = ARM_CPU(obj); cortex_r5_initfn(obj); - set_feature(&cpu->env, ARM_FEATURE_VFP3); cpu->isar.mvfr0 = 0x10110221; cpu->isar.mvfr1 = 0x00000011; } @@ -2272,7 +2251,6 @@ static void cortex_a8_initfn(Object *obj) cpu->dtb_compatible = "arm,cortex-a8"; set_feature(&cpu->env, ARM_FEATURE_V7); - set_feature(&cpu->env, ARM_FEATURE_VFP3); set_feature(&cpu->env, ARM_FEATURE_NEON); set_feature(&cpu->env, ARM_FEATURE_THUMB2EE); set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); @@ -2340,7 +2318,6 @@ static void cortex_a9_initfn(Object *obj) cpu->dtb_compatible = "arm,cortex-a9"; set_feature(&cpu->env, ARM_FEATURE_V7); - set_feature(&cpu->env, ARM_FEATURE_VFP3); set_feature(&cpu->env, ARM_FEATURE_NEON); set_feature(&cpu->env, ARM_FEATURE_THUMB2EE); set_feature(&cpu->env, ARM_FEATURE_EL3); @@ -2405,7 +2382,6 @@ static void cortex_a7_initfn(Object *obj) cpu->dtb_compatible = "arm,cortex-a7"; set_feature(&cpu->env, ARM_FEATURE_V7VE); - set_feature(&cpu->env, ARM_FEATURE_VFP4); set_feature(&cpu->env, ARM_FEATURE_NEON); set_feature(&cpu->env, ARM_FEATURE_THUMB2EE); set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER); @@ -2451,7 +2427,6 @@ static void cortex_a15_initfn(Object *obj) cpu->dtb_compatible = "arm,cortex-a15"; set_feature(&cpu->env, ARM_FEATURE_V7VE); - set_feature(&cpu->env, ARM_FEATURE_VFP4); set_feature(&cpu->env, ARM_FEATURE_NEON); set_feature(&cpu->env, ARM_FEATURE_THUMB2EE); set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER); diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index f0d98bc79d..e4e8499e71 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -102,7 +102,6 @@ static void aarch64_a57_initfn(Object *obj) cpu->dtb_compatible = "arm,cortex-a57"; set_feature(&cpu->env, ARM_FEATURE_V8); - set_feature(&cpu->env, ARM_FEATURE_VFP4); set_feature(&cpu->env, ARM_FEATURE_NEON); set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER); set_feature(&cpu->env, ARM_FEATURE_AARCH64); @@ -156,7 +155,6 @@ static void aarch64_a53_initfn(Object *obj) cpu->dtb_compatible = "arm,cortex-a53"; set_feature(&cpu->env, ARM_FEATURE_V8); - set_feature(&cpu->env, ARM_FEATURE_VFP4); set_feature(&cpu->env, ARM_FEATURE_NEON); set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER); set_feature(&cpu->env, ARM_FEATURE_AARCH64); @@ -210,7 +208,6 @@ static void aarch64_a72_initfn(Object *obj) cpu->dtb_compatible = "arm,cortex-a72"; set_feature(&cpu->env, ARM_FEATURE_V8); - set_feature(&cpu->env, ARM_FEATURE_VFP4); set_feature(&cpu->env, ARM_FEATURE_NEON); set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER); set_feature(&cpu->env, ARM_FEATURE_AARCH64); diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c index 3a8b437eef..2e7d7a1e02 100644 --- a/target/arm/kvm32.c +++ b/target/arm/kvm32.c @@ -122,7 +122,6 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) * bits, but a few must be tested. */ set_feature(&features, ARM_FEATURE_V7VE); - set_feature(&features, ARM_FEATURE_VFP3); set_feature(&features, ARM_FEATURE_GENERIC_TIMER); if (extract32(id_pfr0, 12, 4) == 1) { @@ -131,10 +130,6 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) if (extract32(ahcf->isar.mvfr1, 12, 4) == 1) { set_feature(&features, ARM_FEATURE_NEON); } - if (extract32(ahcf->isar.mvfr1, 28, 4) == 1) { - /* FMAC support implies VFPv4 */ - set_feature(&features, ARM_FEATURE_VFP4); - } ahcf->features = features; diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 3bae9e4a66..e555e8dbc0 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -603,7 +603,6 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) * feature bits. */ set_feature(&features, ARM_FEATURE_V8); - set_feature(&features, ARM_FEATURE_VFP4); set_feature(&features, ARM_FEATURE_NEON); set_feature(&features, ARM_FEATURE_AARCH64); set_feature(&features, ARM_FEATURE_PMU); From patchwork Fri Feb 14 18:15:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183518 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2131596ile; Fri, 14 Feb 2020 10:24:59 -0800 (PST) X-Google-Smtp-Source: APXvYqwz9iGNpO8HV08JijklvNQ5JbKnw0xShdI/7uEJFIT1s/iYbJOGVkf81grqo/ySK3qMQBl8 X-Received: by 2002:ac8:3aa6:: with SMTP id x35mr3733658qte.38.1581704699185; Fri, 14 Feb 2020 10:24:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704699; cv=none; d=google.com; s=arc-20160816; b=U8bZy/MlPWaEGDmNC/bNzbNeaAVa8ZQay7v6vg9pHG9Fmmqnv8IW8MTCYo1hwQ7k8G g2eqlP6yMc7vtRhzNYXPfaQQSVBEdnwlahxIRGxHYXcHpk1eWLWNul5JjbAy6MMRGB/n wB6WXkCiReQPHFM5BpwulDSENHAMjP3cv4/XeWyGxI93a3gl+itA1SR4IvvyyWQR9z+4 xzABMJrgHKhuBgERcPtAxCJJhtBMZWiJfVUb+P39X42iPwcz39BtIGaBufdFRcav9adV SYc28b1VAuV/i/EBHur5/KJFxfJzc5k70I9VoSyaPtixLK5rDWO07N+HhpnJuunYkrGF hCiA== 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=Ao4evsYU9ClX8Sc2l9Bc6gohu0+9pes1UrtoAkrt1oc=; b=RyO+CRAihBOgJC5bvdsu3WUhsqCXkBsA2cjA9ph5GuRDNqwHSEk3t90QLoEYDwMr5Z huDVg7mZB1ynXmRwV5fnAA+neiOFh7S7P3auR0dRe7s2x+DAjlpqFrHbyo3d4h8OQsca tyInEu6XYY7X1JxAIwPJkB/92N5/lBhehHe1JpkbZT9BK9jsu8Zd/W28ub95/krIuxeO 4hOQSZSneFaKq19TZOpFwyh1Z08AubfF1Cqq+tgG/oJcZr1NXUX0jrpNHI130Y0Sh3Rf zOKrhWGJA0HK+rBwqXdnBFlffOZri4S9mMQTyTUY0zaQS9UHjin/1/bhPB8eTLhP4qH4 qtLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aH4PVPtU; 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 c6si3307076qkj.107.2020.02.14.10.24.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:24:59 -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=aH4PVPtU; 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]:43760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fe6-0005TP-O9 for patch@linaro.org; Fri, 14 Feb 2020 13:24:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60978) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVc-0004jr-Mm for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVa-0000L5-CO for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:12 -0500 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:42491) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVa-0000JK-4P for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:10 -0500 Received: by mail-pg1-x543.google.com with SMTP id w21so5336720pgl.9 for ; Fri, 14 Feb 2020 10:16:10 -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=Ao4evsYU9ClX8Sc2l9Bc6gohu0+9pes1UrtoAkrt1oc=; b=aH4PVPtUVS7G/LvGgNAACMyr71FeKO6+eRnv/0z2ULDUCtop7oALXbwHeFzLKnbZFk 81wbP5/QYZG6SBiTk9+akX4nLFNYt2nWIjc8hbvJ7xhiA3wQ/D/D8qrwIhYwWkmadMNq qTSo6FjhnRkTaPtUaZcNSCzwZ2Uh7KM6UKel5WSrdImodDCKYZL3Xy7viiguNuMVHz20 XyBmT1zs7NSG4lnDw/45UWMCf81m/g+p0blBS7sIZXH8YpKwMiCtYyIyM+31n/Sdc6ae z/tOVcJouJuMgitjWEQQcbNmRu+Fx5j3hYFVNuurJXXoWareH/HNIqftajyUdK1KM5i5 Fkyg== 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=Ao4evsYU9ClX8Sc2l9Bc6gohu0+9pes1UrtoAkrt1oc=; b=IeQkyEylZVQvKtFYBx5GgkZx3tnmy47AmQYSkfeEvqBPzSlVlgg7PA3WaQFJ1AlqVq szA6KVNK5g/G4S73ZtvYaTCjtTCbG8hrGj5MXyFcHvVTMEBBb97KpBk/8f8zvjHevkLU MsCs2+muVPzKVRQMVb4fYTSd/gg5a0lGovV+1O7IKw9Ict1pyoudSqX1XBiV9vwRTAJM 6fjD5qzLolCeoEnVD9JbGbzpBCwHnh7WTcbP46Jf2BYOBv5Vn2pF9UcmW5ePnHPPmt7x dvHvrXIhzuDIjwzWlk/2/4csCxujw9LuGhCXVDGwBHNW0Gtr/+lueJJZG3T3O/4wVZFj qnvg== X-Gm-Message-State: APjAAAXe+LLhmXkuEirT97G80A4UNfIDULInuVUb9C/KcFg7c/F4kGJL hpsWXrT54jOZWJM1N0weYV+NdH0TwfI= X-Received: by 2002:a63:7744:: with SMTP id s65mr4744619pgc.312.1581704168515; Fri, 14 Feb 2020 10:16:08 -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.16.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:16:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 17/19] target/arm: Add formats for some vfp 2 and 3-register insns Date: Fri, 14 Feb 2020 10:15:45 -0800 Message-Id: <20200214181547.21408-18-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::543 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" Those vfp instructions without extra opcode fields can share a common @format for brevity. Signed-off-by: Richard Henderson --- target/arm/vfp.decode | 134 ++++++++++++++++-------------------------- 1 file changed, 52 insertions(+), 82 deletions(-) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/target/arm/vfp.decode b/target/arm/vfp.decode index 592fe9e1e4..4f294f88be 100644 --- a/target/arm/vfp.decode +++ b/target/arm/vfp.decode @@ -46,6 +46,14 @@ %vmov_imm 16:4 0:4 +@vfp_dnm_s ................................ vm=%vm_sp vn=%vn_sp vd=%vd_sp +@vfp_dnm_d ................................ vm=%vm_dp vn=%vn_dp vd=%vd_dp + +@vfp_dm_ss ................................ vm=%vm_sp vd=%vd_sp +@vfp_dm_dd ................................ vm=%vm_dp vd=%vd_dp +@vfp_dm_ds ................................ vm=%vm_sp vd=%vd_dp +@vfp_dm_sd ................................ vm=%vm_dp vd=%vd_sp + # VMOV scalar to general-purpose register; note that this does # include some Neon cases. VMOV_to_gp ---- 1110 u:1 1. 1 .... rt:4 1011 ... 1 0000 \ @@ -66,20 +74,15 @@ VDUP ---- 1110 1 b:1 q:1 0 .... rt:4 1011 . 0 e:1 1 0000 \ vn=%vn_dp VMSR_VMRS ---- 1110 111 l:1 reg:4 rt:4 1010 0001 0000 -VMOV_single ---- 1110 000 l:1 .... rt:4 1010 . 001 0000 \ - vn=%vn_sp +VMOV_single ---- 1110 000 l:1 .... rt:4 1010 . 001 0000 vn=%vn_sp -VMOV_64_sp ---- 1100 010 op:1 rt2:4 rt:4 1010 00.1 .... \ - vm=%vm_sp -VMOV_64_dp ---- 1100 010 op:1 rt2:4 rt:4 1011 00.1 .... \ - vm=%vm_dp +VMOV_64_sp ---- 1100 010 op:1 rt2:4 rt:4 1010 00.1 .... vm=%vm_sp +VMOV_64_dp ---- 1100 010 op:1 rt2:4 rt:4 1011 00.1 .... vm=%vm_dp # Note that the half-precision variants of VLDR and VSTR are # not part of this decodetree at all because they have bits [9:8] == 0b01 -VLDR_VSTR_sp ---- 1101 u:1 .0 l:1 rn:4 .... 1010 imm:8 \ - vd=%vd_sp -VLDR_VSTR_dp ---- 1101 u:1 .0 l:1 rn:4 .... 1011 imm:8 \ - vd=%vd_dp +VLDR_VSTR_sp ---- 1101 u:1 .0 l:1 rn:4 .... 1010 imm:8 vd=%vd_sp +VLDR_VSTR_dp ---- 1101 u:1 .0 l:1 rn:4 .... 1011 imm:8 vd=%vd_dp # We split the load/store multiple up into two patterns to avoid # overlap with other insns in the "Advanced SIMD load/store and 64-bit move" @@ -100,50 +103,32 @@ VLDM_VSTM_dp ---- 1101 0.1 l:1 rn:4 .... 1011 imm:8 \ vd=%vd_dp p=1 u=0 w=1 # 3-register VFP data-processing; bits [23,21:20,6] identify the operation. -VMLA_sp ---- 1110 0.00 .... .... 1010 .0.0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp -VMLA_dp ---- 1110 0.00 .... .... 1011 .0.0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp +VMLA_sp ---- 1110 0.00 .... .... 1010 .0.0 .... @vfp_dnm_s +VMLA_dp ---- 1110 0.00 .... .... 1011 .0.0 .... @vfp_dnm_d -VMLS_sp ---- 1110 0.00 .... .... 1010 .1.0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp -VMLS_dp ---- 1110 0.00 .... .... 1011 .1.0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp +VMLS_sp ---- 1110 0.00 .... .... 1010 .1.0 .... @vfp_dnm_s +VMLS_dp ---- 1110 0.00 .... .... 1011 .1.0 .... @vfp_dnm_d -VNMLS_sp ---- 1110 0.01 .... .... 1010 .0.0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp -VNMLS_dp ---- 1110 0.01 .... .... 1011 .0.0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp +VNMLS_sp ---- 1110 0.01 .... .... 1010 .0.0 .... @vfp_dnm_s +VNMLS_dp ---- 1110 0.01 .... .... 1011 .0.0 .... @vfp_dnm_d -VNMLA_sp ---- 1110 0.01 .... .... 1010 .1.0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp -VNMLA_dp ---- 1110 0.01 .... .... 1011 .1.0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp +VNMLA_sp ---- 1110 0.01 .... .... 1010 .1.0 .... @vfp_dnm_s +VNMLA_dp ---- 1110 0.01 .... .... 1011 .1.0 .... @vfp_dnm_d -VMUL_sp ---- 1110 0.10 .... .... 1010 .0.0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp -VMUL_dp ---- 1110 0.10 .... .... 1011 .0.0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp +VMUL_sp ---- 1110 0.10 .... .... 1010 .0.0 .... @vfp_dnm_s +VMUL_dp ---- 1110 0.10 .... .... 1011 .0.0 .... @vfp_dnm_d -VNMUL_sp ---- 1110 0.10 .... .... 1010 .1.0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp -VNMUL_dp ---- 1110 0.10 .... .... 1011 .1.0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp +VNMUL_sp ---- 1110 0.10 .... .... 1010 .1.0 .... @vfp_dnm_s +VNMUL_dp ---- 1110 0.10 .... .... 1011 .1.0 .... @vfp_dnm_d -VADD_sp ---- 1110 0.11 .... .... 1010 .0.0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp -VADD_dp ---- 1110 0.11 .... .... 1011 .0.0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp +VADD_sp ---- 1110 0.11 .... .... 1010 .0.0 .... @vfp_dnm_s +VADD_dp ---- 1110 0.11 .... .... 1011 .0.0 .... @vfp_dnm_d -VSUB_sp ---- 1110 0.11 .... .... 1010 .1.0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp -VSUB_dp ---- 1110 0.11 .... .... 1011 .1.0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp +VSUB_sp ---- 1110 0.11 .... .... 1010 .1.0 .... @vfp_dnm_s +VSUB_dp ---- 1110 0.11 .... .... 1011 .1.0 .... @vfp_dnm_d -VDIV_sp ---- 1110 1.00 .... .... 1010 .0.0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp -VDIV_dp ---- 1110 1.00 .... .... 1011 .0.0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp +VDIV_sp ---- 1110 1.00 .... .... 1010 .0.0 .... @vfp_dnm_s +VDIV_dp ---- 1110 1.00 .... .... 1011 .0.0 .... @vfp_dnm_d VFM_sp ---- 1110 1.01 .... .... 1010 . o2:1 . 0 .... \ vm=%vm_sp vn=%vn_sp vd=%vd_sp o1=1 @@ -159,25 +144,17 @@ VMOV_imm_sp ---- 1110 1.11 .... .... 1010 0000 .... \ VMOV_imm_dp ---- 1110 1.11 .... .... 1011 0000 .... \ vd=%vd_dp imm=%vmov_imm -VMOV_reg_sp ---- 1110 1.11 0000 .... 1010 01.0 .... \ - vd=%vd_sp vm=%vm_sp -VMOV_reg_dp ---- 1110 1.11 0000 .... 1011 01.0 .... \ - vd=%vd_dp vm=%vm_dp +VMOV_reg_sp ---- 1110 1.11 0000 .... 1010 01.0 .... @vfp_dm_ss +VMOV_reg_dp ---- 1110 1.11 0000 .... 1011 01.0 .... @vfp_dm_dd -VABS_sp ---- 1110 1.11 0000 .... 1010 11.0 .... \ - vd=%vd_sp vm=%vm_sp -VABS_dp ---- 1110 1.11 0000 .... 1011 11.0 .... \ - vd=%vd_dp vm=%vm_dp +VABS_sp ---- 1110 1.11 0000 .... 1010 11.0 .... @vfp_dm_ss +VABS_dp ---- 1110 1.11 0000 .... 1011 11.0 .... @vfp_dm_dd -VNEG_sp ---- 1110 1.11 0001 .... 1010 01.0 .... \ - vd=%vd_sp vm=%vm_sp -VNEG_dp ---- 1110 1.11 0001 .... 1011 01.0 .... \ - vd=%vd_dp vm=%vm_dp +VNEG_sp ---- 1110 1.11 0001 .... 1010 01.0 .... @vfp_dm_ss +VNEG_dp ---- 1110 1.11 0001 .... 1011 01.0 .... @vfp_dm_dd -VSQRT_sp ---- 1110 1.11 0001 .... 1010 11.0 .... \ - vd=%vd_sp vm=%vm_sp -VSQRT_dp ---- 1110 1.11 0001 .... 1011 11.0 .... \ - vd=%vd_dp vm=%vm_dp +VSQRT_sp ---- 1110 1.11 0001 .... 1010 11.0 .... @vfp_dm_ss +VSQRT_dp ---- 1110 1.11 0001 .... 1011 11.0 .... @vfp_dm_dd VCMP_sp ---- 1110 1.11 010 z:1 .... 1010 e:1 1.0 .... \ vd=%vd_sp vm=%vm_sp @@ -190,32 +167,26 @@ VCVT_f32_f16 ---- 1110 1.11 0010 .... 1010 t:1 1.0 .... \ VCVT_f64_f16 ---- 1110 1.11 0010 .... 1011 t:1 1.0 .... \ vd=%vd_dp vm=%vm_sp -# VCVTB and VCVTT to f16: Vd format is always vd_sp; Vm format depends on size bit +# VCVTB and VCVTT to f16: Vd format is always vd_sp; +# Vm format depends on size bit VCVT_f16_f32 ---- 1110 1.11 0011 .... 1010 t:1 1.0 .... \ vd=%vd_sp vm=%vm_sp VCVT_f16_f64 ---- 1110 1.11 0011 .... 1011 t:1 1.0 .... \ vd=%vd_sp vm=%vm_dp -VRINTR_sp ---- 1110 1.11 0110 .... 1010 01.0 .... \ - vd=%vd_sp vm=%vm_sp -VRINTR_dp ---- 1110 1.11 0110 .... 1011 01.0 .... \ - vd=%vd_dp vm=%vm_dp +VRINTR_sp ---- 1110 1.11 0110 .... 1010 01.0 .... @vfp_dm_ss +VRINTR_dp ---- 1110 1.11 0110 .... 1011 01.0 .... @vfp_dm_dd -VRINTZ_sp ---- 1110 1.11 0110 .... 1010 11.0 .... \ - vd=%vd_sp vm=%vm_sp -VRINTZ_dp ---- 1110 1.11 0110 .... 1011 11.0 .... \ - vd=%vd_dp vm=%vm_dp +VRINTZ_sp ---- 1110 1.11 0110 .... 1010 11.0 .... @vfp_dm_ss +VRINTZ_dp ---- 1110 1.11 0110 .... 1011 11.0 .... @vfp_dm_dd -VRINTX_sp ---- 1110 1.11 0111 .... 1010 01.0 .... \ - vd=%vd_sp vm=%vm_sp -VRINTX_dp ---- 1110 1.11 0111 .... 1011 01.0 .... \ - vd=%vd_dp vm=%vm_dp +VRINTX_sp ---- 1110 1.11 0111 .... 1010 01.0 .... @vfp_dm_ss +VRINTX_dp ---- 1110 1.11 0111 .... 1011 01.0 .... @vfp_dm_dd -# VCVT between single and double: Vm precision depends on size; Vd is its reverse -VCVT_sp ---- 1110 1.11 0111 .... 1010 11.0 .... \ - vd=%vd_dp vm=%vm_sp -VCVT_dp ---- 1110 1.11 0111 .... 1011 11.0 .... \ - vd=%vd_sp vm=%vm_dp +# VCVT between single and double: +# Vm precision depends on size; Vd is its reverse +VCVT_sp ---- 1110 1.11 0111 .... 1010 11.0 .... @vfp_dm_ds +VCVT_dp ---- 1110 1.11 0111 .... 1011 11.0 .... @vfp_dm_sd # VCVT from integer to floating point: Vm always single; Vd depends on size VCVT_int_sp ---- 1110 1.11 1000 .... 1010 s:1 1.0 .... \ @@ -224,8 +195,7 @@ VCVT_int_dp ---- 1110 1.11 1000 .... 1011 s:1 1.0 .... \ vd=%vd_dp vm=%vm_sp # VJCVT is always dp to sp -VJCVT ---- 1110 1.11 1001 .... 1011 11.0 .... \ - vd=%vd_sp vm=%vm_dp +VJCVT ---- 1110 1.11 1001 .... 1011 11.0 .... @vfp_dm_sd # VCVT between floating-point and fixed-point. The immediate value # is in the same format as a Vm single-precision register number. From patchwork Fri Feb 14 18:15:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183516 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2129541ile; Fri, 14 Feb 2020 10:22:42 -0800 (PST) X-Google-Smtp-Source: APXvYqxU2981ssn06LZiAKXUAw0T8dbQ3dkby1JdRkJH1QsOynGs8gWmznr/aPYDbIJY9s8GrPon X-Received: by 2002:a37:9a4d:: with SMTP id c74mr3883632qke.18.1581704562727; Fri, 14 Feb 2020 10:22:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704562; cv=none; d=google.com; s=arc-20160816; b=kON89zIldOVD3SF16wwKrccLbSpbks+/Dp5Oi1BDjpfUXTf76b3MX94795Hn5Kv4BY ffnSJAwXNQMLUaEa0DPgwBaKK4ylI0wJGTB62H2yohPJVd12ntcF1r0lfJNtJxqsPfBN Uqqj3/ZFccmDgsIn5HUwRfD0Q8EhGiTZC2RNwaLsqy1rbluqFkqZwdA2a1ZB5U32nJAa tRiU0ppoiqsG8gg9+J3UWH09RcPz/Yp+ZsqZ4yePEmnOqtST7D09RmK47Jwf2dezehLk B4JJuT9pwtbwxtciMWbt61W8u6rMhUU91SO1+G/kwwkpEOPuFm0nu14d9EPe/fNhH7fL p4ww== 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=08YWOW4uPN/K//8Sv/iAQdt6yoHtAxwQIa1pxOQkXxw=; b=SFwlp/xBrSm2bbHXJHHyd3nthhoh4zUkuLCaq+sJTgSNG2rnxK6JXQ2RdR8J5+Rsm7 475/lrZgxYHmzE1i5YXLggC+yRUYo61xBFBzxWTJraeDVxHhCld1UinnCkoEVfuBBYx8 RmKa0nncBuxLW53PgMM50ZqNA6AuTaXGT1sG5Fgif01PLqI1NtOIYT2o/qAaluJslUTs nvsE8cpZDTT1liCaSVG2abjjNscyghm61E08RfGLmegTy0Sl8blnC4G7GDxI1bGs/up3 ftQQowOFuLIJS+jMcktPK7alF9hLX7Icr2WwJfOEpdz7YU2xlRzFxZ7OzZVL4wSGRO5Q 22CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CmrUFjhR; 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 k8si2924146qvp.76.2020.02.14.10.22.42 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:22:42 -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=CmrUFjhR; 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]:43704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fbu-0001Hi-8x for patch@linaro.org; Fri, 14 Feb 2020 13:22:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60975) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVc-0004jg-Hn for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVb-0000M1-71 for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:12 -0500 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:46225) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVb-0000L1-18 for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:11 -0500 Received: by mail-pf1-x442.google.com with SMTP id k29so5238023pfp.13 for ; Fri, 14 Feb 2020 10:16:10 -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=08YWOW4uPN/K//8Sv/iAQdt6yoHtAxwQIa1pxOQkXxw=; b=CmrUFjhRgBmeKXvH7NHnFbQpBEyRRrlSu7RRgr3lzAklwKujje0eh+AYgMgXpK6m4N TVLWc9TCl7MoM3pCMiJdrqqxOqQm44RpTr2wTO9iOD9gFB3o4eWjrWZxCGo1rFoY845U 9lWE8hrarjlIhuEKpHXDjqhRUNs2Rzqv86OLZYRMUph/vabVocw7b+PDYLeEhVZYg9cp BMVOi5HW5+IW/nLMeGMhZMSRx5thMi/Cw1w5mKg2WpXDHrNuKj+K5Zpl8sfBlJpvYId1 9jVeP/jQIZ3HUY13+F2IMHAoTwaGJ4UOX8lioPP9A3s1NyEPtv/jBtVjK147BzLISkZQ DYHQ== 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=08YWOW4uPN/K//8Sv/iAQdt6yoHtAxwQIa1pxOQkXxw=; b=iiAWhF/s9T5s/bqEjXPZfbB6smzYMOIqwfkfL6mNlhpVYxHAMRv9KWloaRxBnW6JIo 2ezEcNhFwu85JFxYem1PoXvr5HBdqyaU2vk7lQlHf8iKA/cqDEtHVg5u9KeuDdFwbOSD aHjLqMFaLEdGepog0nm+omM1Jjk9D2lFoDYtOPB7lFddX0J2SvnWIZpQa8eoHzy+nZ0D jih3VqA59W4yL78WlLXyn79qmeAqRQxdIa/Nd467F6dHK/9/DiVwpwq1MuEnBpLenqRR mTORytGlWyJA5jM8nzCHVXgDUAAV9VqmpGSMwLT6NcF2pqV47QY27UUr4kG2i9OiOltr qz7g== X-Gm-Message-State: APjAAAVDCY7fY+m5hR4FiO4qElDMFBvBkPgWak2Drw/Fo3XuGzlBxREO Nyn5FLYEfOgzEM4QfpDitsLCAfxyH/U= X-Received: by 2002:a63:7f5c:: with SMTP id p28mr4977435pgn.212.1581704169483; Fri, 14 Feb 2020 10:16:09 -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.16.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:16:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 18/19] target/arm: Split VFM decode Date: Fri, 14 Feb 2020 10:15:46 -0800 Message-Id: <20200214181547.21408-19-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::442 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" Passing the raw o1 and o2 fields from the manual is less instructive than it might be. Do the full decode and let the trans_* functions pass in booleans to a helper. Signed-off-by: Richard Henderson --- target/arm/vfp.decode | 17 +++++------ target/arm/translate-vfp.inc.c | 52 ++++++++++++++++++++++++++++++---- 2 files changed, 55 insertions(+), 14 deletions(-) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/target/arm/vfp.decode b/target/arm/vfp.decode index 4f294f88be..5fd70f975a 100644 --- a/target/arm/vfp.decode +++ b/target/arm/vfp.decode @@ -130,14 +130,15 @@ VSUB_dp ---- 1110 0.11 .... .... 1011 .1.0 .... @vfp_dnm_d VDIV_sp ---- 1110 1.00 .... .... 1010 .0.0 .... @vfp_dnm_s VDIV_dp ---- 1110 1.00 .... .... 1011 .0.0 .... @vfp_dnm_d -VFM_sp ---- 1110 1.01 .... .... 1010 . o2:1 . 0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp o1=1 -VFM_dp ---- 1110 1.01 .... .... 1011 . o2:1 . 0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp o1=1 -VFM_sp ---- 1110 1.10 .... .... 1010 . o2:1 . 0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp o1=2 -VFM_dp ---- 1110 1.10 .... .... 1011 . o2:1 . 0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp o1=2 +VFMA_sp ---- 1110 1.10 .... .... 1010 .0. 0 .... @vfp_dnm_s +VFMS_sp ---- 1110 1.10 .... .... 1010 .1. 0 .... @vfp_dnm_s +VFNMA_sp ---- 1110 1.01 .... .... 1010 .0. 0 .... @vfp_dnm_s +VFNMS_sp ---- 1110 1.01 .... .... 1010 .1. 0 .... @vfp_dnm_s + +VFMA_dp ---- 1110 1.10 .... .... 1011 .0.0 .... @vfp_dnm_d +VFMS_dp ---- 1110 1.10 .... .... 1011 .1.0 .... @vfp_dnm_d +VFNMA_dp ---- 1110 1.01 .... .... 1011 .0.0 .... @vfp_dnm_d +VFNMS_dp ---- 1110 1.01 .... .... 1011 .1.0 .... @vfp_dnm_d VMOV_imm_sp ---- 1110 1.11 .... .... 1010 0000 .... \ vd=%vd_sp imm=%vmov_imm diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index 8f2b97e0e7..b5f3feaf8d 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -1784,7 +1784,7 @@ static bool trans_VDIV_dp(DisasContext *s, arg_VDIV_dp *a) return do_vfp_3op_dp(s, gen_helper_vfp_divd, a->vd, a->vn, a->vm, false); } -static bool trans_VFM_sp(DisasContext *s, arg_VFM_sp *a) +static bool do_vfm_sp(DisasContext *s, arg_VFMA_sp *a, bool neg_n, bool neg_d) { /* * VFNMA : fd = muladd(-fd, fn, fm) @@ -1823,12 +1823,12 @@ static bool trans_VFM_sp(DisasContext *s, arg_VFM_sp *a) neon_load_reg32(vn, a->vn); neon_load_reg32(vm, a->vm); - if (a->o2) { + if (neg_n) { /* VFNMS, VFMS */ gen_helper_vfp_negs(vn, vn); } neon_load_reg32(vd, a->vd); - if (a->o1 & 1) { + if (neg_d) { /* VFNMA, VFNMS */ gen_helper_vfp_negs(vd, vd); } @@ -1844,7 +1844,27 @@ static bool trans_VFM_sp(DisasContext *s, arg_VFM_sp *a) return true; } -static bool trans_VFM_dp(DisasContext *s, arg_VFM_dp *a) +static bool trans_VFMA_sp(DisasContext *s, arg_VFMA_sp *a) +{ + return do_vfm_sp(s, a, false, false); +} + +static bool trans_VFMS_sp(DisasContext *s, arg_VFMS_sp *a) +{ + return do_vfm_sp(s, a, true, false); +} + +static bool trans_VFNMA_sp(DisasContext *s, arg_VFNMA_sp *a) +{ + return do_vfm_sp(s, a, false, true); +} + +static bool trans_VFNMS_sp(DisasContext *s, arg_VFNMS_sp *a) +{ + return do_vfm_sp(s, a, true, true); +} + +static bool do_vfm_dp(DisasContext *s, arg_VFMA_dp *a, bool neg_n, bool neg_d) { /* * VFNMA : fd = muladd(-fd, fn, fm) @@ -1893,12 +1913,12 @@ static bool trans_VFM_dp(DisasContext *s, arg_VFM_dp *a) neon_load_reg64(vn, a->vn); neon_load_reg64(vm, a->vm); - if (a->o2) { + if (neg_n) { /* VFNMS, VFMS */ gen_helper_vfp_negd(vn, vn); } neon_load_reg64(vd, a->vd); - if (a->o1 & 1) { + if (neg_d) { /* VFNMA, VFNMS */ gen_helper_vfp_negd(vd, vd); } @@ -1914,6 +1934,26 @@ static bool trans_VFM_dp(DisasContext *s, arg_VFM_dp *a) return true; } +static bool trans_VFMA_dp(DisasContext *s, arg_VFMA_dp *a) +{ + return do_vfm_dp(s, a, false, false); +} + +static bool trans_VFMS_dp(DisasContext *s, arg_VFMS_dp *a) +{ + return do_vfm_dp(s, a, true, false); +} + +static bool trans_VFNMA_dp(DisasContext *s, arg_VFNMA_dp *a) +{ + return do_vfm_dp(s, a, false, true); +} + +static bool trans_VFNMS_dp(DisasContext *s, arg_VFNMS_dp *a) +{ + return do_vfm_dp(s, a, true, true); +} + static bool trans_VMOV_imm_sp(DisasContext *s, arg_VMOV_imm_sp *a) { uint32_t delta_d = 0; From patchwork Fri Feb 14 18:15:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183521 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2134551ile; Fri, 14 Feb 2020 10:28:16 -0800 (PST) X-Google-Smtp-Source: APXvYqzWvnHV5cCJiP+exP+F5Ry8jsh42CmiZVMR44EWyRwEMSEQ8qJA/FiliTE8uk3uvaLFcZtD X-Received: by 2002:ac8:1306:: with SMTP id e6mr3642394qtj.267.1581704896865; Fri, 14 Feb 2020 10:28:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704896; cv=none; d=google.com; s=arc-20160816; b=qySdaV0Vkyj75F+WNb578oo9SpwdF3cracr/SpOSz6F5L27tFUWsoWXrmOi5PWgsBV uVUKh+7wxevEYiYfL/lQZ3fPPAHCr8++z3kFzJei/6HfN8nR7dVnXjAc6gI7dz+mG8rh MXODEoo7j5BF11VAXz4dTdlJWIEYqM8vqq6WiE5kim3vlr3L9xoq1uIdeZP4u2evkeDI HhNjbHPLtaeWHgpapEVM9ewpBdHQ2zpkGbmzU//vBfBA8Bwxq51CUu7n6cfkWyG2Ba6M EoMTYBHmqcrH6ODgQK6gkMUCgCkDpGlWqP0NkEOmC5QAbCQAaby/4krpK3dTpDiX0ltH PpOg== 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=pMw3WexDwdJHFaht64LuoLlVbRzrqioLE5XZ9OBOKYc=; b=lwgzxVnT8VTfsBPZAdk6BELJoV6DYTkVW9QzwL9xaTOiPL7BV6tWw8X9t8KU4Rgjcq 8mKHmpy5M4w60ol3zrrECYDXuqw7koA0GSgg1iHVfW65nlIT96HjS79dwdgwKvFfqeZl +RM5U3wyLFM9OyGFTD1gwmM2CRE5C/cCDI0Xd0KXErf/f1FkUSZROPrkXhSZWWvsK3b/ bwCKXeY/9YWF9sukWfYztFcTkDHXmA+HYNoWf+ON970OeHfFa5bEtHC6vosSM4evmi3C 1CXXNNibUdIPfKB3p7RQmWyI9CI1btKDCBw4SHQVyRX5A3FxDDV0z77sAo0NwY4Tltnk QtGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OpOZLTFy; 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 o4si2933522qtd.56.2020.02.14.10.28.16 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:28:16 -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=OpOZLTFy; 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]:43840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fhI-0001l5-Ca for patch@linaro.org; Fri, 14 Feb 2020 13:28:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60990) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVd-0004m8-GJ for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVc-0000N2-4s for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:13 -0500 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:33092) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVb-0000MZ-Uy for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:12 -0500 Received: by mail-pg1-x543.google.com with SMTP id 6so5359259pgk.0 for ; Fri, 14 Feb 2020 10:16:11 -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=pMw3WexDwdJHFaht64LuoLlVbRzrqioLE5XZ9OBOKYc=; b=OpOZLTFyEqK6z0NFplV4tDRaB/hXh8fwpOHTwR2ICSTFmNcXFYQ1/wuLXfZsyCm+b5 Z4fswPZ12UOB9MzsZ7brFasvCSl9VZMRYUWoM1eaV5PhqTWaKYYw8nkPCtZC1f2jGvtT ruQelYdHp5sstGVUnm46Dd+FG516ZEq6cfxFIH2UqwnRWE3LKG5HW18Q2w6q+QVMzBMc tOgRpxFvsk+y/YI0xjjezUTrgm0xcJDffLt236x4Vwi7E/++spbVeo0ad+WQokVu2NLZ fxzlW4JOK3lpn1EjCtsLikQ3OAE71XV7tKqHXxZpyUukL9XFQ4LNtnoL8VLpHDeczsCC 3fKw== 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=pMw3WexDwdJHFaht64LuoLlVbRzrqioLE5XZ9OBOKYc=; b=iiothwhOTDc+fSf+RUQ0fSgrZp75e4oWdicAxA5ZRLqolXt8Q+rh61VZTyxEtAmb57 d3QpnbOLjGYtZY9Q4FcGbFkdWQCjo8ky/2mcuF8M3g/jjDSINfVHaF9eYk3qGCWN/irw luBorsvt/8e1N2ya7oNz5QXQahSXACCLMIgPw6KuYyTW2qpuFWnLWHkQxPYmckQf5w9T 6LAJNUglJy+Y89VAPszv2Vvby1bjwrMdqFby3Cgo4Kdb7cuFhCAq7KEtrzZYcCMFEfQ4 Li8Cbbt0OJOk5kxgrQYltnXXXL5dNQI/6ODy+pRtxpmJL0xTMdUlr/haNaxC8lxOwKwV KQXQ== X-Gm-Message-State: APjAAAWpBJPV1Cs5YiFljjvbBCcWi++AiCFEDCXBWS4qwhB5uFE1QdpD BB9kr2hynenK/63B7bzkpVRKNQ5rUjo= X-Received: by 2002:a63:5c10:: with SMTP id q16mr4923809pgb.35.1581704170679; Fri, 14 Feb 2020 10:16:10 -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.16.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:16:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 19/19] target/arm: Split VMINMAXNM decode Date: Fri, 14 Feb 2020 10:15:47 -0800 Message-Id: <20200214181547.21408-20-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::543 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" Passing the raw op field from the manual is less instructive than it might be. Do the full decode and use the existing helpers to perform the expansion. Since these are v8 insns, VECLEN+VECSTRIDE are already RES0. Signed-off-by: Richard Henderson --- target/arm/vfp-uncond.decode | 12 ++-- target/arm/translate-vfp.inc.c | 109 +++++++++++---------------------- 2 files changed, 44 insertions(+), 77 deletions(-) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/target/arm/vfp-uncond.decode b/target/arm/vfp-uncond.decode index 5af1f2ee66..34ca164266 100644 --- a/target/arm/vfp-uncond.decode +++ b/target/arm/vfp-uncond.decode @@ -41,15 +41,19 @@ %vd_dp 22:1 12:4 %vd_sp 12:4 22:1 +@vfp_dnm_s ................................ vm=%vm_sp vn=%vn_sp vd=%vd_sp +@vfp_dnm_d ................................ vm=%vm_dp vn=%vn_dp vd=%vd_dp + VSEL 1111 1110 0. cc:2 .... .... 1010 .0.0 .... \ vm=%vm_sp vn=%vn_sp vd=%vd_sp dp=0 VSEL 1111 1110 0. cc:2 .... .... 1011 .0.0 .... \ vm=%vm_dp vn=%vn_dp vd=%vd_dp dp=1 -VMINMAXNM 1111 1110 1.00 .... .... 1010 . op:1 .0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp dp=0 -VMINMAXNM 1111 1110 1.00 .... .... 1011 . op:1 .0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp dp=1 +VMAXNM_sp 1111 1110 1.00 .... .... 1010 .0.0 .... @vfp_dnm_s +VMINNM_sp 1111 1110 1.00 .... .... 1010 .1.0 .... @vfp_dnm_s + +VMAXNM_dp 1111 1110 1.00 .... .... 1011 .0.0 .... @vfp_dnm_d +VMINNM_dp 1111 1110 1.00 .... .... 1011 .1.0 .... @vfp_dnm_d VRINT 1111 1110 1.11 10 rm:2 .... 1010 01.0 .... \ vm=%vm_sp vd=%vd_sp dp=0 diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index b5f3feaf8d..2cf85e73cf 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -322,79 +322,6 @@ static bool trans_VSEL(DisasContext *s, arg_VSEL *a) return true; } -static bool trans_VMINMAXNM(DisasContext *s, arg_VMINMAXNM *a) -{ - uint32_t rd, rn, rm; - bool dp = a->dp; - bool vmin = a->op; - TCGv_ptr fpst; - - if (!dc_isar_feature(aa32_vminmaxnm, s)) { - return false; - } - - if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - - /* UNDEF accesses to D16-D31 if they don't exist */ - if (dp && !dc_isar_feature(aa32_simd_r32, s) && - ((a->vm | a->vn | a->vd) & 0x10)) { - return false; - } - - rd = a->vd; - rn = a->vn; - rm = a->vm; - - if (!vfp_access_check(s)) { - return true; - } - - fpst = get_fpstatus_ptr(0); - - if (dp) { - TCGv_i64 frn, frm, dest; - - frn = tcg_temp_new_i64(); - frm = tcg_temp_new_i64(); - dest = tcg_temp_new_i64(); - - neon_load_reg64(frn, rn); - neon_load_reg64(frm, rm); - if (vmin) { - gen_helper_vfp_minnumd(dest, frn, frm, fpst); - } else { - gen_helper_vfp_maxnumd(dest, frn, frm, fpst); - } - neon_store_reg64(dest, rd); - tcg_temp_free_i64(frn); - tcg_temp_free_i64(frm); - tcg_temp_free_i64(dest); - } else { - TCGv_i32 frn, frm, dest; - - frn = tcg_temp_new_i32(); - frm = tcg_temp_new_i32(); - dest = tcg_temp_new_i32(); - - neon_load_reg32(frn, rn); - neon_load_reg32(frm, rm); - if (vmin) { - gen_helper_vfp_minnums(dest, frn, frm, fpst); - } else { - gen_helper_vfp_maxnums(dest, frn, frm, fpst); - } - neon_store_reg32(dest, rd); - tcg_temp_free_i32(frn); - tcg_temp_free_i32(frm); - tcg_temp_free_i32(dest); - } - - tcg_temp_free_ptr(fpst); - return true; -} - /* * Table for converting the most common AArch32 encoding of * rounding mode to arm_fprounding order (which matches the @@ -1784,6 +1711,42 @@ static bool trans_VDIV_dp(DisasContext *s, arg_VDIV_dp *a) return do_vfp_3op_dp(s, gen_helper_vfp_divd, a->vd, a->vn, a->vm, false); } +static bool trans_VMINNM_sp(DisasContext *s, arg_VMINNM_sp *a) +{ + if (!dc_isar_feature(aa32_vminmaxnm, s)) { + return false; + } + return do_vfp_3op_sp(s, gen_helper_vfp_minnums, + a->vd, a->vn, a->vm, false); +} + +static bool trans_VMAXNM_sp(DisasContext *s, arg_VMAXNM_sp *a) +{ + if (!dc_isar_feature(aa32_vminmaxnm, s)) { + return false; + } + return do_vfp_3op_sp(s, gen_helper_vfp_maxnums, + a->vd, a->vn, a->vm, false); +} + +static bool trans_VMINNM_dp(DisasContext *s, arg_VMINNM_dp *a) +{ + if (!dc_isar_feature(aa32_vminmaxnm, s)) { + return false; + } + return do_vfp_3op_dp(s, gen_helper_vfp_minnumd, + a->vd, a->vn, a->vm, false); +} + +static bool trans_VMAXNM_dp(DisasContext *s, arg_VMAXNM_dp *a) +{ + if (!dc_isar_feature(aa32_vminmaxnm, s)) { + return false; + } + return do_vfp_3op_dp(s, gen_helper_vfp_maxnumd, + a->vd, a->vn, a->vm, false); +} + static bool do_vfm_sp(DisasContext *s, arg_VFMA_sp *a, bool neg_n, bool neg_d) { /*