From patchwork Thu Jun 21 01:53:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 139430 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1485574lji; Wed, 20 Jun 2018 19:18:33 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKWIy+CsqwxCTHMdpjmpTX12aZAubjaM7xXQzf02NGY3rkPj38+0Tnq2LkSZ9gdYp2zEI/T X-Received: by 2002:a0c:dd82:: with SMTP id v2-v6mr21041632qvk.176.1529547513559; Wed, 20 Jun 2018 19:18:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529547513; cv=none; d=google.com; s=arc-20160816; b=WZqzmdncakz1bhCYNbZ/k8bzNSXEGV5DUWtxUE9WG8cApPV4+T6oXpZ4512xecHpjx BoJKWKFdAyIGcVFR+VqebZTNHpMJtRsXxLZ5GQH4as45AiT75+aP5DVk59ktjKZxaSrB VENWTktCK0DzzvybUyVyHAiAUCz43hhhLzp7P/VQZK9fQA3Z8RLlqiB8dDkMMatZgy3D ZmOrySBTEhYV9szyyEdL/j1Axj/Y7+HGdiA+ZZ5y9eFZw2tHBY4nm3KTCNzRlgjRSMDF zEqWaZPgDp7o0SEfxdJytb9TLwvbhipLObZdR+T1CZGDs9rmoZDDL9GfljNkyS+YNo/H +Nzg== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=LHWFtiyOKa+HrAxinQWN0q0OwYqueH9VPd2ad8t6RQs=; b=UOy2DQ4j9cexTDhXzLY3xIjNiS1Hs/VHKCmhOmJVcg6sPh2qfpCCPQeS1zdFyGF8TG 90zsmQCizHDMWm+nsscg/5Z+jvEJpyYmqgOvLIfH4AEoE0yPFQZGdAXi9Y5Y8y1nDacc KN0gZyD7gtDdvuu3+eolM7/QRgOeTIlNlygeawm4hlFYcuksYqwqBE5wwW5quACChvjv SDGimgYqCsHT7EYxs3ptzjxnqhpT4fAuHmqK4m3yI2dnZJMo5ZIMZQEfOIV6pLB9KM36 fJyyQhl0KKtegCVyWYNb1LpLsH45E/nw4zDeKd88CQ49j33uZL8QjgGjAZUdTelZaEa1 gx3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=H1HfCJQ0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 9-v6si3855399qtn.162.2018.06.20.19.18.33 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 20 Jun 2018 19:18:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=H1HfCJQ0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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]:52604 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVpBA-0005dX-Us for patch@linaro.org; Wed, 20 Jun 2018 22:18:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVooO-0004oz-8g for qemu-devel@nongnu.org; Wed, 20 Jun 2018 21:55:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVooK-0003Q9-Ux for qemu-devel@nongnu.org; Wed, 20 Jun 2018 21:55:00 -0400 Received: from mail-pl0-x235.google.com ([2607:f8b0:400e:c01::235]:38078) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fVooK-0003PO-PL for qemu-devel@nongnu.org; Wed, 20 Jun 2018 21:54:56 -0400 Received: by mail-pl0-x235.google.com with SMTP id d10-v6so757826plo.5 for ; Wed, 20 Jun 2018 18:54:56 -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; bh=LHWFtiyOKa+HrAxinQWN0q0OwYqueH9VPd2ad8t6RQs=; b=H1HfCJQ0nxatWBoXR0gS5E1IEyiaFdmQB2rJ61wgdCLtLpRrOHH0ZV7svJ+lLzTvzA Jyk8ziuFE6wscp0t5qgH4/nl7EDP6orGh3QDttx8jdYD7rZB0w7r6nh0S2bAuGm2yPb8 O+0Y7ElA1AgNCJ96irnVsfzPV5meiET+uNL0Q= 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; bh=LHWFtiyOKa+HrAxinQWN0q0OwYqueH9VPd2ad8t6RQs=; b=sTYoExAkkhDxJj30tyiqaLw/g/f7eLFVUWtx3WLQ7mMw2F48oVNaSewe9D+sQneAGa hupDNSYTBAyIymWEQe7gFswx/lEQRmLs6SANFOynzohlk7NkwwJffDG7KrUaLm/I1E2V putLOOS667LVwytPJGoJxLuj4QGjU+nFy4GpsYLZ5Fh+nyEmjnOO1+lJebbaCPHKTk9X ACHQTcgK1HBY82x8hyOzVkuTE2+nBcRmibJ/TJe0KgCyEvF3KC3FsL1llPD5tqP11zVS N2GpzgSwR/N1Q9RcQWooFoto1rN9sy8mrWFsIo96mLgvHCCF50ENkJ8HKgE6MiefdeXR Hq4w== X-Gm-Message-State: APt69E24xNpyS/By82YxuCs4fBKMkQQzaxV3NQYwxhkYkyRsj3swu9ee wd63RXfc5zpgusT9QV+aJ/kMoKHnM3U= X-Received: by 2002:a17:902:b582:: with SMTP id a2-v6mr26632985pls.335.1529546095408; Wed, 20 Jun 2018 18:54:55 -0700 (PDT) Received: from cloudburst.twiddle.net (mta-98-147-121-51.hawaii.rr.com. [98.147.121.51]) by smtp.gmail.com with ESMTPSA id a27-v6sm6187946pfc.18.2018.06.20.18.54.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Jun 2018 18:54:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 20 Jun 2018 15:53:50 -1000 Message-Id: <20180621015359.12018-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180621015359.12018-1-richard.henderson@linaro.org> References: <20180621015359.12018-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::235 Subject: [Qemu-devel] [PATCH v5 26/35] target/arm: Implement SVE floating-point unary operations 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: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/arm/helper-sve.h | 14 ++++++++++++++ target/arm/sve_helper.c | 8 ++++++++ target/arm/translate-sve.c | 26 ++++++++++++++++++++++++++ target/arm/sve.decode | 4 ++++ 4 files changed, 52 insertions(+) -- 2.17.1 Reviewed-by: Peter Maydell diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h index 36168c5bb2..891346a5ac 100644 --- a/target/arm/helper-sve.h +++ b/target/arm/helper-sve.h @@ -999,6 +999,20 @@ DEF_HELPER_FLAGS_5(sve_frintx_s, TCG_CALL_NO_RWG, DEF_HELPER_FLAGS_5(sve_frintx_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_5(sve_frecpx_h, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_5(sve_frecpx_s, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_5(sve_frecpx_d, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) + +DEF_HELPER_FLAGS_5(sve_fsqrt_h, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_5(sve_fsqrt_s, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_5(sve_fsqrt_d, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) + DEF_HELPER_FLAGS_5(sve_scvt_hh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_5(sve_scvt_sh, TCG_CALL_NO_RWG, diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index 3b7a2f58c1..5309cf0866 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -3270,6 +3270,14 @@ DO_ZPZ_FP(sve_frintx_h, uint16_t, H1_2, float16_round_to_int) DO_ZPZ_FP(sve_frintx_s, uint32_t, H1_4, float32_round_to_int) DO_ZPZ_FP(sve_frintx_d, uint64_t, , float64_round_to_int) +DO_ZPZ_FP(sve_frecpx_h, uint16_t, H1_2, helper_frecpx_f16) +DO_ZPZ_FP(sve_frecpx_s, uint32_t, H1_4, helper_frecpx_f32) +DO_ZPZ_FP(sve_frecpx_d, uint64_t, , helper_frecpx_f64) + +DO_ZPZ_FP(sve_fsqrt_h, uint16_t, H1_2, float16_sqrt) +DO_ZPZ_FP(sve_fsqrt_s, uint32_t, H1_4, float32_sqrt) +DO_ZPZ_FP(sve_fsqrt_d, uint64_t, , float64_sqrt) + DO_ZPZ_FP(sve_scvt_hh, uint16_t, H1_2, int16_to_float16) DO_ZPZ_FP(sve_scvt_sh, uint32_t, H1_4, int32_to_float16) DO_ZPZ_FP(sve_scvt_ss, uint32_t, H1_4, int32_to_float32) diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 15e4f2888b..308c04de89 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -4117,6 +4117,32 @@ static bool trans_FRINTA(DisasContext *s, arg_rpr_esz *a, uint32_t insn) return do_frint_mode(s, a, float_round_ties_away); } +static bool trans_FRECPX(DisasContext *s, arg_rpr_esz *a, uint32_t insn) +{ + static gen_helper_gvec_3_ptr * const fns[3] = { + gen_helper_sve_frecpx_h, + gen_helper_sve_frecpx_s, + gen_helper_sve_frecpx_d + }; + if (a->esz == 0) { + return false; + } + return do_zpz_ptr(s, a->rd, a->rn, a->pg, a->esz == MO_16, fns[a->esz - 1]); +} + +static bool trans_FSQRT(DisasContext *s, arg_rpr_esz *a, uint32_t insn) +{ + static gen_helper_gvec_3_ptr * const fns[3] = { + gen_helper_sve_fsqrt_h, + gen_helper_sve_fsqrt_s, + gen_helper_sve_fsqrt_d + }; + if (a->esz == 0) { + return false; + } + return do_zpz_ptr(s, a->rd, a->rn, a->pg, a->esz == MO_16, fns[a->esz - 1]); +} + static bool trans_SCVTF_hh(DisasContext *s, arg_rpr_esz *a, uint32_t insn) { return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_scvt_hh); diff --git a/target/arm/sve.decode b/target/arm/sve.decode index eeab3d485f..94d7b157b4 100644 --- a/target/arm/sve.decode +++ b/target/arm/sve.decode @@ -849,6 +849,10 @@ FRINTA 01100101 .. 000 100 101 ... ..... ..... @rd_pg_rn FRINTX 01100101 .. 000 110 101 ... ..... ..... @rd_pg_rn FRINTI 01100101 .. 000 111 101 ... ..... ..... @rd_pg_rn +# SVE floating-point unary operations +FRECPX 01100101 .. 001 100 101 ... ..... ..... @rd_pg_rn +FSQRT 01100101 .. 001 101 101 ... ..... ..... @rd_pg_rn + # SVE integer convert to floating-point SCVTF_hh 01100101 01 010 01 0 101 ... ..... ..... @rd_pg_rn_e0 SCVTF_sh 01100101 01 010 10 0 101 ... ..... ..... @rd_pg_rn_e0