From nobody Wed Dec 17 06:16:01 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=1559843936; cv=none; d=zoho.com; s=zohoarc; b=LcHBjVH46ueDDVgm/AWtW9uByGQTKazxSikSjHATFn+8grfNwmXBx2Ue6rmrOc15VzMTEZFIlWMekRkQbaDhHgVeG+sQHHKpvZ5J/NJH4U1vRkF+I5zbbJFakrGdqf//G+OnT7hcxuLunOC1U6Mow2l9de84RFpKU8Mzzd+WNw8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559843936; 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:ARC-Authentication-Results; bh=yYV9ZBlnv8DXFwtLcWMXQbHBF1itZYJ0mukmVjZJUHI=; b=FVuSpz2RKw3oA2NHqaN7uATjdYRF/wYTddbh+siI0o/yz+YmrlUu3XE3Nf7QKcC6/Cdy6KOAqCik76RVUavvoKn3ipGOYFpxUW3rr0GIUpyIk/l93WG4SKcEWc3BsSzblSo3M8rczxLBMkP5eGrlBMnGPGElNvFE2zyw24N5R2U= 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 15598439362481009.019846019368; Thu, 6 Jun 2019 10:58:56 -0700 (PDT) Received: from localhost ([127.0.0.1]:36057 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYwf9-0006Ao-25 for importer@patchew.org; Thu, 06 Jun 2019 13:58:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYwTr-0004Ak-5U for qemu-devel@nongnu.org; Thu, 06 Jun 2019 13:47:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYwTn-0003dN-As for qemu-devel@nongnu.org; Thu, 06 Jun 2019 13:47:13 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:36290) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hYwTm-0002sh-8B for qemu-devel@nongnu.org; Thu, 06 Jun 2019 13:47:10 -0400 Received: by mail-wm1-x342.google.com with SMTP id u8so826822wmm.1 for ; Thu, 06 Jun 2019 10:46:22 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id z135sm2596784wmc.45.2019.06.06.10.46.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Jun 2019 10:46:20 -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=yYV9ZBlnv8DXFwtLcWMXQbHBF1itZYJ0mukmVjZJUHI=; b=WzcUezC4bYu5r0aQiPFLiZvTcT+nZE53EfAljybrxcLwgYzQC9op+xPFR0yolOyzgN V6iRlxyDjLjD21beGQRSSOLm8PorBva/25uliLOgxHBjD4Kfyno60eNlev8Js40BOt5U IF/hSU2VeX2HZqa3x4lNOShwiI1VClXr3dXFdDPG8rhO0mB6XjFJsyb2rAQloK7sNpmr usbArA8obXe2ovsJtcn5fKASgOVRnH3DLlgDALlNur8NN0jdA9g1XkQQ9/b5cKkl6Qz0 qTkxcQZ5AhH8K7fGy4tENDNKC715DGAG1khJGjtJEMKpk4PiS6w8yEK2EnON7UAB+qjq rjaA== 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=yYV9ZBlnv8DXFwtLcWMXQbHBF1itZYJ0mukmVjZJUHI=; b=tSuCVg9X1egLDAA+ZfZaZqZl+TtsrztTUFM6w7IQH1YpH2e1kbYhBPbswZLZAWE44V YsI+N6NP6TfacjdDLKhx39qUPy3SeD2+0ZTnZ98u9eXoIiLO3BffQ81s3ovoJyNnuy6N 12EW8nWdXQH/B3P56A+XqC30YVANcwmZR7hn1aB2Mb264LKa7ottzMcewSY5HAK9KaI1 J77hsHesXNvcUfMhZhcDtAlCfO8Eu5OazPMPoCSwV7v3Jyc4GqPIeiYxfXQDlpiPldIy RrqTzmQWYPkaUsE3Xu3bad3s3ToOcUUJVK3XpF23QovBLSkhI0r6PkD0jG5W9+xbkre0 x5Ug== X-Gm-Message-State: APjAAAWGmFqllwpQ0ZfsZPFdqqaUZqd6TVW+zllka8UtFvwTYcm9IPTv TJeqL3OWGRNAhTLdc0rG/Hjhzg== X-Google-Smtp-Source: APXvYqxTwRV186PuoXdzPeHNuPxqwPH5ZJb7/nSBrq/YhYqEJiVq8lw7bMvKl9O6Jm3wwmppQzF2ZA== X-Received: by 2002:a1c:f712:: with SMTP id v18mr912246wmh.0.1559843181458; Thu, 06 Jun 2019 10:46:21 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Thu, 6 Jun 2019 18:45:36 +0100 Message-Id: <20190606174609.20487-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190606174609.20487-1-peter.maydell@linaro.org> References: <20190606174609.20487-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::342 Subject: [Qemu-devel] [PATCH 09/42] target/arm: Convert VCVTA/VCVTN/VCVTP/VCVTM to decodetree X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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: 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 91e3e3680b2..2cf8fd99404 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