From patchwork Thu Jun 13 12:13:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 166632 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp722106ilk; Thu, 13 Jun 2019 05:54:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPCcZj/l5Wmu2kKkfYqBtY6f4WO1PepmddrOWUubVHCJvTT37Q92ItlB/tOHu47Ie+EcKK X-Received: by 2002:ac8:4982:: with SMTP id f2mr68718180qtq.213.1560430459887; Thu, 13 Jun 2019 05:54:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560430459; cv=none; d=google.com; s=arc-20160816; b=BJ6kXLNozygQC89y+MjROmNTS6f6dBWcd6CA+I+mn6hxWRjVH3Ty/JHMf+9aPTU3LF aYyHfyliQs3XVO7TULx1uPHpjEhhstEZUj6UZj9ZnRoW1JrCyHZfCMfvLq2Dtp85fKW6 G6vXsQXBZuvq41WEJwBR1QS0X0CjfXDs4Q0UmeZKPNN9kGog3uVEV59aGI/aYzGy9xV7 EletyiK/1rsqvLFaEljUTBbEpOPbgidqc3UVxmUkNO1dqX2AeTO3k7BL7b0m/KF7Hruo Hf7fgzvUsMQD7U/Ej63aPvfEFpiByQnImDMecNZt5959QFVd601gMxs/R7Gb4MQHTNR+ Ebzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=DxkVuYTzDW0ZPX4NRM71Po/auhPBMIBC698b0Rvas5w=; b=okDzhkAAUfdiERn6vGmEnDrOTYfWHpd/tChAwlxGy1ry+FU71FnAF2wiamWpGhkuZ2 8J6wbcnPK9cPQIBD8jaRlEgNycMy2kdoSufrCEu0Io3I1WTLkBzqH9LRzcRhO7GTQtas 50j+HqvNE38vQdixfeff4SiKO4zfPEY1uLYAou07yy0CfyBCH/N+0+Ow4PS0HCE08EJ1 XR6Vv88ULLvHpZ3kLu0k35gB4ufSvsJ7sS13nKZAz3tqKuOZmrpWjz4EQwQ7q3Us/ezt Cx+e1rpXYqUr/SWuwJkM3S2t+M0BTXXablUlpECVnlr7+9wy6xbQtFUy6R4pxDv0jisp Sowg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="IkNyyD/i"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m5si1356523qvi.61.2019.06.13.05.54.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jun 2019 05:54:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="IkNyyD/i"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39518 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbPFD-0001Dv-Dk for patch@linaro.org; Thu, 13 Jun 2019 08:54:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59132) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbOdR-00085d-JL for qemu-devel@nongnu.org; Thu, 13 Jun 2019 08:15:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbOdN-0004Q4-7u for qemu-devel@nongnu.org; Thu, 13 Jun 2019 08:15:15 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:45252) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hbOdK-00040o-B2 for qemu-devel@nongnu.org; Thu, 13 Jun 2019 08:15:11 -0400 Received: by mail-wr1-x42c.google.com with SMTP id f9so20487065wre.12 for ; 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=DxkVuYTzDW0ZPX4NRM71Po/auhPBMIBC698b0Rvas5w=; b=IkNyyD/ioq3HBl8rjXSUxwSJ/beY503oJR4gZZmhJt6hIXQT/NUlxzWiLnU4HDwvvL Ss/Dh+tfyvNpWdi3qg8B5R0qbe3UDkwxnEi8PojYLbYKy/istdudSMat9782Jf/qd/0O zQvZrkg3m+04OxCpYRykGkGNtKXZ6zfhmIDi+ZytVy7lF50Ynll2H69kurZ08rUnRHEE tT627+eza/1kRJIpG5K1294T6MMqGM1Wqu2GYuoLMsUslJ8snOvUQFGdjIdnvJFhRbjK lo7x0KNFhM3G2RdBlJXxOTPEiwAGnUy8O7162NELhcpDGtoh/1lehTYUCq+lC4URfipc SHHg== 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=DxkVuYTzDW0ZPX4NRM71Po/auhPBMIBC698b0Rvas5w=; b=kV//gziXyQOIiAOMN5JIZ0LY/+sV5IsS7JEXuRcibpI+cOsjNKdIQ+0rySH9emBAsW lU/+KHd+fIIEMpairwpt1ENlpv73aY4hK/MaBFUiRytzUlml7RNmZKAsnTGVWQoGxnVm w9ON9roo8KpQ1b62WBuDJlU93hrraBFH72c4++St/CoNk7n2AWxoSkxiWdfs7+mDsJfK luPXncY+EBJ0JHbdSOuKZzmZT0Yv/8J2GmqKL1QXtocAT7c5Rz/917jRr7Zcd+zpPLZs +rdjTHCdDgE9EKOGNsUzd0Uqe9jrXiu+ACz/3IOfhbBV2LC8v11wnCZS3O6NCiELDhuN waBA== X-Gm-Message-State: APjAAAWB5o5sPhM7jHpBGCNorfsFH9nnPRr60tE6PYjI1xv6MXS4217a EuU/8f3MU4DgOL5tj8WFH4c/s9RBkxjOBA== X-Received: by 2002:adf:dcc2:: with SMTP id x2mr19241815wrm.55.1560428089145; Thu, 13 Jun 2019 05:14:49 -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.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jun 2019 05:14:48 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Jun 2019 13:13:58 +0100 Message-Id: <20190613121433.5246-14-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 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42c Subject: [Qemu-devel] [PULL 13/48] target/arm: Convert VMINNM, VMAXNM 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Convert the VMINNM and VMAXNM instructions to decodetree. As with VSEL, we leave the trans_VMINMAXNM() function in translate.c for the moment. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/translate.c | 41 ++++++++++++++++++++++++------------ target/arm/vfp-uncond.decode | 5 +++++ 2 files changed, 33 insertions(+), 13 deletions(-) -- 2.20.1 diff --git a/target/arm/translate.c b/target/arm/translate.c index 997cafdbe5c..6cbdf4307a4 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -3202,11 +3202,31 @@ static bool trans_VSEL(DisasContext *s, arg_VSEL *a) return true; } -static int handle_vminmaxnm(uint32_t insn, uint32_t rd, uint32_t rn, - uint32_t rm, uint32_t dp) +static bool trans_VMINMAXNM(DisasContext *s, arg_VMINMAXNM *a) { - uint32_t vmin = extract32(insn, 6, 1); - TCGv_ptr fpst = get_fpstatus_ptr(0); + uint32_t rd, rn, rm; + bool dp = a->dp; + bool vmin = a->op; + TCGv_ptr fpst; + + if (!dc_isar_feature(aa32_vminmaxnm, s)) { + return false; + } + + /* UNDEF accesses to D16-D31 if they don't exist */ + if (dp && !dc_isar_feature(aa32_fp_d32, s) && + ((a->vm | a->vn | a->vd) & 0x10)) { + return false; + } + rd = a->vd; + rn = a->vn; + rm = a->vm; + + if (!vfp_access_check(s)) { + return true; + } + + fpst = get_fpstatus_ptr(0); if (dp) { TCGv_i64 frn, frm, dest; @@ -3247,7 +3267,7 @@ static int handle_vminmaxnm(uint32_t insn, uint32_t rd, uint32_t rn, } tcg_temp_free_ptr(fpst); - return 0; + return true; } static int handle_vrint(uint32_t insn, uint32_t rd, uint32_t rm, uint32_t dp, @@ -3359,23 +3379,18 @@ static const uint8_t fp_decode_rm[] = { static int disas_vfp_misc_insn(DisasContext *s, uint32_t insn) { - uint32_t rd, rn, rm, dp = extract32(insn, 8, 1); + uint32_t rd, rm, dp = extract32(insn, 8, 1); if (dp) { VFP_DREG_D(rd, insn); - VFP_DREG_N(rn, insn); VFP_DREG_M(rm, insn); } else { rd = VFP_SREG_D(insn); - rn = VFP_SREG_N(insn); rm = VFP_SREG_M(insn); } - if ((insn & 0x0fb00e10) == 0x0e800a00 && - dc_isar_feature(aa32_vminmaxnm, s)) { - return handle_vminmaxnm(insn, rd, rn, rm, dp); - } else if ((insn & 0x0fbc0ed0) == 0x0eb80a40 && - dc_isar_feature(aa32_vrint, s)) { + if ((insn & 0x0fbc0ed0) == 0x0eb80a40 && + dc_isar_feature(aa32_vrint, s)) { /* VRINTA, VRINTN, VRINTP, VRINTM */ int rounding = fp_decode_rm[extract32(insn, 16, 2)]; return handle_vrint(insn, rd, rm, dp, rounding); diff --git a/target/arm/vfp-uncond.decode b/target/arm/vfp-uncond.decode index b7f7c27fe86..8ab201fa058 100644 --- a/target/arm/vfp-uncond.decode +++ b/target/arm/vfp-uncond.decode @@ -45,3 +45,8 @@ VSEL 1111 1110 0. cc:2 .... .... 1010 .0.0 .... \ vm=%vm_sp vn=%vn_sp vd=%vd_sp dp=0 VSEL 1111 1110 0. cc:2 .... .... 1011 .0.0 .... \ vm=%vm_dp vn=%vn_dp vd=%vd_dp dp=1 + +VMINMAXNM 1111 1110 1.00 .... .... 1010 . op:1 .0 .... \ + vm=%vm_sp vn=%vn_sp vd=%vd_sp dp=0 +VMINMAXNM 1111 1110 1.00 .... .... 1011 . op:1 .0 .... \ + vm=%vm_dp vn=%vn_dp vd=%vd_dp dp=1