From patchwork Tue Jun 11 10:53:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 166424 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2253647ilk; Tue, 11 Jun 2019 04:51:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxy9p98vBN3GOgy3jYg1Ug/YqKHyJX/IYEd6A+dB+RUllezWt1RjTV6Ig+y+MGQ3VOzUd6x X-Received: by 2002:ac8:1010:: with SMTP id z16mr52878833qti.367.1560253876341; Tue, 11 Jun 2019 04:51:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560253876; cv=none; d=google.com; s=arc-20160816; b=W1A6sHUwP/bmceaucjQT9hg1P8ONqVuvLUQAg2JyI44itmCtT0WyPVlgTe+ICVMnD7 wSfG4eoXSHofpFdg4tOI+Zb6i2BLLlj5BJpqele9MoLBvbRGZ2Q6orqYeCVIFzcR1W5Z DAU1xgFYhZJikVvoW5+BmW3bUGp3tnBgG+Ys9Tb0MrKHFlMZ3vkMV6YLmuDYYkiurfUO LNTJd4iDeCuPJs98lZgoP/6C5sqSOMVkVbKo57aFGLhAsKaFS45CleLWvpNrH5WHwjNf faYT9UpDJUYClLILsSeHdKqX81lm5Ww3QERl0+rc1Mh5HI1PxAuQCoIhLucGugBeiWQt lzeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=ArclSEoRm2zBs6YVh3NYURVc6boo9wJxlzan6nD1jCM=; b=pGosZjVQApwKyAEtdcbVFwsvh3p4cEHd90Y/T95P8sV+IjhxpckS7cHOPxdOPRco+2 0bNFpnoXasIbHKeYPvC8LyJVy65oFYMM9L/H/LYKhKEIUk4Lir4vmu+lypFjY/PiYNsI OnWNGkhn5BY03gz+dOtOeO4xXHbABZ+RJDq6iyICChlZq4jZSiJELM1Tp8HdkYtT39BB TqMNcsnV0xk/bgmGyNBGEGQZ1ZW1k/bEiyZJrwaEdJZfijfaVuxfxzTQb5vzSqkhac6d 2BNvy9vAFb+/Lzf9D0Fu9cupotfcE13Pi57f2fI8FEi0+rFaIQjNyrLOwROT2PtNeuo1 4i5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=MDv3GQGD; 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 u6si6288465qte.126.2019.06.11.04.51.16 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jun 2019 04:51:16 -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=MDv3GQGD; 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]:56670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hafJ5-0006hC-Rw for patch@linaro.org; Tue, 11 Jun 2019 07:51:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39699) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haeQR-0007fa-RU for qemu-devel@nongnu.org; Tue, 11 Jun 2019 06:54:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1haeQL-0007t7-Qk for qemu-devel@nongnu.org; Tue, 11 Jun 2019 06:54:47 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:41374) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1haeQL-0007gR-Dz for qemu-devel@nongnu.org; Tue, 11 Jun 2019 06:54:41 -0400 Received: by mail-wr1-x443.google.com with SMTP id c2so12477164wrm.8 for ; Tue, 11 Jun 2019 03:54:28 -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=ArclSEoRm2zBs6YVh3NYURVc6boo9wJxlzan6nD1jCM=; b=MDv3GQGDV37DbvwmtT3ayV+ug4cRNFprEwYhiO9vyIq/QSwpVWWDXY4P4uyH78y0oA BfB6mX0lss1ov48mInGJnxc6sV1kg7SUDkil+BdmQbD7bJWJaVtTJfiNK2Zt5xu4YhhM rRUU84N1eqSubhzPGH7IcSO43r6fcFGT3I/M69rUUsyTEsb7uBJ4Skjx53P72HQqKwEq w+g6UNQXZ5P8YdaBK/yn22mjp0uzwE8O8Ycej9T3Q5bfcHIHoFeo7zZonLAYX8w94PcI ozrCeiAosJJPlMxcoNCNffbx7sy46nubkOrw1TkpKktGZWrt17e7GkZlVxu/acHfsg/M 0Udg== 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=ArclSEoRm2zBs6YVh3NYURVc6boo9wJxlzan6nD1jCM=; b=obTOplNsR6m8xpuuARcITgIpks+gEUHTKKWVcjvaAMWupl90SPb9TNYSSJJ8hzSuR9 Ec3WreOjs1qzDizXKKaVzgIsOsB4e2qAOEw1CsoDWYjCJNY8bZ+tEtd9z7F+cYb+9tje f9Vs1GG+dFWn7UV8nUoXH4ReGk9iAE0uJBffkRTzCJQ0tZ1hEaDPLpGBF9gcs9HqsKkX 1pD7PGmoF5XvTWIP68S41sQE4mw+PiX0ts2vBgpIdskE1uFfd0E/K71NDGrrJpc6eLrl 0JxiC9SxT7qzTqHkxop3y71StHJpJkmB2a8c6IkG4pKjxc1sJMQJy1e/fbOSdvk2x85S iToQ== X-Gm-Message-State: APjAAAWzrD1HAKI7+YNtd4cMiGL5D7u3FT8zz8/b022yZB3UCbyfC4IU vPwy9urjJCBy6Ha454vYozt/Pg== X-Received: by 2002:a5d:5510:: with SMTP id b16mr14634904wrv.267.1560250467310; Tue, 11 Jun 2019 03:54:27 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id e17sm10785945wrt.95.2019.06.11.03.54.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 03:54:26 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Tue, 11 Jun 2019 11:53:40 +0100 Message-Id: <20190611105351.9871-32-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190611105351.9871-1-peter.maydell@linaro.org> References: <20190611105351.9871-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::443 Subject: [Qemu-devel] [PATCH v2 31/42] target/arm: Convert VSQRT 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: , Cc: Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Convert the VSQRT instruction to decodetree. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/translate-vfp.inc.c | 20 ++++++++++++++++++++ target/arm/translate.c | 14 +------------- target/arm/vfp.decode | 5 +++++ 3 files changed, 26 insertions(+), 13 deletions(-) -- 2.20.1 diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index 6e06b2a130a..ae2f77a873b 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -1908,3 +1908,23 @@ static bool trans_VNEG_dp(DisasContext *s, arg_VNEG_dp *a) { return do_vfp_2op_dp(s, gen_helper_vfp_negd, a->vd, a->vm); } + +static void gen_VSQRT_sp(TCGv_i32 vd, TCGv_i32 vm) +{ + gen_helper_vfp_sqrts(vd, vm, cpu_env); +} + +static bool trans_VSQRT_sp(DisasContext *s, arg_VSQRT_sp *a) +{ + return do_vfp_2op_sp(s, gen_VSQRT_sp, a->vd, a->vm); +} + +static void gen_VSQRT_dp(TCGv_i64 vd, TCGv_i64 vm) +{ + gen_helper_vfp_sqrtd(vd, vm, cpu_env); +} + +static bool trans_VSQRT_dp(DisasContext *s, arg_VSQRT_dp *a) +{ + return do_vfp_2op_dp(s, gen_VSQRT_dp, a->vd, a->vm); +} diff --git a/target/arm/translate.c b/target/arm/translate.c index b0eecb6ca8f..ce805f0ab28 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -1390,14 +1390,6 @@ static inline void gen_vfp_neg(int dp) gen_helper_vfp_negs(cpu_F0s, cpu_F0s); } -static inline void gen_vfp_sqrt(int dp) -{ - if (dp) - gen_helper_vfp_sqrtd(cpu_F0d, cpu_F0d, cpu_env); - else - gen_helper_vfp_sqrts(cpu_F0s, cpu_F0s, cpu_env); -} - static inline void gen_vfp_cmp(int dp) { if (dp) @@ -3098,7 +3090,7 @@ static int disas_vfp_insn(DisasContext *s, uint32_t insn) return 1; case 15: switch (rn) { - case 1 ... 2: + case 1 ... 3: /* Already handled by decodetree */ return 1; default: @@ -3112,7 +3104,6 @@ static int disas_vfp_insn(DisasContext *s, uint32_t insn) /* rn is opcode, encoded as per VFP_SREG_N. */ switch (rn) { case 0x00: /* vmov */ - case 0x03: /* vsqrt */ break; case 0x04: /* vcvtb.f64.f16, vcvtb.f32.f16 */ @@ -3290,9 +3281,6 @@ static int disas_vfp_insn(DisasContext *s, uint32_t insn) case 0: /* cpy */ /* no-op */ break; - case 3: /* sqrt */ - gen_vfp_sqrt(dp); - break; case 4: /* vcvtb.f32.f16, vcvtb.f64.f16 */ { TCGv_ptr fpst = get_fpstatus_ptr(false); diff --git a/target/arm/vfp.decode b/target/arm/vfp.decode index 79e41963be4..2780e1ed9ea 100644 --- a/target/arm/vfp.decode +++ b/target/arm/vfp.decode @@ -166,3 +166,8 @@ VNEG_sp ---- 1110 1.11 0001 .... 1010 01.0 .... \ vd=%vd_sp vm=%vm_sp VNEG_dp ---- 1110 1.11 0001 .... 1011 01.0 .... \ vd=%vd_dp vm=%vm_dp + +VSQRT_sp ---- 1110 1.11 0001 .... 1010 11.0 .... \ + vd=%vd_sp vm=%vm_sp +VSQRT_dp ---- 1110 1.11 0001 .... 1011 11.0 .... \ + vd=%vd_dp vm=%vm_dp