From patchwork Fri Apr 30 20:25:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 429898 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp805191jao; Fri, 30 Apr 2021 14:21:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmgAq6FmMBogmY/vwMrPtdM4J9qnRNiZR1Qq+TNu2mXbDY1J0XdMU6PPCnZZK4tzhkogqi X-Received: by 2002:a05:6e02:de3:: with SMTP id m3mr5777848ilj.93.1619817712763; Fri, 30 Apr 2021 14:21:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619817712; cv=none; d=google.com; s=arc-20160816; b=u5dLLSqnWX99dxk4k0gCyacyCy32cvTPVf1HwYxk7/sTjkwf9vIYBqhRF2HtsHHYrs MZXRZLy91733dQXisNEj/1mCDsqOCrNW1kMc+HjeZTmnZjvjno5Ult0rsxffMaCpWTxb XMtd8DucBYGJRJv/FAO4CG5JRckh38IYwhi+zmEOejERBafWY7DAkkUWB6Bp1P9z5z9A anAW6Of3dyNGLbXZ5S5QQejfhw+GrhNiUYMdVD2QGlb/PyBVUmVREHtesJrSCDuWvlT1 pRc4dh/Utzymj7rEXUDcWbFioGuzMQ13Z5LhquasExHDc/3hgYbwR9+jf/C1VWB/+1ZU ftuA== 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=B/7aU0EzUxhV/kKb8WHkerqUukEIGKD6u5NHmPGNPZk=; b=Otia4LVlsokYKBTV1m8yIxPDWkL5duIs8YT7xi3FQYFkduO7VoTIEGsYltdMSwVaFG nw1aczpPYgv9laoIV+QUsXV+H9T389NU/H2pKGI6RO3089RhUpvtE0Dlcx1YTkmn05Y7 xcMe7vNRE0jpzoKJ/H3l8dHlxncgvuWCTjcF6nGC5msmXkUfJlTvHOYdEqCmQIiAocl/ 899Ru8KgLJ+AxfBiRNILB6sYSmZ9VNYAaCo8P00eoONZS9wXGMfX6F0lxCCB6BVjbIKe 2T5nj8/ujpUmXsdm+3lb+Z3sadH0jcin69i+53uqUmG2xlcKvllgnLhkE9t2y19JjPb4 kaUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xHiPV3FA; 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 n1si3086559ili.3.2021.04.30.14.21.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Apr 2021 14:21:52 -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=xHiPV3FA; 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]:43194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcaa8-0007gp-5v for patch@linaro.org; Fri, 30 Apr 2021 17:21:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcZn5-0005DX-Fz for qemu-devel@nongnu.org; Fri, 30 Apr 2021 16:31:11 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:34690) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lcZlx-0007nI-L3 for qemu-devel@nongnu.org; Fri, 30 Apr 2021 16:31:11 -0400 Received: by mail-pl1-x62b.google.com with SMTP id h7so8668715plt.1 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=B/7aU0EzUxhV/kKb8WHkerqUukEIGKD6u5NHmPGNPZk=; b=xHiPV3FAQFXx3WWVf2xNqEQAoO8qxfkoqt4t+6zsWr6wGJIzWKO2oyCdxrOE6tUd8E gAvcmpoGm2cbP7b0uP6Q+A94808Hx5dNrKMq0rZ7pyTgsbIW+fQmO+jJUJT1aNfaEUdX 68PLfmemfMVlq5RtC7zC1zoKY23NI6Y4bFSaZhWGveMjcE7NE/Oh5/UX+6JEVYG8RpJb VZupCASnIyoWbTDGIeIYogg9yRS9sjSBCNl13iB2hPiVHAXA+9JSUuDzeySpltR508za 14xYIv88lXHgJWQ41eg/86xr7bd/0Ig4nrQt8CixG+sY4R+r9AhPXbwZohEESSxePG+s +pfA== 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=B/7aU0EzUxhV/kKb8WHkerqUukEIGKD6u5NHmPGNPZk=; b=JJsLcuMf94dt/S2pi77BDX4AGPLMe7Jl0CaIYK3ENNvUTmaQbQ7BSCulhVTGCGLxDo tWY4eCGX/m63Y4YUg9S/y69mSMSaCqsATaURwyWJuOhv67nEQwbGbHF5aFURa8JDXWT+ a2gIyMwAS9k2UP6IGb5YJ2idO1KMBAUIJjnWu3icriWON5NwzLt1XF2tfPZ/oQ8/USaF vCL9+DhoxmDLfCvUVrsW+MWegaS3LBThZfSl3ujkSEhmMyx+B6k+p3dzaqr440rKI2aH wG6tD0O81PLb4k2OK/G2F2KksP7fS1/IXenApls3E1tuELExk8LZ8HcrV7wCiTpHcj2F aDag== X-Gm-Message-State: AOAM531LnR94XIf3cKlrK4RcGXr7D4akWS+7WR8w1OhW5U9Hhe+ho8qd 2nakaeJBzxZvy/BozHQxwUkYPRG4myk1Qg== X-Received: by 2002:a17:902:8604:b029:e6:60ad:6921 with SMTP id f4-20020a1709028604b02900e660ad6921mr7276222plo.15.1619814592834; 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.52 (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 67/82] target/arm: Implement SVE2 FCVTXNT, FCVTX Date: Fri, 30 Apr 2021 13:25:55 -0700 Message-Id: <20210430202610.1136687-68-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::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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-4-steplong@quicinc.com> [rth: Use do_frint_mode, which avoids a specific runtime helper.] Signed-off-by: Richard Henderson --- target/arm/sve.decode | 2 ++ target/arm/translate-sve.c | 49 ++++++++++++++++++++++++++++++-------- 2 files changed, 41 insertions(+), 10 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/sve.decode b/target/arm/sve.decode index fb998f5f34..46153d6a84 100644 --- a/target/arm/sve.decode +++ b/target/arm/sve.decode @@ -1533,6 +1533,8 @@ 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 +FCVTXNT_ds 01100100 00 0010 10 101 ... ..... ..... @rd_pg_rn_e0 +FCVTX_ds 01100101 00 0010 10 101 ... ..... ..... @rd_pg_rn_e0 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 diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index f5bf122204..87e5c8ac63 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -4715,11 +4715,9 @@ static bool trans_FRINTX(DisasContext *s, arg_rpr_esz *a) return do_zpz_ptr(s, a->rd, a->rn, a->pg, a->esz == MO_16, fns[a->esz - 1]); } -static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a, int mode) +static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a, + int mode, gen_helper_gvec_3_ptr *fn) { - if (a->esz == 0) { - return false; - } if (sve_access_check(s)) { unsigned vsz = vec_full_reg_size(s); TCGv_i32 tmode = tcg_const_i32(mode); @@ -4730,7 +4728,7 @@ static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a, int mode) tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), vec_full_reg_offset(s, a->rn), pred_full_reg_offset(s, a->pg), - status, vsz, vsz, 0, frint_fns[a->esz - 1]); + status, vsz, vsz, 0, fn); gen_helper_set_rmode(tmode, tmode, status); tcg_temp_free_i32(tmode); @@ -4741,27 +4739,42 @@ static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a, int mode) static bool trans_FRINTN(DisasContext *s, arg_rpr_esz *a) { - return do_frint_mode(s, a, float_round_nearest_even); + if (a->esz == 0) { + return false; + } + return do_frint_mode(s, a, float_round_nearest_even, frint_fns[a->esz - 1]); } static bool trans_FRINTP(DisasContext *s, arg_rpr_esz *a) { - return do_frint_mode(s, a, float_round_up); + if (a->esz == 0) { + return false; + } + return do_frint_mode(s, a, float_round_up, frint_fns[a->esz - 1]); } static bool trans_FRINTM(DisasContext *s, arg_rpr_esz *a) { - return do_frint_mode(s, a, float_round_down); + if (a->esz == 0) { + return false; + } + return do_frint_mode(s, a, float_round_down, frint_fns[a->esz - 1]); } static bool trans_FRINTZ(DisasContext *s, arg_rpr_esz *a) { - return do_frint_mode(s, a, float_round_to_zero); + if (a->esz == 0) { + return false; + } + return do_frint_mode(s, a, float_round_to_zero, frint_fns[a->esz - 1]); } static bool trans_FRINTA(DisasContext *s, arg_rpr_esz *a) { - return do_frint_mode(s, a, float_round_ties_away); + if (a->esz == 0) { + return false; + } + return do_frint_mode(s, a, float_round_ties_away, frint_fns[a->esz - 1]); } static bool trans_FRECPX(DisasContext *s, arg_rpr_esz *a) @@ -8202,3 +8215,19 @@ static bool trans_FCVTLT_sd(DisasContext *s, arg_rpr_esz *a) } return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve2_fcvtlt_sd); } + +static bool trans_FCVTX_ds(DisasContext *s, arg_rpr_esz *a) +{ + if (!dc_isar_feature(aa64_sve2, s)) { + return false; + } + return do_frint_mode(s, a, float_round_to_odd, gen_helper_sve_fcvt_ds); +} + +static bool trans_FCVTXNT_ds(DisasContext *s, arg_rpr_esz *a) +{ + if (!dc_isar_feature(aa64_sve2, s)) { + return false; + } + return do_frint_mode(s, a, float_round_to_odd, gen_helper_sve2_fcvtnt_ds); +}