From patchwork Fri Apr 30 20:25:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 429913 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp816583jao; Fri, 30 Apr 2021 14:39:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMz0tcMw6TVZksPK9LicoLMnwUA4e0s0jUUFAh2eakg1zGmVeOWnfByaqpvEWHf+85ip68 X-Received: by 2002:a6b:5918:: with SMTP id n24mr5426553iob.93.1619818788100; Fri, 30 Apr 2021 14:39:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619818788; cv=none; d=google.com; s=arc-20160816; b=UnYvp/h32bxs8T94j2SpjaHbtb91wabBmAQ0aVQK9qG9ezkPzfNYcxJZvssLZnWtSZ 1zk20eLUp1JZ7rw6uK1eB/DPGk9PdQWaAmZ7QQj/kBouRfhRlBb/F5ZJbA5gj2R6yPbu IMRYZkLYnr72T/SUir2Mz7pwuMPTCOTEiU9URY+eq89hBSYvDhq41neWlNBr1Bvc/6IR YWMbngTntl/Q/DT5td8/CnLX54rff3cLZl1Cyqf6Tlr8Ewwlbipi0965HSW2vS6FJg4B ZGQU5+RrKsEjzoN4B1GPLaB1d5l+dEc121OAUbROtyejsOKjYyiNfZmyg79uWbU9NeOm jmEw== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Ux7AjIofl30XpVNkB5THnEw/ARFu5PvhGsc0ueXu0yU=; b=PHRKmBXHS+/L6wT6OrcWfXOaWNLsVR+KJz17sC91v1Vi+L7IBFipygt59YkLPV0GUd hoMKMmI+L8krsMV8iINrLgCZ7gz9zr7tESIQy6k5Bt82wQ3Yr70GJOXvqd+988h35toM 7+8kGcBShAmAKcnCbYWoMCV0geaIg3Eq9SEybyyE5qdCAPkbZCYBGbU9nHbDDHj3pyjo 96wUh1msnyx3P2GbUEtXb+dN1e+A1Rd5afgn8425CC+umdMkvCWXcqeJpY3LOvMz92FV PnEeiqE/YN/Q+HpsL/VUOHLvteybHvcRQakCqbLiMqydbjbcAL+R05PVAzumUeCA9vR6 euKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="einjk/rK"; 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=pass (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 m6si4139310jav.15.2021.04.30.14.39.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Apr 2021 14:39:48 -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=pass header.i=@linaro.org header.s=google header.b="einjk/rK"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcarT-0002vp-Gg for patch@linaro.org; Fri, 30 Apr 2021 17:39:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcZmy-00058S-0t for qemu-devel@nongnu.org; Fri, 30 Apr 2021 16:31:04 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:46013) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lcZlx-0007nB-I0 for qemu-devel@nongnu.org; Fri, 30 Apr 2021 16:31:01 -0400 Received: by mail-pl1-x634.google.com with SMTP id p17so11327221plf.12 for ; Fri, 30 Apr 2021 13:29:53 -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=Ux7AjIofl30XpVNkB5THnEw/ARFu5PvhGsc0ueXu0yU=; b=einjk/rKQ//C6rXCR9DuqbowPFXRvBt/PkA9pqn85xTQOe3BG1ohM9ltLqw0gGRotM Wksw5+kTJFM4y+tca6vgpSymeX6gyZwSGu2qaUE2HoGTht8UGLqGecCoCbGejzlpIcTp 5Eb9pG008ZR6D8DafXssfYzQQKs2g23rzSeUkVuvYaLJuSgHRlXtImIn8m+xC/4BIH4V VKEn965apV1/YrfaCN8vg3D68WZPzvNZkN34c8Zd/AR4GSPhGKqbJfribeNz5mpbZCNw xCCvsUf1juuDtJmjfbubd4gu0VoM7mxwuO2EwHlAKQP32W9eyJK8uore53RGlWKUj8mA N5mA== 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=Ux7AjIofl30XpVNkB5THnEw/ARFu5PvhGsc0ueXu0yU=; b=bqDQq7wwxT1Zn0g5pvlVcdSV/1mmNCZYAGaCfV1cilf2OvG7fL1lDbNHIiiPcRYxeX RnChyDDrlYg78ER6P0CWi4/0wISQM+NGxG2SWzizHzMGAPy2EJchynPTWwwnkLFR71+X JmXB5RaC095L/TlaCJe77DVNUHfpk3v1HefnAVbCqPK5VCsjyeTD81g4mygSDQIMl8il 2+iF1XFr5yHjfYV47/bC7sj0Bsavw9volPrv8+0CXlyR4AG10QZVaJbl6+awjmmK+WSQ dT+MICOHPx/+8SXxlzn2RTiocwcLPN01X4JEXqui/UuN+twValgwqEh7L7QcT6H+jt7n 5Xcg== X-Gm-Message-State: AOAM5334jDyouKydpHl/ujiCjfJZrIPx+HSregsB+AFD59PT4ajfdyZ4 42/hGWKA+OYKsgIy+SkkWw/MWoxiohiOoA== X-Received: by 2002:a17:902:82c3:b029:ed:64b9:6119 with SMTP id u3-20020a17090282c3b02900ed64b96119mr7104892plz.20.1619814592305; Fri, 30 Apr 2021 13:29:52 -0700 (PDT) Received: from localhost.localdomain ([71.212.144.24]) by smtp.gmail.com with ESMTPSA id q23sm3788781pgt.42.2021.04.30.13.29.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Apr 2021 13:29:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v6 66/82] target/arm: Implement SVE2 FCVTLT Date: Fri, 30 Apr 2021 13:25:54 -0700 Message-Id: <20210430202610.1136687-67-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210430202610.1136687-1-richard.henderson@linaro.org> References: <20210430202610.1136687-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: qemu-arm@nongnu.org, Stephen Long Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Stephen Long Signed-off-by: Stephen Long Message-Id: <20200428174332.17162-3-steplong@quicinc.com> Signed-off-by: Richard Henderson --- target/arm/helper-sve.h | 5 +++++ target/arm/sve.decode | 2 ++ target/arm/sve_helper.c | 23 +++++++++++++++++++++++ target/arm/translate-sve.c | 16 ++++++++++++++++ 4 files changed, 46 insertions(+) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h index d6b064bdc9..30b6dc49c8 100644 --- a/target/arm/helper-sve.h +++ b/target/arm/helper-sve.h @@ -2708,3 +2708,8 @@ DEF_HELPER_FLAGS_5(sve2_fcvtnt_sh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_5(sve2_fcvtnt_ds, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) + +DEF_HELPER_FLAGS_5(sve2_fcvtlt_hs, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_5(sve2_fcvtlt_sd, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) diff --git a/target/arm/sve.decode b/target/arm/sve.decode index afc53639ac..fb998f5f34 100644 --- a/target/arm/sve.decode +++ b/target/arm/sve.decode @@ -1534,4 +1534,6 @@ RAX1 01000101 00 1 ..... 11110 1 ..... ..... @rd_rn_rm_e0 ### SVE2 floating-point convert precision odd elements FCVTNT_sh 01100100 10 0010 00 101 ... ..... ..... @rd_pg_rn_e0 +FCVTLT_hs 01100100 10 0010 01 101 ... ..... ..... @rd_pg_rn_e0 FCVTNT_ds 01100100 11 0010 10 101 ... ..... ..... @rd_pg_rn_e0 +FCVTLT_sd 01100100 11 0010 11 101 ... ..... ..... @rd_pg_rn_e0 diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index 6164ae17cc..2684f40a62 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -7468,3 +7468,26 @@ void HELPER(NAME)(void *vd, void *vn, void *vg, void *status, uint32_t desc) \ DO_FCVTNT(sve2_fcvtnt_sh, uint32_t, uint16_t, H1_4, H1_2, sve_f32_to_f16) DO_FCVTNT(sve2_fcvtnt_ds, uint64_t, uint32_t, H1_4, H1_2, float64_to_float32) + +#define DO_FCVTLT(NAME, TYPEW, TYPEN, HW, HN, OP) \ +void HELPER(NAME)(void *vd, void *vn, void *vg, void *status, uint32_t desc) \ +{ \ + intptr_t i = simd_oprsz(desc); \ + uint64_t *g = vg; \ + do { \ + uint64_t pg = g[(i - 1) >> 6]; \ + do { \ + i -= sizeof(TYPEW); \ + if (likely((pg >> (i & 63)) & 1)) { \ + TYPEN nn = *(TYPEN *)(vn + HN(i + sizeof(TYPEN))); \ + *(TYPEW *)(vd + HW(i)) = OP(nn, status); \ + } \ + } while (i & 63); \ + } while (i != 0); \ +} + +DO_FCVTLT(sve2_fcvtlt_hs, uint32_t, uint16_t, H1_4, H1_2, sve_f16_to_f32) +DO_FCVTLT(sve2_fcvtlt_sd, uint64_t, uint32_t, H1_4, H1_2, float32_to_float64) + +#undef DO_FCVTLT +#undef DO_FCVTNT diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 537449cbfa..f5bf122204 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -8186,3 +8186,19 @@ static bool trans_FCVTNT_ds(DisasContext *s, arg_rpr_esz *a) } return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve2_fcvtnt_ds); } + +static bool trans_FCVTLT_hs(DisasContext *s, arg_rpr_esz *a) +{ + if (!dc_isar_feature(aa64_sve2, s)) { + return false; + } + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve2_fcvtlt_hs); +} + +static bool trans_FCVTLT_sd(DisasContext *s, arg_rpr_esz *a) +{ + if (!dc_isar_feature(aa64_sve2, s)) { + return false; + } + return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve2_fcvtlt_sd); +}