From patchwork Tue Mar 9 16:20:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 396067 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2815928jai; Tue, 9 Mar 2021 10:23:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9KuN2BdirfKQTZtW0MrhK3zVuo3v7A8Sn921u64m9M/KQ3Xo2JB2uJRewVS7Xl/FHkv2Q X-Received: by 2002:a92:c641:: with SMTP id 1mr26995700ill.94.1615314200652; Tue, 09 Mar 2021 10:23:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615314200; cv=none; d=google.com; s=arc-20160816; b=cNcA7m9seQdKWoA9n9gAXLbJb5nV+ORVPawEkm5O2IQsNmZ3PUhGaXyjVJUfeQCyJS KcHjuTAQHYcpybowomJsjrZLWUVSuQlE1JQiTdtYAm+C7b9OsgNw04CHTtFi0gcGnAF2 8K3DSuttUGN+Mh3FAMz5gWl7pAHfA0k3Y3bm/QzHkdjEZFc3Xy1zCJjg9JcrH+bx9xh6 waPyZ3xHdCO8F7+zdmIrx3BeJW6T6dieDfdTbbYTObqyMajooBmXwe4RvVjtcFxxga6V AqNoYwaA46r5QKDrMDHMBq+DmrSQwQH/qyhAEhnGFvs/nBggH9H2W0th0ccqupNt5LzH sO6g== 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=eeIkjfuK4lIZhLLIPgTtWdu0JToAdaQwwLqvqAcG254=; b=S017bqA+aCLn5EYb1I249/nKYc/sZHhY1/vK/hvEKqhcIbQoxSUzXU6p5KPujny895 FWKul0O0+0v6RoBSh2wnczqZdzb8GeLc7Pe+PK4eJ5Lqg7AZSdvSNI/OdyMwj1gDov/C 3TiBzULSfZX7rEpb4BHN1hwK+LFZX7fgNF6K0bPQP6FjL99h9mr8UgGr3Dr/dwSHE6iG zexnEAN0B/G/qCXfwZyYcRtCHaqQ1p9Mhfa5mZIgJ8UsBUrzqgCG7e6V/RpDitA7+QVX j23Vbpm1xPqIJHwLLfdVKS+da3mOMeyQOvFcOEWEDLHIb/nu+ZZk9DZAXyFrG+r/q3Eb yd7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aJYF0Ek5; 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 k3si15190875iol.70.2021.03.09.10.23.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Mar 2021 10:23:20 -0800 (PST) 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=aJYF0Ek5; 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]:49744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJh0p-0003Cx-RT for patch@linaro.org; Tue, 09 Mar 2021 13:23:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJf8H-0000iE-7B for qemu-devel@nongnu.org; Tue, 09 Mar 2021 11:22:56 -0500 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]:42966) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJf7z-0002rk-Mn for qemu-devel@nongnu.org; Tue, 09 Mar 2021 11:22:52 -0500 Received: by mail-oi1-x229.google.com with SMTP id x135so11047526oia.9 for ; Tue, 09 Mar 2021 08:22:33 -0800 (PST) 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=eeIkjfuK4lIZhLLIPgTtWdu0JToAdaQwwLqvqAcG254=; b=aJYF0Ek554kl/uUuyu83mgE6ixaCJIlo2YxwjmIm8dwjYKdOPL6IxvavdRv90amKhN nKUIfnttPNxv4PqYf5ov5gBFwMAi6+0Xm2sRjb62far8uqBl3qi4lY9+E/a/6fdvoKRG Xx1eHM233bpqqbDbEfZKk2vFg7OuhZ3UYmoBLMnVDGotqI7UDWsR84Gu1Bb7Sqj0OQUU HmQ3CMozI2c/r1HYqCO5qaDUTS3BXlWM1uxqQPgpZNVd112DkTN+G8QuVWRdZCUj57A5 r4Ls/ZbJJtxu0SN7nlwd1HAQDO43xjjOyswbDAEqmQ0z5Jig81xNQgnksLO0A0lUbABp iCiQ== 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=eeIkjfuK4lIZhLLIPgTtWdu0JToAdaQwwLqvqAcG254=; b=F1Ns0t56CuhJzemlNEgQ2IMeMhDemeNtMMxg7WAMNhwX4kmv0SLRfTRgE+wiLXGzQ/ /i0M5rLZLIdKPfBPYkQ3md/VgjoTIqzv2oZcRzRlfEP1VAkKxrLAULMQn3OpBaf3zMNJ pFyj6unptNCKNnCcjh8KTQayydRasQfMNJlTybJ1NJKnPuKppEwIMpxTBZHt691hSYkj U8ogLL98k9mMJyxEnddA9jsqyejow99JJDjAuPPgS2a9IKWR6bH99J+mEy+9iHkaFjom 9Herd27MkjKjIW/SvJIbwu4e4HZqlpm5Pk575b2alnc/+a04z5Y9v7S+1GmQOxgBfiTt jlYw== X-Gm-Message-State: AOAM531x3GPQIaEEyZQjGJQO/jbBuQyVLqD7fcLFLXb3fnD4TFnVibTS ZpRrSDR2nqfDdpOyYYiiay49JMLQGPQi6JcD X-Received: by 2002:aca:2104:: with SMTP id 4mr3523575oiz.124.1615306953244; Tue, 09 Mar 2021 08:22:33 -0800 (PST) Received: from localhost.localdomain (fixed-187-189-51-144.totalplay.net. [187.189.51.144]) by smtp.gmail.com with ESMTPSA id u19sm3470898ote.15.2021.03.09.08.22.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 08:22:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 70/78] target/arm: Implement SVE2 FCVTXNT, FCVTX Date: Tue, 9 Mar 2021 08:20:33 -0800 Message-Id: <20210309162041.23124-71-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210309162041.23124-1-richard.henderson@linaro.org> References: <20210309162041.23124-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::229; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x229.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: peter.maydell@linaro.org, qemu-arm@nongnu.org, alex.bennee@linaro.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 diff --git a/target/arm/sve.decode b/target/arm/sve.decode index d152193e89..4fcd1b43f7 100644 --- a/target/arm/sve.decode +++ b/target/arm/sve.decode @@ -1575,6 +1575,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 c29984d244..14a6a53320 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -4765,11 +4765,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); @@ -4780,7 +4778,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); @@ -4791,27 +4789,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) @@ -8253,3 +8266,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); +}