From nobody Wed Apr 16 05:23:19 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1560430241; cv=none; d=zoho.com; s=zohoarc; b=eC95C56/XlgF2mX4cKK9MYb/8AqQlg9gq2v6iOe8DP6KtZ/WxSNjX8yu3Kr8ymt937MhelfagxcyWzVydFqZJvxQgzXHbzLi5SEpzGef7ujtGzrAaln6+h6wVtgOsA5AP175IC1awXumXwKmtsKKVZDAhrR1MoVziVHbBBfM7mQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560430241; 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:ARC-Authentication-Results; bh=IRZuW3taWPCfJ37rwCt/vodP6fN4Yy7faj6/F0vMpBk=; b=Oeg+4YS3lcgtfwb/TUG25AGthY43Sdz0I1lIyApQgScM5Il5Ty17EGnv+J5JBR/a+65Yiu21fFgj17jm+jar4PYYu/KDPAudwD9VpGaNxxqwstcHaBJAMbqD1Oiu8fVxfUWQ8Og3Dz6ApjKrz32NDij/zRvOEfHQlNsgH0HZPXo= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560430241273704.5481049401698; Thu, 13 Jun 2019 05:50:41 -0700 (PDT) Received: from localhost ([::1]:39492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbPBM-0004co-6u for importer@patchew.org; Thu, 13 Jun 2019 08:50:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59025) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbOdL-00080Z-Ce for qemu-devel@nongnu.org; Thu, 13 Jun 2019 08:15:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbOdH-0004Kj-FG for qemu-devel@nongnu.org; Thu, 13 Jun 2019 08:15:10 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:34022) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hbOdF-0004GR-Bq for qemu-devel@nongnu.org; Thu, 13 Jun 2019 08:15:05 -0400 Received: by mail-wr1-x436.google.com with SMTP id k11so2349590wrl.1 for ; Thu, 13 Jun 2019 05:15:04 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id y6sm2010576wrp.12.2019.06.13.05.15.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jun 2019 05:15:02 -0700 (PDT) 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=IRZuW3taWPCfJ37rwCt/vodP6fN4Yy7faj6/F0vMpBk=; b=oLQA8r7UuXmNoTYEPEC6QiGnVdR3Zc2aIIXxn27myZqylPWNSxqWsCg4nvMWQ+n4xl XjMGrKl84vH/c6iRM7YL99EuU67nCat1bZbnDz367Dhh7kqbKm0F1wJCdbvl6svdjn5L gNen86jGdt2uUTUFfu9sS/tn5QZd2UwrJNrg0m0yhty1y0oYj47nlV2/kuM44JsjiRTD pERp1BAIgZsFy5u4/Wkcp34pr/SRbb7RUOZblMR3SJsspuoF/4LeEOI5dSB2whFq79T8 1H/Df1y+nPPcutC3FNNN0Utc0mwvGX9GuICypDfJ1eTFvNnMCaGHGPalLqpAc9k6Jsss 4XNg== 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=IRZuW3taWPCfJ37rwCt/vodP6fN4Yy7faj6/F0vMpBk=; b=kUhqxBpH+jCSaoY2Yh0PsaXQ51URrUqEVKe6XIWPrzPF9fCntPSVlNpOqOIW47r6o4 UQHU+Ff8TouiBipOP2GUcionNVDx/l46/0JilTwCyCc4DRi1wkmlQJh38xJ7a7BhybGs nmPjcrqRM6Ufi/e5l+ob0YgIYNzo4G8wab5MlmU6B9qW77dPMLgi2FLhtmSPWQ+jpCVi 3/D5gn5kN22O7iQGoSgcxMDfeS4+UuIYWsAdnWF5rTao+0IK7bnM01XPpcPTB2kXlrhN IjbMyai5ZNst3Gyxvmds17ka6rOalNjJo3Nkm0pPdh7BnX4GU+cVQCNKQe3anWH9F8h7 PknA== X-Gm-Message-State: APjAAAXrTor5Q9jBWNoUJ3N7ySVALk+20fV0ehMNrq6awnOOJ2mmrvDy PrOSwKvDzJ32uClf1lYp+642kHoAk024Nw== X-Google-Smtp-Source: APXvYqyg97mIgrOsBv9muTI6Z81BwHMo/nXzvVfM1/EFR27aFTu97SFtWQGIluuWjCegbu26+MNrQA== X-Received: by 2002:adf:a18a:: with SMTP id u10mr37082207wru.351.1560428103352; Thu, 13 Jun 2019 05:15:03 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Jun 2019 13:14:10 +0100 Message-Id: <20190613121433.5246-26-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190613121433.5246-1-peter.maydell@linaro.org> References: <20190613121433.5246-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::436 Subject: [Qemu-devel] [PULL 25/48] target/arm: Convert VFP VMLS to decodetree 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: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Convert the VFP VMLS instruction to decodetree. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/translate-vfp.inc.c | 38 ++++++++++++++++++++++++++++++++++ target/arm/translate.c | 8 +------ target/arm/vfp.decode | 5 +++++ 3 files changed, 44 insertions(+), 7 deletions(-) diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index 4f922dc8405..00f64401dda 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -1303,3 +1303,41 @@ static bool trans_VMLA_dp(DisasContext *s, arg_VMLA_= sp *a) { return do_vfp_3op_dp(s, gen_VMLA_dp, a->vd, a->vn, a->vm, true); } + +static void gen_VMLS_sp(TCGv_i32 vd, TCGv_i32 vn, TCGv_i32 vm, TCGv_ptr fp= st) +{ + /* + * VMLS: vd =3D vd + -(vn * vm) + * Note that order of inputs to the add matters for NaNs. + */ + TCGv_i32 tmp =3D tcg_temp_new_i32(); + + gen_helper_vfp_muls(tmp, vn, vm, fpst); + gen_helper_vfp_negs(tmp, tmp); + gen_helper_vfp_adds(vd, vd, tmp, fpst); + tcg_temp_free_i32(tmp); +} + +static bool trans_VMLS_sp(DisasContext *s, arg_VMLS_sp *a) +{ + return do_vfp_3op_sp(s, gen_VMLS_sp, a->vd, a->vn, a->vm, true); +} + +static void gen_VMLS_dp(TCGv_i64 vd, TCGv_i64 vn, TCGv_i64 vm, TCGv_ptr fp= st) +{ + /* + * VMLS: vd =3D vd + -(vn * vm) + * Note that order of inputs to the add matters for NaNs. + */ + TCGv_i64 tmp =3D tcg_temp_new_i64(); + + gen_helper_vfp_muld(tmp, vn, vm, fpst); + gen_helper_vfp_negd(tmp, tmp); + gen_helper_vfp_addd(vd, vd, tmp, fpst); + tcg_temp_free_i64(tmp); +} + +static bool trans_VMLS_dp(DisasContext *s, arg_VMLS_sp *a) +{ + return do_vfp_3op_dp(s, gen_VMLS_dp, a->vd, a->vn, a->vm, true); +} diff --git a/target/arm/translate.c b/target/arm/translate.c index ad8f947a13b..2afab7fbc20 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -3134,7 +3134,7 @@ static int disas_vfp_insn(DisasContext *s, uint32_t i= nsn) rn =3D VFP_SREG_N(insn); =20 switch (op) { - case 0: + case 0 ... 1: /* Already handled by decodetree */ return 1; default: @@ -3320,12 +3320,6 @@ static int disas_vfp_insn(DisasContext *s, uint32_t = insn) for (;;) { /* Perform the calculation. */ switch (op) { - case 1: /* VMLS: fd + -(fn * fm) */ - gen_vfp_mul(dp); - gen_vfp_F1_neg(dp); - gen_mov_F0_vreg(dp, rd); - gen_vfp_add(dp); - break; case 2: /* VNMLS: -fd + (fn * fm) */ /* Note that it isn't valid to replace (-A + B) with (= B - A) * or similar plausible looking simplifications diff --git a/target/arm/vfp.decode b/target/arm/vfp.decode index 9530e17ae02..7bcf2260eec 100644 --- a/target/arm/vfp.decode +++ b/target/arm/vfp.decode @@ -102,3 +102,8 @@ VMLA_sp ---- 1110 0.00 .... .... 1010 .0.0 .... \ vm=3D%vm_sp vn=3D%vn_sp vd=3D%vd_sp VMLA_dp ---- 1110 0.00 .... .... 1011 .0.0 .... \ vm=3D%vm_dp vn=3D%vn_dp vd=3D%vd_dp + +VMLS_sp ---- 1110 0.00 .... .... 1010 .1.0 .... \ + vm=3D%vm_sp vn=3D%vn_sp vd=3D%vd_sp +VMLS_dp ---- 1110 0.00 .... .... 1011 .1.0 .... \ + vm=3D%vm_dp vn=3D%vn_dp vd=3D%vd_dp --=20 2.20.1