From patchwork Thu Jun 18 04:26:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 191064 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp1083134ilo; Wed, 17 Jun 2020 22:13:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwa7EZNx4Y2/4d/rdnR6tKAWAiP12njgIZFmyj4+D+cDyLBHB/Xvgv6GjuN4NIGwUmcAlGp X-Received: by 2002:a25:6403:: with SMTP id y3mr3889983ybb.229.1592457192885; Wed, 17 Jun 2020 22:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592457192; cv=none; d=google.com; s=arc-20160816; b=bcGIxDsKZjZQs1vHeR3bOA4+31QnXlwYqS9ixM8mYOxWP0y24nUcAaH+1lUlxHSgZc ApbwxrH4ziHyh375h4uXNnkc3DCLKkxJtWqLwUE2FYM7n7Lg62h3k6hZyx7nZHsspMMo tFFzInUjoO617dNJbWu7lTD1xRDIJP/EAvzZ9laZRzTtAtR83S4D/DGA94P+BytyBp6z X+lt9XPme1hSvwcfD9hAPQylUKoT26wDx4h4b/9Eve3g4PuJg0yNUO5C7o57Z3EG/Ckb K+TS9Jv9m4Xl83TqNJEuQWDI+A3pq/bd0XLtye2LusGf6xjhFUSv81wy4Y+O4RBvA7iv +3EA== 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=Be7FerxOL0YxBcJc1swDCG2s6mkIpSU34n7zP+l5oYo=; b=Ma4EFFf+tuqxBuLwkaVfgUQ+RwRgf9V2yu1om/Xn/8ZNtQKS7oFKBdmOShQutjJusf Tj52cwm6CYcXmrCkCJX5YKepqAyl4wYlpKLpEURHGl4cZYE/5elK9ULysu1b1BXjiFGu /3VDtpIx2IzbbtkIpcOnqE8DP5BE4zE07KjMTKIPnPK0M2mkob4yo4+NtMizz2MZwMF9 kl3zhqGVFayraC7YvxPT0hLmxaRxvHyIUBA65i6+ejDbz4/BX5ugNpg76gNss/aKMM0k sOUYO04AEKAY0VjGrzP0RKZQm/KgGn5cA7mIEZivT2Mu7DJhVOkIosMoUbm6/hrj3a7M Q/Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=zfezjfIz; 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 x11si1412568ybs.218.2020.06.17.22.13.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 22:13:12 -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=zfezjfIz; 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]:48684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlmrQ-0008Qt-Aa for patch@linaro.org; Thu, 18 Jun 2020 01:13:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlmEw-00072M-8L for qemu-devel@nongnu.org; Thu, 18 Jun 2020 00:33:26 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:46336) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlmEu-0003ek-M6 for qemu-devel@nongnu.org; Thu, 18 Jun 2020 00:33:25 -0400 Received: by mail-pf1-x42b.google.com with SMTP id b16so2177998pfi.13 for ; Wed, 17 Jun 2020 21:33:24 -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=Be7FerxOL0YxBcJc1swDCG2s6mkIpSU34n7zP+l5oYo=; b=zfezjfIzp2CV2e6Dl4Evm1/u4UaXhKU4upm2D5bp616W76ZV2D/Q1S08Jl3eYcwsu6 GIuBHxOhVwckS+dIy5PUsissClKDKPl8gtjXIpWtShrfHnUsLqffvSljWJWXHslB1LXz NpqyuNsE1EyUr+SgGU5Jqq5w3GL/VMgA4as2rrtSq/EY26cAkfIBthu+acsRjtRv8ZYL ulczrc/QXP0ExT0G6TciDE6jXg0vr7vPG+Awc+OmcydKUFDuKjZDOsXfND6AGS6Rbyb6 24EIbPH/oRalb97duzbnVLpnGpgiHLvRp/GAOd3qW2PU/peEjIPX2t0wU4cY8Xqf4tA8 NSYA== 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=Be7FerxOL0YxBcJc1swDCG2s6mkIpSU34n7zP+l5oYo=; b=sC0+S+hP96xEDFONjmNH/9+IwYPCZkEHPgpZkuAMXnOFhAP4njb9coUM0CzcSrAdSV EQtpcEbj+Uosh6AsJH93ePq+5QtJfUkY6Oe09DnB5KcRnVrxU0d8N7XYtQ2bfpgxx41j AKsHeU4S5HXOb5PjfTo+e9F/yypC9AnRByd/eKb0eOoqtYIVU0Bfkz6Qc3sP0B/XPEX8 vlkF+KrXUHQ9ZjP2UIh7DmsCeQUYNrhVM3D5edfd0H5YdDW7hAmFl+rEgP3rSkWwsnst zNc/y9OGuF8nEwP/itQ4RuelLvPGpQNT5yuDAg2TQJxCpr9GtSvMWCeGNdXUZGME/4dd TFDQ== X-Gm-Message-State: AOAM533m0muCoFKxj41mVa4AiMSEhmmqL44IV2Hq6VOaTyIXrwq+IJC8 xirtb7lLmNLSaBzTgnOnW4dYECfsKbc= X-Received: by 2002:a05:6a00:1592:: with SMTP id u18mr1968821pfk.26.1592454802978; Wed, 17 Jun 2020 21:33:22 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id q22sm1288212pfg.192.2020.06.17.21.33.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 21:33:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 090/100] target/arm: Implement SVE2 FCVTNT Date: Wed, 17 Jun 2020 21:26:34 -0700 Message-Id: <20200618042644.1685561-91-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200618042644.1685561-1-richard.henderson@linaro.org> References: <20200618042644.1685561-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN 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, steplong@quicinc.com 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 a3d49506d0..252344bda6 100644 --- a/target/arm/helper-sve.h +++ b/target/arm/helper-sve.h @@ -2246,3 +2246,8 @@ DEF_HELPER_FLAGS_5(sve2_sqrdcmlah_idx_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_5(sve2_sqrdcmlah_idx_s, TCG_CALL_NO_RWG, void, ptr, 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 609ecce520..9ba4bb476e 100644 --- a/target/arm/sve.decode +++ b/target/arm/sve.decode @@ -1573,3 +1573,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 6e9e43a1f9..7a5b0d37c5 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -7174,3 +7174,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 6b9d715c2d..3c145857db 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -7780,3 +7780,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); +}