From nobody Thu Dec 18 22:24:45 2025 Delivered-To: importer@patchew.org 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; 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=1582909224; cv=none; d=zohomail.com; s=zohoarc; b=RP/XkbvZ1OSaQapMjVEiM/zigWsUh9Ik22iH3njHT6h5OIrYAt1p6IAP3+auoyohnNZWm7PaW3ZTAM8OioZt7F/AVkn04YrMu3nTe7PpjqSTUC47Goust/zTvtYWcmdb9BQtNmDIoFV9FiAJoey2fQ0K1Ik9r2jLrV/CF8fHy5U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582909224; h=Content-Transfer-Encoding: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=H9vgJ1xHyPTbz5vgbyrb9N1PuwfNuQ0QSjFXbJuKM48=; b=f+aQKKS2akvAq39Qxkz75qKWaM9i6GDbTorniXozDqZEMokX9+AvjQ1gIX8pyAMa2b6Chg9lJa64EfteA91g0YCPsoUaRKk1ZgZk2IWcEzoMgypJPji061/6myDeD6ekVHxHBNL7uAsdUzhxsqZeRNa4ndx9UNDRx3Toi8tffAA= 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 1582909224812163.75432278249855; Fri, 28 Feb 2020 09:00:24 -0800 (PST) Received: from localhost ([::1]:50826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7izu-0002ru-6W for importer@patchew.org; Fri, 28 Feb 2020 12:00:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56636) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7ifO-0007wH-7s for qemu-devel@nongnu.org; Fri, 28 Feb 2020 11:39:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7ifM-0001zk-SA for qemu-devel@nongnu.org; Fri, 28 Feb 2020 11:39:10 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:41893) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j7ifM-0001zI-Le for qemu-devel@nongnu.org; Fri, 28 Feb 2020 11:39:08 -0500 Received: by mail-wr1-x441.google.com with SMTP id v4so3642525wrs.8 for ; Fri, 28 Feb 2020 08:39:08 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id c9sm13335214wrq.44.2020.02.28.08.39.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Feb 2020 08:39:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=H9vgJ1xHyPTbz5vgbyrb9N1PuwfNuQ0QSjFXbJuKM48=; b=d8Hb5eA9ftrUsULuODN5juju2IgEVy3sSpUaHbbx40qsXUSO0tstmosyZGiCCxCgSn BwaFsgunCSR/zn8S7qeheUXcXy/3WoCYzvW1whaS/PAF56jkXw7bpIYM1a9O4FjoWOUw 3ZVazTWpVuO4e3U/6DotxWHHIF13uI4UQ4LNCFgVYRCNYgiZ2N08ns7re5l6k1UBnGqp /FHLI7ybJJC2DyA5xro6z5EI7ctJ0CrANiY7+3eaob9I6wN9vOsaae3XdFcvNASKTnXc ur6WopbvutIUp352T1q2SklM/qlBfa7Bab93PPVWGpcuUu4TBpQYyUFK+iRnHQ41F3u4 i4Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=H9vgJ1xHyPTbz5vgbyrb9N1PuwfNuQ0QSjFXbJuKM48=; b=HfBnz32/SYn+BfgwoljVCw5Ls7QxQM89tKUImh6ozmYnjupQ3P361aTc8rRsrxNzly ++dl2OuSOy3ekpGOODo1Z5W7irLpsLvdrDFZq3+OK1Dp7XYJMz2954A56UAK2OSS8XEH PFe+w50ctJ1LB7eSG2pdADUfCswsFnTGyE3KoNF+gPj4UiqsXgfYc9atn/O47lyo1iV2 7zR4dKI1J0t8IxXqbMQUK7KyvSHupMJH/W8EkLv9VR6n2ILzxQdfAB0laOv5WXjXfa1/ m1ZNFeJSPcGDetrdJlnz1tUVWuqsfFpwrDGwtwZ43QbPFecoSRTH0+22FkmDr5MPIz24 dasA== X-Gm-Message-State: APjAAAVgH2D1iEast/tFW0NMPSqrs54RS4WIGiNrkblbG4qkwlEtbhPB r0yqZ+8vcFKVPI5AwEyMdyMj8iQ9x+dOiw== X-Google-Smtp-Source: APXvYqxxwZQ7PBWv2Y8MJOjF7eRG/uFopVTTz+P1pdFAQlaoz3nM0HpVUnWZNUtodiJgmUxQIGgWIA== X-Received: by 2002:a5d:5007:: with SMTP id e7mr5661156wrt.228.1582907947340; Fri, 28 Feb 2020 08:39:07 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 21/33] target/arm: Split VFM decode Date: Fri, 28 Feb 2020 16:38:28 +0000 Message-Id: <20200228163840.23585-22-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200228163840.23585-1-peter.maydell@linaro.org> References: <20200228163840.23585-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450: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: , 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" From: Richard Henderson 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. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20200224222232.13807-17-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/translate-vfp.inc.c | 52 ++++++++++++++++++++++++++++++---- target/arm/vfp.decode | 17 +++++------ 2 files changed, 55 insertions(+), 14 deletions(-) diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index 1964af3ea5e..41aa67c133a 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_d= p *a) return do_vfp_3op_dp(s, gen_helper_vfp_divd, a->vd, a->vn, a->vm, fals= e); } =20 -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 ne= g_d) { /* * VFNMA : fd =3D muladd(-fd, fn, fm) @@ -1828,12 +1828,12 @@ static bool trans_VFM_sp(DisasContext *s, arg_VFM_s= p *a) =20 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); } @@ -1849,7 +1849,27 @@ static bool trans_VFM_sp(DisasContext *s, arg_VFM_sp= *a) return true; } =20 -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 ne= g_d) { /* * VFNMA : fd =3D muladd(-fd, fn, fm) @@ -1905,12 +1925,12 @@ static bool trans_VFM_dp(DisasContext *s, arg_VFM_d= p *a) =20 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); } @@ -1926,6 +1946,26 @@ static bool trans_VFM_dp(DisasContext *s, arg_VFM_dp= *a) return true; } =20 +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 =3D 0; diff --git a/target/arm/vfp.decode b/target/arm/vfp.decode index 4f294f88be5..5fd70f975ae 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 =20 -VFM_sp ---- 1110 1.01 .... .... 1010 . o2:1 . 0 .... \ - vm=3D%vm_sp vn=3D%vn_sp vd=3D%vd_sp o1=3D1 -VFM_dp ---- 1110 1.01 .... .... 1011 . o2:1 . 0 .... \ - vm=3D%vm_dp vn=3D%vn_dp vd=3D%vd_dp o1=3D1 -VFM_sp ---- 1110 1.10 .... .... 1010 . o2:1 . 0 .... \ - vm=3D%vm_sp vn=3D%vn_sp vd=3D%vd_sp o1=3D2 -VFM_dp ---- 1110 1.10 .... .... 1011 . o2:1 . 0 .... \ - vm=3D%vm_dp vn=3D%vn_dp vd=3D%vd_dp o1=3D2 +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 =20 VMOV_imm_sp ---- 1110 1.11 .... .... 1010 0000 .... \ vd=3D%vd_sp imm=3D%vmov_imm --=20 2.20.1