From patchwork Mon May 30 16:06:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 577268 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:330b:0:0:0:0 with SMTP id f11csp432013mag; Mon, 30 May 2022 10:24:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRVgkwb22mWcHSvHjiBIU3V7zVVh7lLbTlKrXVgUWnka0DDSWFiaOJXqaKB4E5qyar3YhG X-Received: by 2002:ac8:5c51:0:b0:2f3:bc1a:4922 with SMTP id j17-20020ac85c51000000b002f3bc1a4922mr44221999qtj.560.1653931443078; Mon, 30 May 2022 10:24:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653931443; cv=none; d=google.com; s=arc-20160816; b=l//s9aA347NWlP+NbSRbh/h5VP53oLKWrall9HzyW1n//RiT17SoRySdn096nnrkwi OHLqAc9Ro5ek6jE0YgJLIalX+8bZZZCYFacxmfDvfgh8jq8Lubuvaxfr7JEXr2QSaQUk 0q+TUnDEsbl5T3vSeUUthVmMsM2wQJrLVIttpGDNlXzYGnHRvvli/IYlOdOwBhHuwmGS BBLAzlVHIz8cca7rht8GD5w1hKoqEQWDqcj8UVRiJP96HrMuiryiEWgdGbEYse65+hn3 kvQHQabC3BBk6XYJjsZU+GKJteAqsXlD8h2vzC00raceWSWGYi/qVKbc5cyHiNxsqcHN kRVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=1FqwuUF6xMql33Kd+JvaXWCNaAvSVoqLBakEwazAero=; b=CRtHnnuOpWbAzeYHkZCZwmZHEgqC7HOxPucVt+bUbcitIA2wV/Iyy7D0TZT6oK7i0W jZNBC/tzHVnU8JlKC9kYUTC62k1hDkVjvtimmIzKre2L3lyDi1kyjTnABcV0oODBt3nh cexblSh6syKYF1sOCRwpmYlE8L+SxRcxv9L1IlRwsnudbjQYoCXgtle/0F8uW3+ZcgWZ XxJL6/fNa/Khtee7tZCcWJzgcq6ilpDopQ083nTrF1myluLVHCI6VDiZ3FrMmVeWXoBI OoEJQy++doYm7mjbwHGkJkKf7xLIkVvxpv6CDS666W5CRhjOb0LKw834qy0hycYVKiCI GCwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ym2uXKl/"; 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 iu15-20020ad45ccf000000b0046432ececf0si5616389qvb.568.2022.05.30.10.24.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 May 2022 10:24:03 -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="ym2uXKl/"; 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]:43338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nvj7a-0005SW-Cl for patch@linaro.org; Mon, 30 May 2022 13:24:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvhwf-0004CH-9n for qemu-devel@nongnu.org; Mon, 30 May 2022 12:08:41 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:33613) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nvhwc-0007NQ-Kl for qemu-devel@nongnu.org; Mon, 30 May 2022 12:08:40 -0400 Received: by mail-wr1-x432.google.com with SMTP id h5so7199563wrb.0 for ; Mon, 30 May 2022 09:08:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=1FqwuUF6xMql33Kd+JvaXWCNaAvSVoqLBakEwazAero=; b=ym2uXKl/OiShvQWsq8MYRTukheTuWaO2AcJH9mezsouejyFfrLHaodeZX2oo41/OVk ++/jN57BShT9GRzOIRx/DozUTGflhUT04MUSfFWE+CLfa0e/XDMLaIQd9b5NodutaK5s WLWjssL887m3DT2gKjGIFD23UKX7nnLLyRftc0q+rjOJ8A2crS6rjP93yC/U2wL7o9tH IChXvF/tMz10bWa0mF0ioaRyTXw3xLfTO6AtxdSJJRr7CyducES5S72w6oHBbyXXeMnL hfEaDg+0wcnoiYz9YK10F74K3O/wazC2NZ5NaqHQ0IxUbt4w1lqfNFFck5exyVM4DTsR 1bVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1FqwuUF6xMql33Kd+JvaXWCNaAvSVoqLBakEwazAero=; b=byC/RnIX82KASYNeCSm5loro1NIqjBQDB9O7AyJzTYwlDyVIOz2sk5ZoanOeVSVkYv STkBu2BjZzV/sUG9/7iGB29Bo6kohuvJ4XT75q/qj6lQMxwFJ5bmL7o/q+ygipoqhwrt V/bR0mU5uUiivaqgpHrxR8uRl0wPILu1az4a9XjNuxEETQC25kaQ0JNdPvo1M86U+h9M pIcXnALsHps0MWGOXhfqiC4fR7kUna5Cu8I0FKK75dhgikXE6WcOz9dQWlZemG+lf0lo p9sE7FBJaGtoTThwbtuTt9qp8vblcLJ+JtpXtHvanq2Iz55a9+5RPyVaK/YWDq3VZfud wiKQ== X-Gm-Message-State: AOAM531AI+IfqedCzgugnADStokWmuCRayuAK8T5bU6W8atFr8CZOInq RdhtXpkFA/pQ04vn1B+rkjKhWP5ybz3HsQ== X-Received: by 2002:adf:fc01:0:b0:20c:ff9a:2c53 with SMTP id i1-20020adffc01000000b0020cff9a2c53mr45899449wrr.142.1653926917738; Mon, 30 May 2022 09:08:37 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id bi12-20020a05600c3d8c00b003974b95d897sm10232152wmb.37.2022.05.30.09.08.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 09:08:37 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 098/117] target/arm: Use TRANS_FEAT for do_frint_mode Date: Mon, 30 May 2022 17:06:49 +0100 Message-Id: <20220530160708.726466-99-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530160708.726466-1-peter.maydell@linaro.org> References: <20220530160708.726466-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Message-id: 20220527181907.189259-96-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/translate-sve.c | 53 ++++++++++---------------------------- 1 file changed, 14 insertions(+), 39 deletions(-) diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 43cfd2818ea..552a551fef3 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -4168,30 +4168,16 @@ static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a, return true; } -static bool trans_FRINTN(DisasContext *s, arg_rpr_esz *a) -{ - return do_frint_mode(s, a, float_round_nearest_even, frint_fns[a->esz]); -} - -static bool trans_FRINTP(DisasContext *s, arg_rpr_esz *a) -{ - return do_frint_mode(s, a, float_round_up, frint_fns[a->esz]); -} - -static bool trans_FRINTM(DisasContext *s, arg_rpr_esz *a) -{ - return do_frint_mode(s, a, float_round_down, frint_fns[a->esz]); -} - -static bool trans_FRINTZ(DisasContext *s, arg_rpr_esz *a) -{ - return do_frint_mode(s, a, float_round_to_zero, frint_fns[a->esz]); -} - -static bool trans_FRINTA(DisasContext *s, arg_rpr_esz *a) -{ - return do_frint_mode(s, a, float_round_ties_away, frint_fns[a->esz]); -} +TRANS_FEAT(FRINTN, aa64_sve, do_frint_mode, a, + float_round_nearest_even, frint_fns[a->esz]) +TRANS_FEAT(FRINTP, aa64_sve, do_frint_mode, a, + float_round_up, frint_fns[a->esz]) +TRANS_FEAT(FRINTM, aa64_sve, do_frint_mode, a, + float_round_down, frint_fns[a->esz]) +TRANS_FEAT(FRINTZ, aa64_sve, do_frint_mode, a, + float_round_to_zero, frint_fns[a->esz]) +TRANS_FEAT(FRINTA, aa64_sve, do_frint_mode, a, + float_round_ties_away, frint_fns[a->esz]) static gen_helper_gvec_3_ptr * const frecpx_fns[] = { NULL, gen_helper_sve_frecpx_h, @@ -7289,21 +7275,10 @@ TRANS_FEAT(FCVTLT_hs, aa64_sve2, gen_gvec_fpst_arg_zpz, TRANS_FEAT(FCVTLT_sd, aa64_sve2, gen_gvec_fpst_arg_zpz, gen_helper_sve2_fcvtlt_sd, a, 0, FPST_FPCR) -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); -} +TRANS_FEAT(FCVTX_ds, aa64_sve2, do_frint_mode, a, + float_round_to_odd, gen_helper_sve_fcvt_ds) +TRANS_FEAT(FCVTXNT_ds, aa64_sve2, do_frint_mode, a, + float_round_to_odd, gen_helper_sve2_fcvtnt_ds) static bool trans_FLOGB(DisasContext *s, arg_rpr_esz *a) {