From nobody Sun Nov 16 05:42:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1599140004; cv=none; d=zohomail.com; s=zohoarc; b=JT5MjrDiivjy+/G7bwH2C/zKgvtNmILsmaPrlp8CbWPjYkRAWfRqj2xl9SWrTh4cCHFG6niYfwwVWdx0NamiKys7TpuCF9tnVXimQXHULGs99U6PYAy2Jrp8ZGhuazvKn8Qouc6/xF5vue03dP2c7IVmll1JSnG9wf/zh/nEMC0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599140004; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZSYYIuhZbs62/xiGmWlQgE9F1UvNn4/kf3VtqXYNpHc=; b=Z4IpivEknXmJgJr21p3KX6aYMcQT5B8+ufisNzRXR06TJY2qXzjJ42ydZWbOeY5wdv6hCbrHXQaA22EHl3WsS9q+6iz5L+rTZWhMSKzy9PE466GZL3b+QMc6tPiXUuq0tD8EMVcvso8b31kALd/siVhIXIHUQPCyY2mbcFz1rpo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599140004765792.3324298402878; Thu, 3 Sep 2020 06:33:24 -0700 (PDT) Received: from localhost ([::1]:39260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDpMg-0000Uq-VZ for importer@patchew.org; Thu, 03 Sep 2020 09:33:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDpLc-0007HN-Df for qemu-devel@nongnu.org; Thu, 03 Sep 2020 09:32:16 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:52242) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDpLa-0007uw-JO for qemu-devel@nongnu.org; Thu, 03 Sep 2020 09:32:16 -0400 Received: by mail-wm1-x344.google.com with SMTP id q9so2914019wmj.2 for ; Thu, 03 Sep 2020 06:32:14 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id k24sm4301988wmj.19.2020.09.03.06.32.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 06:32:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZSYYIuhZbs62/xiGmWlQgE9F1UvNn4/kf3VtqXYNpHc=; b=UqBVKU3QuGzw82p38DBkf96SOkOr7tAHsCrbHXlhxw0W8awZc4egS2jlm15/4bC65/ RBQtXRsqafTdc7kkF6U/NeWy0/3XIwYEHcGn2UEhSxg3s2YIxNx67VSP7rFqF3SWsWFJ NA+atITgFxqEnDExUHFb/Loxgn36txZWEBKgZoYwjdURXouF8QrOGlY6Rh4X9QKvEh2j U/KzEts/FRe9sKBUgfpCWaPN6uGF6YaAER0wDvwvraxeGS1SOru9yVP31B3lRU6fe0u6 Li6VBLIG3H7Q7aGJWqKm0Jt/jj1ZP4daktsMTQIcUMDlKdVH5CNY/81ecg/ghJCzTjWb TUlg== 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=ZSYYIuhZbs62/xiGmWlQgE9F1UvNn4/kf3VtqXYNpHc=; b=K/o3kmx433oRWZzKvC0WeJVY3arIn+i7UqBGYfUpU/rIGhebVoQhBTB89Hf4SwtxPT PhOOYlZjRau6jYdDnByQn7FD1UxnuMspFsWUwn95yFhAEQmoG84g4T28Nz3BN5EfaIuR BkjNYoxEl0P/O+TlUxEMtNz5cJ2Q+kcuF4rd1hkhDeme54xQkuGHmfrguemyTsIH9pjL DggIAjyOg+qDPMcOUq4l0bNtZoRvluE4Ep7c6yxevdE87N+C25+z7yJMj8i+alSOlFRD hkUWStAI82VVAn5WuzijYzgebue2DEpT+p8VlIqEMQJ/WL4/mMPRdRfTNeHNcDBaRTKu MQHA== X-Gm-Message-State: AOAM530FY+AfS2Lx338qUPjTeywYRPsJILg56ilYQmSa6o1j6B3JVR7j f4EJcurStk1hVrf9vOO4nVE4cg== X-Google-Smtp-Source: ABdhPJx8yckDexcediHvV5DSFCoGgkujjaYCoJDpFjooaeapIOVAsHHviza72mq1eNJvCmw+4jH0QA== X-Received: by 2002:a7b:c3da:: with SMTP id t26mr2435537wmj.23.1599139933162; Thu, 03 Sep 2020 06:32:13 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 1/3] target/arm: Convert Neon 3-same-fp size field to MO_* in decode Date: Thu, 3 Sep 2020 14:32:07 +0100 Message-Id: <20200903133209.5141-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200903133209.5141-1-peter.maydell@linaro.org> References: <20200903133209.5141-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" In the Neon instructions, some instruction formats have a 2-bit size field which corresponds exactly to QEMU's MO_8/16/32/64. However the floating-point insns in the 3-same group have a 1-bit size field which is "0 for 32-bit float and 1 for 16-bit float". Currently we pass these values directly through to trans_ functions, which means that when reading a particular trans_ function you need to know if that insn uses a 2-bit size or a 1-bit size. Move the handling of the 1-bit size to the decodetree file, so that all these insns consistently pass a size to the trans_ function which is an MO_8/16/32/64 value. In this commit we switch over the insns using the 3same_fp and 3same_fp_q0 formats. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- I wanted to call the field %3same_fp_size, but decodetree doesn't seem to allow a field starting with a digit, even though it does allow a format that starts with a digit. So it's %fp_3same_size... --- target/arm/neon-dp.decode | 15 ++++++++++----- target/arm/translate-neon.c.inc | 16 +++++++++++----- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/target/arm/neon-dp.decode b/target/arm/neon-dp.decode index 1e9e8592917..f453833396f 100644 --- a/target/arm/neon-dp.decode +++ b/target/arm/neon-dp.decode @@ -45,11 +45,16 @@ @3same_q0 .... ... . . . size:2 .... .... .... . 0 . . .... \ &3same vm=3D%vm_dp vn=3D%vn_dp vd=3D%vd_dp q=3D0 =20 -# For FP insns the high bit of 'size' is used as part of opcode decode -@3same_fp .... ... . . . . size:1 .... .... .... . q:1 . . .... \ - &3same vm=3D%vm_dp vn=3D%vn_dp vd=3D%vd_dp -@3same_fp_q0 .... ... . . . . size:1 .... .... .... . 0 . . .... \ - &3same vm=3D%vm_dp vn=3D%vn_dp vd=3D%vd_dp q=3D0 +# For FP insns the high bit of 'size' is used as part of opcode decode, +# and the 'size' bit is 0 for 32-bit float and 1 for 16-bit float. +# This converts this encoding to the same MO_8/16/32/64 values that the +# integer neon insns use. +%fp_3same_size 20:1 !function=3Dneon_3same_fp_size + +@3same_fp .... ... . . . . . .... .... .... . q:1 . . .... \ + &3same vm=3D%vm_dp vn=3D%vn_dp vd=3D%vd_dp size=3D%fp_3sa= me_size +@3same_fp_q0 .... ... . . . . . .... .... .... . 0 . . .... \ + &3same vm=3D%vm_dp vn=3D%vn_dp vd=3D%vd_dp q=3D0 size=3D%= fp_3same_size =20 VHADD_S_3s 1111 001 0 0 . .. .... .... 0000 . . . 0 .... @3same VHADD_U_3s 1111 001 1 0 . .. .... .... 0000 . . . 0 .... @3same diff --git a/target/arm/translate-neon.c.inc b/target/arm/translate-neon.c.= inc index 2d4926316a4..255c1cf8a2a 100644 --- a/target/arm/translate-neon.c.inc +++ b/target/arm/translate-neon.c.inc @@ -49,6 +49,12 @@ static inline int rsub_8(DisasContext *s, int x) return 8 - x; } =20 +static inline int neon_3same_fp_size(DisasContext *s, int x) +{ + /* Convert 0=3D=3Dfp32, 1=3D=3Dfp16 into a MO_* value */ + return MO_32 - x; +} + /* Include the generated Neon decoder */ #include "decode-neon-dp.c.inc" #include "decode-neon-ls.c.inc" @@ -1049,7 +1055,7 @@ DO_3SAME_VQDMULH(VQRDMULH, qrdmulh) WRAP_FP_GVEC(gen_##INSN##_fp16_3s, FPST_STD_F16, HFUNC) \ static bool trans_##INSN##_fp_3s(DisasContext *s, arg_3same *a) \ { \ - if (a->size !=3D 0) { \ + if (a->size =3D=3D MO_16) { = \ if (!dc_isar_feature(aa32_fp16_arith, s)) { \ return false; \ } \ @@ -1088,7 +1094,7 @@ static bool trans_VMAXNM_fp_3s(DisasContext *s, arg_3= same *a) return false; } =20 - if (a->size !=3D 0) { + if (a->size =3D=3D MO_16) { if (!dc_isar_feature(aa32_fp16_arith, s)) { return false; } @@ -1103,7 +1109,7 @@ static bool trans_VMINNM_fp_3s(DisasContext *s, arg_3= same *a) return false; } =20 - if (a->size !=3D 0) { + if (a->size =3D=3D MO_16) { if (!dc_isar_feature(aa32_fp16_arith, s)) { return false; } @@ -1135,7 +1141,7 @@ static bool do_3same_fp_pair(DisasContext *s, arg_3sa= me *a, assert(a->q =3D=3D 0); /* enforced by decode patterns */ =20 =20 - fpstatus =3D fpstatus_ptr(a->size !=3D 0 ? FPST_STD_F16 : FPST_STD); + fpstatus =3D fpstatus_ptr(a->size =3D=3D MO_16 ? FPST_STD_F16 : FPST_S= TD); tcg_gen_gvec_3_ptr(vfp_reg_offset(1, a->vd), vfp_reg_offset(1, a->vn), vfp_reg_offset(1, a->vm), @@ -1152,7 +1158,7 @@ static bool do_3same_fp_pair(DisasContext *s, arg_3sa= me *a, #define DO_3S_FP_PAIR(INSN,FUNC) \ static bool trans_##INSN##_fp_3s(DisasContext *s, arg_3same *a) \ { \ - if (a->size !=3D 0) { \ + if (a->size =3D=3D MO_16) { \ if (!dc_isar_feature(aa32_fp16_arith, s)) { \ return false; \ } \ --=20 2.20.1 From nobody Sun Nov 16 05:42:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1599140098; cv=none; d=zohomail.com; s=zohoarc; b=nt8JF93gbjo30J4I1wUW1HfIWQyj4PBV6i55snTUpkiu0TzVkWRf+H6gieqYZq5PT4WYrAVmTc/SFE50JBzDiVRhHoeCA4bMjFa1G1pLcRuMQzCbwK8HZgFs1MP6UpwkrPEqOE380LCZ3OFi9cWRPaJnWFgTUBf3jgvntZW8iM4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599140098; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4YiQdBJ1hxjT11XkjIFT4NIt+VV3HO6udxhsJSHRVWc=; b=AenN7MMdKRqXSZWOdxKbr31tgxYAS3a1B8gJSaRWWHbG732lwNdXlf7BCNoGjK5aGBvDKr/5xw/ouly4uy2yUPI08lz+UyYGHjvkgWC+8/pLexmXaWHOQi+5jRBvKpiok/zjrs0wqrQRTn+/EcX5M2cZFQmINq0mOrRhWElZUD4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15991400980711021.130445916519; Thu, 3 Sep 2020 06:34:58 -0700 (PDT) Received: from localhost ([::1]:46404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDpOC-0003UR-7z for importer@patchew.org; Thu, 03 Sep 2020 09:34:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDpLe-0007Ic-3Q for qemu-devel@nongnu.org; Thu, 03 Sep 2020 09:32:18 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:55745) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDpLb-0007v8-JP for qemu-devel@nongnu.org; Thu, 03 Sep 2020 09:32:17 -0400 Received: by mail-wm1-x344.google.com with SMTP id a65so2892368wme.5 for ; Thu, 03 Sep 2020 06:32:15 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id k24sm4301988wmj.19.2020.09.03.06.32.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 06:32:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4YiQdBJ1hxjT11XkjIFT4NIt+VV3HO6udxhsJSHRVWc=; b=d5CTtmeBhsM8Eb973i6HmTNgAWS6GnlU5KMxXj5CURQoQExfQ46o7C+fGa4Bue8OQI Y10y3Dl9fNJyIcouNOFVNBhc4l8+esPAPanQnhREHPtgO+exuvNyIhBkujZtpHRV3/jq 7kMr6Wf2kBlQL5kL+HtbXhS3MkdAKDTUDvu9uzRxwr85x42kP7pTbjD/JwiwVXjQ8q9B IhNw4sTZ6RfFZgp3gciwpnCgNuhTaRThOl1FkTPjSI0tA7OCuCRdfUr4oewmgaKz+o1U dF4a5XZENpoG2yFowUUKaR1/bRC4gfQZFjCGTmeNc2zM92/xCQfJ4ESXlEMbZX9DBQ2V 9kww== 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=4YiQdBJ1hxjT11XkjIFT4NIt+VV3HO6udxhsJSHRVWc=; b=G/wYS/Do3ZQMcxlHUTvx9NZbMRzzgX8TtqnyGoLGIwoI2P1/faX1/MuRA4ErWZuOMC pYS3wXWzeVsdTpbEgc164oNcxmtL+g52Je+60tS+9NfzY42bfFifg8v2J4Go0i9A9osC XtJKcHNKaUeaIB6eqiwVuW19Tuo9P5haGGCdcTz/ZZKu1BdRbY27G9uke6DX+X57lR3j MH41ZbhEr3gfL5MTfH3mVGcVyEir8Yw8mvY2nHU7xgh5JlGKEzWD5j/7cdevP9rz+InU 62Z4weitovvh2V2QtK1iYqLu7tRTyHg/1KgsxI5HtI1R0BtT5eSY6X9emJMv6xD7IEPh D0cQ== X-Gm-Message-State: AOAM5312MRIlO7jvnjfhmGJon9zuLPimUags0CnqPYNHWlpUwQGi9HXR NUAyYVieNYgwPdj1JhSEZe8rlA== X-Google-Smtp-Source: ABdhPJxi6ETqkvY/8PcZ5+/345ZzzKFKxkznORzuyEX88savOoeSRnsvh9Co+4rxvoCzIlO295ucKw== X-Received: by 2002:a7b:c401:: with SMTP id k1mr2517484wmi.18.1599139934297; Thu, 03 Sep 2020 06:32:14 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 2/3] target/arm: Convert Neon VCVT fp size field to MO_* in decode Date: Thu, 3 Sep 2020 14:32:08 +0100 Message-Id: <20200903133209.5141-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200903133209.5141-1-peter.maydell@linaro.org> References: <20200903133209.5141-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Convert the insns using the 2reg_vcvt and 2reg_vcvt_f16 formats to pass the size through to the trans function as a MO_* value rather than the '0=3D=3Df32, 1=3D=3Df16' used in the fp 3-same encodings. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/neon-dp.decode | 3 +-- target/arm/translate-neon.c.inc | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/target/arm/neon-dp.decode b/target/arm/neon-dp.decode index f453833396f..d7da2e7db3c 100644 --- a/target/arm/neon-dp.decode +++ b/target/arm/neon-dp.decode @@ -256,9 +256,8 @@ VMINNM_fp_3s 1111 001 1 0 . 1 . .... .... 1111 ... = 1 .... @3same_fp @2reg_shll_b .... ... . . . 001 shift:3 .... .... 0 . . . .... \ &2reg_shift vm=3D%vm_dp vd=3D%vd_dp size=3D0 q=3D0 =20 -# We use size=3D0 for fp32 and size=3D1 for fp16 to match the 3-same encod= ings. @2reg_vcvt .... ... . . . 1 ..... .... .... . q:1 . . .... \ - &2reg_shift vm=3D%vm_dp vd=3D%vd_dp size=3D0 shift=3D%neo= n_rshift_i5 + &2reg_shift vm=3D%vm_dp vd=3D%vd_dp size=3D2 shift=3D%neo= n_rshift_i5 @2reg_vcvt_f16 .... ... . . . 11 .... .... .... . q:1 . . .... \ &2reg_shift vm=3D%vm_dp vd=3D%vd_dp size=3D1 shift=3D%neo= n_rshift_i4 =20 diff --git a/target/arm/translate-neon.c.inc b/target/arm/translate-neon.c.= inc index 255c1cf8a2a..213c1c2174a 100644 --- a/target/arm/translate-neon.c.inc +++ b/target/arm/translate-neon.c.inc @@ -1626,7 +1626,7 @@ static bool do_fp_2sh(DisasContext *s, arg_2reg_shift= *a, return false; } =20 - if (a->size !=3D 0) { + if (a->size =3D=3D MO_16) { if (!dc_isar_feature(aa32_fp16_arith, s)) { return false; } @@ -1646,7 +1646,7 @@ static bool do_fp_2sh(DisasContext *s, arg_2reg_shift= *a, return true; } =20 - fpst =3D fpstatus_ptr(a->size ? FPST_STD_F16 : FPST_STD); + fpst =3D fpstatus_ptr(a->size =3D=3D MO_16 ? FPST_STD_F16 : FPST_STD); tcg_gen_gvec_2_ptr(rd_ofs, rm_ofs, fpst, vec_size, vec_size, a->shift,= fn); tcg_temp_free_ptr(fpst); return true; --=20 2.20.1 From nobody Sun Nov 16 05:42:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1599139991; cv=none; d=zohomail.com; s=zohoarc; b=IznUlq8EHbwPy7H3s9YRXkc+i/HL63TUPx6WBgBkZ+61V9dsyD/1PA0z0ik9+qgwvmaqBOKxIa/92wodTw0i6aDC9NTLWOV7+4NrnnJpOCpgQGmUhGpSC9sPDvrcSm84TIEuxaZ6U20/MrhLF39w0jVMt+tOxIgfK3Kf72Mte40= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599139991; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IgYMHg6sQF3t/vMOC9QTn+hOO3zcDKiyhoHEzTVk0VU=; b=LTvZEN04OnEgbGAHKM+IEAE9CcaLKIRJwmapj11rDfnhxO9CBHtg/epFALp/01hGN9URMi58Qj9AjNprAcf8GBv4K/kzRTYnHdeWA4Jv5GFwWhmHZOHBX7abqJRJKWAPcJt5+gpg4RIb8XG7ZAETi60Po5zyWa6zar0V2YRm0Zg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159913999143831.280420877419374; Thu, 3 Sep 2020 06:33:11 -0700 (PDT) Received: from localhost ([::1]:38552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDpMU-0000BC-9Z for importer@patchew.org; Thu, 03 Sep 2020 09:33:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDpLe-0007It-FQ for qemu-devel@nongnu.org; Thu, 03 Sep 2020 09:32:18 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:52240) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDpLc-0007vM-MG for qemu-devel@nongnu.org; Thu, 03 Sep 2020 09:32:18 -0400 Received: by mail-wm1-x341.google.com with SMTP id q9so2914141wmj.2 for ; Thu, 03 Sep 2020 06:32:16 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id k24sm4301988wmj.19.2020.09.03.06.32.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 06:32:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IgYMHg6sQF3t/vMOC9QTn+hOO3zcDKiyhoHEzTVk0VU=; b=xK3i/ztvBbe+0TqwiOM/GgMyjONPmzXeVFxqxQtHUdIdxANuYuTQvnwPoDIYbPUVRz +Qb0gQd8RqtNS8sYJ65gePV7i9jBP8ISJJL0pFObifBqkD2o5J6DTE48qvRXFUOHu1Id nxdfLrftMtpkhS5WMukTRFeyl6zkvL21t3ezG8dgg39quMxjCxQynCrRQswaNLpG8TkA mhFV/jfF/3aPNdBehgEpzip0bFh/k43/9ZJctmbHPwJDeIo9T6WnpTs7Abt1BsfyKsUF Em63+STYTvSyHFulW13G2sNTKSoic0DHMdpzNni8U53dTA+8IzfdeV7Ye9nj+cMh7/nT SFyQ== 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=IgYMHg6sQF3t/vMOC9QTn+hOO3zcDKiyhoHEzTVk0VU=; b=kTX0/axph5o3kdyBhYNGBa841P59criE19yZmhRVNIGBJLs3zLMn43ZuBrsatEScO8 x1IS91GYYpNjZSKIV4QVbU4+htbGmR2vzKq6bM3R6kF593YPw90Ndc1sinwmca/5zgp+ EXcbbSYiX0qIN5sUjNJIgX9Qzgmhw1Cy+Wz0+wiBKp5ZoHSyDHLHHmRG4DNSeHJTVayf bSgr/l7p2BNoK/O/rpmEQICM3LEt62NRJaaZxUampuNzP0xYvk+CNroaxzug3qDvx6mv BMeQ7yX3oLn2mOszvzD3vgQOqRhxVMNb/tnOuBnEHBeuvsjVUcslqOpaEeAaxus2Ovuu kqVw== X-Gm-Message-State: AOAM533IhuVNEdaFHD5WvVBznXbXDvKXRaM0SV9q6Pvoj2SSKwAOyhL3 z3I619GJ9kBY9ffNudCRpVyLBg== X-Google-Smtp-Source: ABdhPJzSWLL1cBY7yN1l1T/wm5CvXRgtigm5RIQ2+FXWXRaIp78PSK3Lc0TMjEHwFDxrS5XjIfKzSQ== X-Received: by 2002:a1c:7d55:: with SMTP id y82mr2583824wmc.100.1599139935323; Thu, 03 Sep 2020 06:32:15 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 3/3] target/arm: Convert VCMLA, VCADD size field to MO_* in decode Date: Thu, 3 Sep 2020 14:32:09 +0100 Message-Id: <20200903133209.5141-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200903133209.5141-1-peter.maydell@linaro.org> References: <20200903133209.5141-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" The VCMLA and VCADD insns have a size field which is 0 for fp16 and 1 for fp32 (note that this is the reverse of the Neon 3-same encoding!). Convert it to MO_* values in decode for consistency. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/neon-shared.decode | 18 ++++++++++++------ target/arm/translate-neon.c.inc | 22 ++++++++++++---------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/target/arm/neon-shared.decode b/target/arm/neon-shared.decode index f297ba8cdfc..a9d010880d4 100644 --- a/target/arm/neon-shared.decode +++ b/target/arm/neon-shared.decode @@ -34,11 +34,17 @@ %vd_dp 22:1 12:4 %vd_sp 12:4 22:1 =20 -VCMLA 1111 110 rot:2 . 1 size:1 .... .... 1000 . q:1 . 0 .... \ - vm=3D%vm_dp vn=3D%vn_dp vd=3D%vd_dp +# For VCMLA/VCADD insns, convert the single-bit size field +# which is 0 for fp16 and 1 for fp32 into a MO_* constant. +# (Note that this is the reverse of the sense of the 1-bit size +# field in the 3same_fp Neon insns.) +%vcadd_size 20:1 !function=3Dplus1 =20 -VCADD 1111 110 rot:1 1 . 0 size:1 .... .... 1000 . q:1 . 0 .... \ - vm=3D%vm_dp vn=3D%vn_dp vd=3D%vd_dp +VCMLA 1111 110 rot:2 . 1 . .... .... 1000 . q:1 . 0 .... \ + vm=3D%vm_dp vn=3D%vn_dp vd=3D%vd_dp size=3D%vcadd_size + +VCADD 1111 110 rot:1 1 . 0 . .... .... 1000 . q:1 . 0 .... \ + vm=3D%vm_dp vn=3D%vn_dp vd=3D%vd_dp size=3D%vcadd_size =20 # VUDOT and VSDOT VDOT 1111 110 00 . 10 .... .... 1101 . q:1 . u:1 .... \ @@ -51,9 +57,9 @@ VFML 1111 110 0 s:1 . 10 .... .... 1000 . 1 . 1= .... \ vm=3D%vm_dp vn=3D%vn_dp vd=3D%vd_dp q=3D1 =20 VCMLA_scalar 1111 1110 0 . rot:2 .... .... 1000 . q:1 index:1 0 vm:4 \ - vn=3D%vn_dp vd=3D%vd_dp size=3D0 + vn=3D%vn_dp vd=3D%vd_dp size=3D1 VCMLA_scalar 1111 1110 1 . rot:2 .... .... 1000 . q:1 . 0 .... \ - vm=3D%vm_dp vn=3D%vn_dp vd=3D%vd_dp size=3D1 index=3D0 + vm=3D%vm_dp vn=3D%vn_dp vd=3D%vd_dp size=3D2 index=3D0 =20 VDOT_scalar 1111 1110 0 . 10 .... .... 1101 . q:1 index:1 u:1 rm:4 \ vm=3D%vm_dp vn=3D%vn_dp vd=3D%vd_dp diff --git a/target/arm/translate-neon.c.inc b/target/arm/translate-neon.c.= inc index 213c1c2174a..4d1a292981b 100644 --- a/target/arm/translate-neon.c.inc +++ b/target/arm/translate-neon.c.inc @@ -168,7 +168,7 @@ static bool trans_VCMLA(DisasContext *s, arg_VCMLA *a) gen_helper_gvec_3_ptr *fn_gvec_ptr; =20 if (!dc_isar_feature(aa32_vcma, s) - || (!a->size && !dc_isar_feature(aa32_fp16_arith, s))) { + || (a->size =3D=3D MO_16 && !dc_isar_feature(aa32_fp16_arith, s)))= { return false; } =20 @@ -187,8 +187,9 @@ static bool trans_VCMLA(DisasContext *s, arg_VCMLA *a) } =20 opr_sz =3D (1 + a->q) * 8; - fpst =3D fpstatus_ptr(a->size =3D=3D 0 ? FPST_STD_F16 : FPST_STD); - fn_gvec_ptr =3D a->size ? gen_helper_gvec_fcmlas : gen_helper_gvec_fcm= lah; + fpst =3D fpstatus_ptr(a->size =3D=3D MO_16 ? FPST_STD_F16 : FPST_STD); + fn_gvec_ptr =3D (a->size =3D=3D MO_16) ? + gen_helper_gvec_fcmlah : gen_helper_gvec_fcmlas; tcg_gen_gvec_3_ptr(vfp_reg_offset(1, a->vd), vfp_reg_offset(1, a->vn), vfp_reg_offset(1, a->vm), @@ -205,7 +206,7 @@ static bool trans_VCADD(DisasContext *s, arg_VCADD *a) gen_helper_gvec_3_ptr *fn_gvec_ptr; =20 if (!dc_isar_feature(aa32_vcma, s) - || (!a->size && !dc_isar_feature(aa32_fp16_arith, s))) { + || (a->size =3D=3D MO_16 && !dc_isar_feature(aa32_fp16_arith, s)))= { return false; } =20 @@ -224,8 +225,9 @@ static bool trans_VCADD(DisasContext *s, arg_VCADD *a) } =20 opr_sz =3D (1 + a->q) * 8; - fpst =3D fpstatus_ptr(a->size =3D=3D 0 ? FPST_STD_F16 : FPST_STD); - fn_gvec_ptr =3D a->size ? gen_helper_gvec_fcadds : gen_helper_gvec_fca= ddh; + fpst =3D fpstatus_ptr(a->size =3D=3D MO_16 ? FPST_STD_F16 : FPST_STD); + fn_gvec_ptr =3D (a->size =3D=3D MO_16) ? + gen_helper_gvec_fcaddh : gen_helper_gvec_fcadds; tcg_gen_gvec_3_ptr(vfp_reg_offset(1, a->vd), vfp_reg_offset(1, a->vn), vfp_reg_offset(1, a->vm), @@ -307,7 +309,7 @@ static bool trans_VCMLA_scalar(DisasContext *s, arg_VCM= LA_scalar *a) if (!dc_isar_feature(aa32_vcma, s)) { return false; } - if (a->size =3D=3D 0 && !dc_isar_feature(aa32_fp16_arith, s)) { + if (a->size =3D=3D MO_16 && !dc_isar_feature(aa32_fp16_arith, s)) { return false; } =20 @@ -325,10 +327,10 @@ static bool trans_VCMLA_scalar(DisasContext *s, arg_V= CMLA_scalar *a) return true; } =20 - fn_gvec_ptr =3D (a->size ? gen_helper_gvec_fcmlas_idx - : gen_helper_gvec_fcmlah_idx); + fn_gvec_ptr =3D (a->size =3D=3D MO_16) ? + gen_helper_gvec_fcmlah_idx : gen_helper_gvec_fcmlas_idx; opr_sz =3D (1 + a->q) * 8; - fpst =3D fpstatus_ptr(a->size =3D=3D 0 ? FPST_STD_F16 : FPST_STD); + fpst =3D fpstatus_ptr(a->size =3D=3D MO_16 ? FPST_STD_F16 : FPST_STD); tcg_gen_gvec_3_ptr(vfp_reg_offset(1, a->vd), vfp_reg_offset(1, a->vn), vfp_reg_offset(1, a->vm), --=20 2.20.1