From patchwork Fri Apr 16 21:02:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 422665 Delivered-To: patch@linaro.org Received: by 2002:a02:6a6f:0:0:0:0:0 with SMTP id m47csp754190jaf; Fri, 16 Apr 2021 15:09:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCyjSHpHqtWHhadqOQ+KBjKFI3MblB3giD3SLpZ+2I0SonrhQaj59iMaHiTH+TJXTYwle6 X-Received: by 2002:a67:790c:: with SMTP id u12mr9173857vsc.19.1618610988151; Fri, 16 Apr 2021 15:09:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618610988; cv=none; d=google.com; s=arc-20160816; b=TJfkBjZwq0m+dAxRkR3CS0dE14crOqbTmlwdbX4zy6nPlRlVfB0/sV6z4jMo7VHMDs /d1bS/E5FTYHh5Hvj2E3w0TOGU6GMZrZde89i/h18gKyLg3jphxokSp3h0leB4abWodU yXtSKwXYgNzeGPgV6PSc1eY31CJp0HRfLJzN2mdwv1L3aFEV+yGOcATsQPrinO6NWxr/ f15V0h7upJIYPJKOOyMX4kPNhtScUMcv1rXjDf3545RKSq+sZLHiv+uILgq4webJEqya o0YT8wgj8dOp1Q5zS99fGhRrzwIyNnxD7kAtPmWTWJpKBCTQSTy5uyi0ktXDuF9HJEv2 11Gw== 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=TefYznISTQm0pzCtVV51Stsil3QGM04wAsqxqTtOHyw=; b=quya9WCB1G/IEuu7hISNLH86XJ9DYcBzRSBMfMZK7ejrvWMZz2c/XhajV7NIZyvhVJ 5Qb876w8w1R2m+W0TyY4kNgfsi2yTSet77wXJen8QriblE0tefwJP6orhC89lrkRdiPt OoDS0ouqHrB6CegoxCNijRjWp5C0/CA4kylYAfwkPRDiIe0HFHOX3SVo0TwiIR3puKWn /fnW2OlEQ8k0T1nyigoEaO4Z+3YNPGd4RzJ38qx9gbAQP1h/fX0lCHYwlANO+nsOUoMh 0dy8VX+Vvu1X25R5H1Z9jUV2lMaLsYbt5X5Gqn9OrcpjRPETbDOMyjkAOfvb6nk2bGAt GZzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eG4pzepR; 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 k22si648037vkp.15.2021.04.16.15.09.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Apr 2021 15:09: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=eG4pzepR; 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]:43898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXWep-0004Tk-Gt for patch@linaro.org; Fri, 16 Apr 2021 18:09:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXVdi-0006Fv-Ha for qemu-devel@nongnu.org; Fri, 16 Apr 2021 17:04:34 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]:43543) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lXVdV-0001lj-FN for qemu-devel@nongnu.org; Fri, 16 Apr 2021 17:04:34 -0400 Received: by mail-pl1-x62f.google.com with SMTP id u15so6084764plf.10 for ; Fri, 16 Apr 2021 14:04:17 -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=TefYznISTQm0pzCtVV51Stsil3QGM04wAsqxqTtOHyw=; b=eG4pzepRDHVzSW5X9CaoqwAj58daoondH8PQJAwJaGYMskbG6QR7x3fL3LCSC5BXBJ f8kGzQJQWA6i+mauQLcvVrt16AKfIFl/+SZCymaWuJ4S8RL6ZQp9oOv1p1dlgHQOUZ5G 3KNEHFej7yUg8unc6YO4EMhGHVDzfLo+oN7htcSRenzudH6xP6kZEVAPRafCnSlMQlal VbBV36nbggRoJ7FdERd9ZV73tX+hcCnyaJzB5zl5wj+lfjtPw+Hf68WlCKiG+rxE1kdp fgmq674OI85+C1Q72ntN+BW8o9JHh4k0sWzanVoT7ucCy23FPUBaHKHJDeWAS256AO8s yJ3A== 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=TefYznISTQm0pzCtVV51Stsil3QGM04wAsqxqTtOHyw=; b=nTdLbXAik5MDOBHg8XFbBiUszaX5dg3/8T5/v4L337vtnb4sqR/yC+y78LUREMBUFG 62BW1PpbOyqjDePr7T/A6pnJD+2vq6gsrjsl1pwd4GSU2RolBxt73KEw+AzBZ6IvgB6X 6ngxr/uZn1PrqSoPm/EatfMPI9l9yZm2LfyblMlU/vgGw4CORRejydn3L3nRF9WZuNnF oa45IAP03kZS309C23cPeKBWB4CM8lJyv5R3wmotYh2nUnv1trY2mur/zaJN+l3Oq17z U99zUtzQjLTOIsljc0Y2DZoLRhbQniyFkdQ039MUWGMKyG8UStgW/0BuLDgjK8y/u/6t CtZQ== X-Gm-Message-State: AOAM5319QQIAKgvrT0SzqW5s9xCJL8XLSAPH5DlkoPW/nHcFgI3SNc98 zPuTyNZypZ0hMoKyLrtTV2d7XzqlyHcBdw== X-Received: by 2002:a17:90a:288:: with SMTP id w8mr11793103pja.163.1618607057008; Fri, 16 Apr 2021 14:04:17 -0700 (PDT) Received: from localhost.localdomain ([71.212.131.83]) by smtp.gmail.com with ESMTPSA id m9sm5766734pgt.65.2021.04.16.14.04.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 14:04:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 66/81] target/arm: Implement SVE2 FCVTLT Date: Fri, 16 Apr 2021 14:02:25 -0700 Message-Id: <20210416210240.1591291-67-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::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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 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 df52736e3b..9cad93cb98 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); +}