From nobody Wed Apr 16 05:28:13 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=1560430293; cv=none; d=zoho.com; s=zohoarc; b=b0Fs54I84YYgUqYGQRGARhnlixPG44Fesj3IiJthMja33KuLy6tpjTPKBmSSgDrO3DBeP/hxP3SFQaHDssc6uDN3YU8/M3hr7kdbB3+yuINX4J0eUMQBZHQrLxHsUMTyFLppNBmSeZ4/vE9OYdxFwppz3d5/SUnip10JYB0JMX0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560430293; 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=i8xZRS9V37an5mkOlNCXHCAwIm1/t9dfCuxOwyhXLds=; b=aBXUCe4xggVw5QgiXopug7CMSs2egoBOJLPNqPdAtaZhEDR4Sl5Ob6D9vqCQ8Tx22xkMcZxRYem0I6zRVjdTOMrrqTd+jBVSbBhnPHUOnrt30nNjZNSA8ikBjGQ65SzmhYHUU9yh6ZCTxSZm3KE2kzECclFgdaMgZ4gcbZxF76M= 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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560430293670130.56162181131754; Thu, 13 Jun 2019 05:51:33 -0700 (PDT) Received: from localhost ([::1]:39498 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbPCW-0005rR-N6 for importer@patchew.org; Thu, 13 Jun 2019 08:51:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59017) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbOdL-00080U-9w 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-0004Kc-D9 for qemu-devel@nongnu.org; Thu, 13 Jun 2019 08:15:10 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:37118) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hbOdF-00042O-A8 for qemu-devel@nongnu.org; Thu, 13 Jun 2019 08:15:05 -0400 Received: by mail-wr1-x443.google.com with SMTP id v14so20515036wrr.4 for ; Thu, 13 Jun 2019 05:14:52 -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.14.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jun 2019 05:14:50 -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=i8xZRS9V37an5mkOlNCXHCAwIm1/t9dfCuxOwyhXLds=; b=WhvCEeiJ4qDz6f2XhTdPDI2rPJoTHYpB9dyq2Oh/x7IJ0U3QhYkcjKy0oPT8TLLkl2 DrcOAc+tbhXYXG9minu1PjDp4furjVg9SGEH246qWjyZN8Z37XC9s/Czo6onn0hoU4Eb +KcqBBQgsK1i29/sEMYV+ICRoieIdUTpmjkk5ZKjzS4uKxJAinH74CO1VDSGy7zwInHU PxOCmeuZ9WQQcQl+C5WQYoBTiVEoa07uC7BN28h13ixSWLC83+pSldj23LnxILf6ye2l vDUQwqoR45xVuz3XKK2frk7uXltij66wRe2C7OKkeWzpNvkOiGw47Hp6HKFcFLcpIHRb gOLA== 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=i8xZRS9V37an5mkOlNCXHCAwIm1/t9dfCuxOwyhXLds=; b=jpp+Klz9haFe9ofShXE5eqgINFM6pL0tW1sNjD42xQM3u7PlIjgUllK7bYaHMGAe/L K0cs+jT43f8MPNPH769YdxWU7KCzTndqWbuSrqydYnhrlzKBDk7oEpu8fhPdBvMV6cSt 6pMeP7j4vaMpYygGaMKZAuQ5XWAaQCtbXJ/vcDFtpGM5Zbfgn7Wu1VIcIGLS+F/oZs8U oHBOBs0QAVRDuidSlxUYoZOa+QqwOJNDpiLxeCVXcT9TUpQh75ECCwcbM2uxEIqo9Kol 1otKb1rSPPH2m6BC08gXFxJC+1R6R8eDmfeCftn6a8Bh2HChMkmtJ1NxKvuKfuudgK2b I5NA== X-Gm-Message-State: APjAAAUfZh1JhaYLXkcXVyY1i460mLoXgWXllOOPIrTNMQ47hB8/2vQ1 PFvzYX1BVQ47nCfIdVdxYUNCkGVKkT3y8A== X-Google-Smtp-Source: APXvYqzpEKFe01zn/mPdO0Kr9yjyXW3x4edYVhL8X6YExI4dPxcAAizBR+29SkkEzl8mO8w1ac9rcQ== X-Received: by 2002:adf:e301:: with SMTP id b1mr8052440wrj.304.1560428091209; Thu, 13 Jun 2019 05:14:51 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Jun 2019 13:14:00 +0100 Message-Id: <20190613121433.5246-16-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::443 Subject: [Qemu-devel] [PULL 15/48] target/arm: Convert VCVTA/VCVTN/VCVTP/VCVTM 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 VCVTA/VCVTN/VCVTP/VCVTM instructions to decodetree. trans_VCVT() is temporarily left in translate.c. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/translate.c | 72 +++++++++++++++++------------------- target/arm/vfp-uncond.decode | 6 +++ 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index 1da683820ab..d59fadc8fbe 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -3340,12 +3340,31 @@ static bool trans_VRINT(DisasContext *s, arg_VRINT = *a) return true; } =20 -static int handle_vcvt(uint32_t insn, uint32_t rd, uint32_t rm, uint32_t d= p, - int rounding) +static bool trans_VCVT(DisasContext *s, arg_VCVT *a) { - bool is_signed =3D extract32(insn, 7, 1); - TCGv_ptr fpst =3D get_fpstatus_ptr(0); + uint32_t rd, rm; + bool dp =3D a->dp; + TCGv_ptr fpst; TCGv_i32 tcg_rmode, tcg_shift; + int rounding =3D fp_decode_rm[a->rm]; + bool is_signed =3D a->op; + + if (!dc_isar_feature(aa32_vcvt_dr, s)) { + return false; + } + + /* UNDEF accesses to D16-D31 if they don't exist */ + if (dp && !dc_isar_feature(aa32_fp_d32, s) && (a->vm & 0x10)) { + return false; + } + rd =3D a->vd; + rm =3D a->vm; + + if (!vfp_access_check(s)) { + return true; + } + + fpst =3D get_fpstatus_ptr(0); =20 tcg_shift =3D tcg_const_i32(0); =20 @@ -3355,10 +3374,6 @@ static int handle_vcvt(uint32_t insn, uint32_t rd, u= int32_t rm, uint32_t dp, if (dp) { TCGv_i64 tcg_double, tcg_res; TCGv_i32 tcg_tmp; - /* Rd is encoded as a single precision register even when the sour= ce - * is double precision. - */ - rd =3D ((rd << 1) & 0x1e) | ((rd >> 4) & 0x1); tcg_double =3D tcg_temp_new_i64(); tcg_res =3D tcg_temp_new_i64(); tcg_tmp =3D tcg_temp_new_i32(); @@ -3395,28 +3410,7 @@ static int handle_vcvt(uint32_t insn, uint32_t rd, u= int32_t rm, uint32_t dp, =20 tcg_temp_free_ptr(fpst); =20 - return 0; -} - -static int disas_vfp_misc_insn(DisasContext *s, uint32_t insn) -{ - uint32_t rd, rm, dp =3D extract32(insn, 8, 1); - - if (dp) { - VFP_DREG_D(rd, insn); - VFP_DREG_M(rm, insn); - } else { - rd =3D VFP_SREG_D(insn); - rm =3D VFP_SREG_M(insn); - } - - if ((insn & 0x0fbc0e50) =3D=3D 0x0ebc0a40 && - dc_isar_feature(aa32_vcvt_dr, s)) { - /* VCVTA, VCVTN, VCVTP, VCVTM */ - int rounding =3D fp_decode_rm[extract32(insn, 16, 2)]; - return handle_vcvt(insn, rd, rm, dp, rounding); - } - return 1; + return true; } =20 /* @@ -3452,6 +3446,15 @@ static int disas_vfp_insn(DisasContext *s, uint32_t = insn) } } =20 + if (extract32(insn, 28, 4) =3D=3D 0xf) { + /* + * Encodings with T=3D1 (Thumb) or unconditional (ARM): these + * were all handled by the decodetree decoder, so any insn + * patterns which get here must be UNDEF. + */ + return 1; + } + /* * FIXME: this access check should not take precedence over UNDEF * for invalid encodings; we will generate incorrect syndrome informat= ion @@ -3468,15 +3471,6 @@ static int disas_vfp_insn(DisasContext *s, uint32_t = insn) return 0; } =20 - if (extract32(insn, 28, 4) =3D=3D 0xf) { - /* - * Encodings with T=3D1 (Thumb) or unconditional (ARM): - * only used for the "miscellaneous VFP features" added in v8A - * and v7M (and gated on the MVFR2.FPMisc field). - */ - return disas_vfp_misc_insn(s, insn); - } - dp =3D ((insn & 0xf00) =3D=3D 0xb00); switch ((insn >> 24) & 0xf) { case 0xe: diff --git a/target/arm/vfp-uncond.decode b/target/arm/vfp-uncond.decode index 0aa83285de2..5af1f2ee664 100644 --- a/target/arm/vfp-uncond.decode +++ b/target/arm/vfp-uncond.decode @@ -55,3 +55,9 @@ VRINT 1111 1110 1.11 10 rm:2 .... 1010 01.0 .... \ vm=3D%vm_sp vd=3D%vd_sp dp=3D0 VRINT 1111 1110 1.11 10 rm:2 .... 1011 01.0 .... \ vm=3D%vm_dp vd=3D%vd_dp dp=3D1 + +# VCVT float to int with specified rounding mode; Vd is always single-prec= ision +VCVT 1111 1110 1.11 11 rm:2 .... 1010 op:1 1.0 .... \ + vm=3D%vm_sp vd=3D%vd_sp dp=3D0 +VCVT 1111 1110 1.11 11 rm:2 .... 1011 op:1 1.0 .... \ + vm=3D%vm_dp vd=3D%vd_sp dp=3D1 --=20 2.20.1