From patchwork Fri Apr 16 21:02:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 422646 Delivered-To: patch@linaro.org Received: by 2002:a02:6a6f:0:0:0:0:0 with SMTP id m47csp743754jaf; Fri, 16 Apr 2021 14:50:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4PrJawaUnggrzvfyeYjsj+gmZJm7MtNeG7dO5ez9HeuNnvFKZF7gK6VwECKb5P1MwoH92 X-Received: by 2002:a25:c08b:: with SMTP id c133mr1778480ybf.67.1618609859234; Fri, 16 Apr 2021 14:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618609859; cv=none; d=google.com; s=arc-20160816; b=cldP+siCNitriXymz1eHY+CrRM7GuIQotkpuqKcFtPuvQ5nsi7vwcjAA4rkneROq09 viLEXL6SqAjAfhgKlI1RDhETkGlp/l4pmPbBVutVaR38PHJBmChtJDQ/AHj95UItA4Va FBBRl2xnEwYC98vdaw0l0gxDugZUVlL3wvwX7TnuEckwh9k/glb7hQ5BVUK1s2iaqRhH 60eOU1dDHzrQ5od6Pqt8bzlQtO8HnupIJrX00ibBDwBlTF5oTR9rCxy/bLl6WRqd1TOP oyVazuguQEG1NicCakOhNxuod6O9IDTMSb8mGjMRqU1fgAg9DaNzR1fOZ+7CNtXq3Qbw w2DQ== 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=Qi7ydIxfQkB8AeeB+foEIc9co/N1EA+zUALSSBLM1Ow=; b=NjabaxcTGrqivnaoaynokLwB5NpmHRmmA1JakC8C4cn8XUpYgKx4xwl0m47YqxoBkb z0lQS3e6JGvm2mxDWuxcYevNdSPv1sqfI7f/Qr+sLwcZbxTUbK2Itm7BOPQgNvGPK+W4 oZit9v7JmZ+26zL3pgH6scn7T6vSp4LsKXWzpgv8/ulIRmDnXbsNFeb785228bbtd/p6 Vv2Qmhi/s1dLbQdRwiMqZ6RMDwES1TvvcQCFCWhECXh5VlLa6otxEskPfPy54tarfkkz y0rBWXz+c+iGch/1t0DTU9oFsHyMktVEaFUCtw3dy0IdOJ9tJI9eedmB2M1Gy8ewuawB Fp7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Bw1Eqvjv; 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 t5si6939126ybo.273.2021.04.16.14.50.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Apr 2021 14:50:59 -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=Bw1Eqvjv; 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]:40688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXWMc-0004fO-Kr for patch@linaro.org; Fri, 16 Apr 2021 17:50:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXVdp-0006ZE-PW for qemu-devel@nongnu.org; Fri, 16 Apr 2021 17:04:41 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:46909) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lXVdV-0001kv-L2 for qemu-devel@nongnu.org; Fri, 16 Apr 2021 17:04:41 -0400 Received: by mail-pl1-x630.google.com with SMTP id m18so12423922plc.13 for ; Fri, 16 Apr 2021 14:04:16 -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=Qi7ydIxfQkB8AeeB+foEIc9co/N1EA+zUALSSBLM1Ow=; b=Bw1EqvjvPJ0YtYg/G0keZJoxkkzLy+sSCmtZ+tv+NHKVw5af/oCY5L3AmiL+ELi2Vc TUREsVlMlifP+K8WxmhPN4cntub79ulGPXULNmsV06RdV31kGICU+UcIxc7S+7ZxP6xv YQNe0CS3DNdrHgUkC0AIgBHCO7A4PSUrTy2BeWuBe78I+kjNY3GuP9p8I5YTKEWD8Kcy FFiQ2J3iARWH435FHCuy0q+9ATGBOdtYItdcsqApQiD8gWr/J047ZB26QdGNSlueLyYi EGseMT3w69boMgulLmWtsCKmY+ru7sw1U7JH6CEHXJGez/OcSx8TqBjAq6hUxUd7u7m1 hwyQ== 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=Qi7ydIxfQkB8AeeB+foEIc9co/N1EA+zUALSSBLM1Ow=; b=lGIms2+8a5RI6R4niYZblLzfIDhKS8QfdLPfRU4zs8GsbiVgMNTQf8qHBKVJwoCM/R PzhKgncx5t5DQOVjRhQHtzwcE6y7Ra/2rGSijX+sKwWPTcQEnuug9w5Rbr8ifARXpqJE AGNJde3YYIcuBynBzpnAxgzCBuw+zY/vj07TzkF5dG1Wa/gpTZ6Cq8beEftojjqtYGBd e5xD5NUQivo+7ZzI1Wv+iLCmCSnHVxByyQaGbWu18MkS0zT9nxw1btvCfALvnSRyaOmu oWrfS6oqgpY583fOzOk3FlfGbNZaM3vZ63ewoB1ni4XrzACv8xd7ZvounPY70Q2J79EL 3ukw== X-Gm-Message-State: AOAM533ESotFW5GVorbnGUycEb3uG5JyB/aUcvqSlINZrcD2j0sn4kP1 PzxdsN0yhfb0inxKgwkLViD6Cj8wz0z5Ng== X-Received: by 2002:a17:90b:4a52:: with SMTP id lb18mr11556556pjb.1.1618607055985; Fri, 16 Apr 2021 14:04:15 -0700 (PDT) Received: from localhost.localdomain ([71.212.131.83]) by smtp.gmail.com with ESMTPSA id m9sm5766734pgt.65.2021.04.16.14.04.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 14:04:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 65/81] target/arm: Implement SVE2 FCVTNT Date: Fri, 16 Apr 2021 14:02:24 -0700 Message-Id: <20210416210240.1591291-66-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210416210240.1591291-1-richard.henderson@linaro.org> References: <20210416210240.1591291-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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=unavailable 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-2-steplong@quicinc.com> Signed-off-by: Richard Henderson --- target/arm/helper-sve.h | 5 +++++ target/arm/sve.decode | 4 ++++ target/arm/sve_helper.c | 20 ++++++++++++++++++++ target/arm/translate-sve.c | 16 ++++++++++++++++ 4 files changed, 45 insertions(+) -- 2.25.1 diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h index 41c08a963b..d6b064bdc9 100644 --- a/target/arm/helper-sve.h +++ b/target/arm/helper-sve.h @@ -2703,3 +2703,8 @@ DEF_HELPER_FLAGS_4(sve2_sqdmull_idx_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve2_sqdmull_idx_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) + +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) diff --git a/target/arm/sve.decode b/target/arm/sve.decode index 38aaf1b37e..afc53639ac 100644 --- a/target/arm/sve.decode +++ b/target/arm/sve.decode @@ -1531,3 +1531,7 @@ SM4E 01000101 00 10001 1 11100 0 ..... ..... @rdn_rm_e0 # SVE2 crypto constructive binary operations SM4EKEY 01000101 00 1 ..... 11110 0 ..... ..... @rd_rn_rm_e0 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 +FCVTNT_ds 01100100 11 0010 10 101 ... ..... ..... @rd_pg_rn_e0 diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index 8dc04441aa..6164ae17cc 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -7448,3 +7448,23 @@ void HELPER(fmmla_d)(void *vd, void *vn, void *vm, void *va, d[3] = float64_add(a[3], float64_add(p0, p1, status), status); } } + +#define DO_FCVTNT(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)) { \ + TYPEW nn = *(TYPEW *)(vn + HW(i)); \ + *(TYPEN *)(vd + HN(i + sizeof(TYPEN))) = OP(nn, status); \ + } \ + } while (i & 63); \ + } while (i != 0); \ +} + +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) diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 63e79fafe5..df52736e3b 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -8170,3 +8170,19 @@ static bool trans_RAX1(DisasContext *s, arg_rrr_esz *a) } return true; } + +static bool trans_FCVTNT_sh(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_fcvtnt_sh); +} + +static bool trans_FCVTNT_ds(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_fcvtnt_ds); +}