From patchwork Sat Feb 1 16:40:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 861265 Delivered-To: patch@linaro.org Received: by 2002:adf:fb05:0:b0:385:e875:8a9e with SMTP id c5csp1264147wrr; Sat, 1 Feb 2025 08:47:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVlJMKOkxw0wfNL/+vFLN0yejwJ0fwJzFfyP6mFwyv4Vn8R7UksGPfdg9HKe7ueoddxaAd1oQ==@linaro.org X-Google-Smtp-Source: AGHT+IHY4Y8EGGpeK70P5xRKu6tpdKcZa5AHzWsePxLNrFNYLl06D9zoX80yRmzfZ/xx6SfsF1un X-Received: by 2002:ac8:5a0a:0:b0:462:ea22:33bb with SMTP id d75a77b69052e-46fd0b6f39fmr217049261cf.38.1738428434888; Sat, 01 Feb 2025 08:47:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738428434; cv=none; d=google.com; s=arc-20240605; b=fNM/ohsX+PCHKhy3rejTQ10gBlyOz+AD0GmcgxI3QSQbIQTqzweRqK0Xy+YeaKtTRe kT8xdJj6OOm51weCg9MlZE0+N1HTqZmCL2Lui8D3Rgk3qPPfV5ZTeVQJuXgkodIPQt/N 5bIr0tzt9O0I4pophPBmDHYXc/otzQ07JxSNGfJJGseScMWZkgozvEZHubXyRntJnMIV /QELGTkaIV8hBTYtWj1M1Gpxh78rTPyRqSNp5CvOIV3VAwJPK0yR+G0kbSqyow4D63eE VWI3eZQIlQeizAFbx140W5bQJnefcpmrUmAU5TOYc0ivjQdAUkBArhoBk/Fr2c/byqZr bZIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=0HZn+lA/3QK6V9nAt4Z7tzwLTmDhEfAS7cpqC5pJp9g=; fh=MejNURaQviLQa/TcU61vbQ9wOH8v+I71I8BgCrAZMdw=; b=X/515Qi+L2cAgzZewItFHW3ZBjpf2gkQFFWasv3OZN0KfY4+iVVtMyD+dNzmMrQy10 k6nX6oii0ZtbrBqrRwkfnNsA9QPXdtX/jq4RYX34nMEg9TsOkB33jAVMpCBDOUij+TNP 4alxkv7u/sQ151x/i+/RivxUz8qB5wWxVjg+d+g8Zy4ayagesT2qF/pZ1esJsfPeh90L 04YQkBoIZb/WyerYnGgcTQkvvNi4HNOnbToScCLGWzXuDmgVJMbT+Y5yWTaYw79DqgRJ u8DT/vhBNS4vPgd34Op1lFAWW0+ngQhT2yiqBXETENZLAyeCD3pPAS1T+R9BjMMwPIzy 5SXQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VUP6HWRy; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46fdf1ba2fbsi67124181cf.237.2025.02.01.08.47.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 01 Feb 2025 08:47:14 -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=VUP6HWRy; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1teGZG-00019Q-7e; Sat, 01 Feb 2025 11:42:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1teGYv-0007b6-22 for qemu-devel@nongnu.org; Sat, 01 Feb 2025 11:41:41 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1teGYs-0001OY-VB for qemu-devel@nongnu.org; Sat, 01 Feb 2025 11:41:40 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-436345cc17bso22549315e9.0 for ; Sat, 01 Feb 2025 08:41:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738428097; x=1739032897; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=0HZn+lA/3QK6V9nAt4Z7tzwLTmDhEfAS7cpqC5pJp9g=; b=VUP6HWRymnYIEnXF9hAfxggbyE7YeV1FbucPtOPcvWPWWbQiTXendErF0IYwynExr7 lNSMuYB6fLobAs+OSC9MZ7agXDDlO1mDYPrvnW580F7ZVHV2mtSV2NzOei92q+ac1yae YVSIWGqG1ohfmjwd1MLTM/dS7kR5GDQnUuCWaHqPdWCM1d5DINM1vQRukw6M2SufmTDN oUtNxysTWrs1kjk/yl/icix5mNfVfO3aI/CDtuKSSbV1QoVTfIEw8QaMbKiVNKEZPmLH xnllM73TYyZiXexRXdgq9zrwezC/MfYc4dd/XARCUk4jx/17wq/GJf/tw7oU5gh3cR0z 9i2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738428097; x=1739032897; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0HZn+lA/3QK6V9nAt4Z7tzwLTmDhEfAS7cpqC5pJp9g=; b=RicaTevek9wv5l5tbLiIHx+uSnV3Bt2P0evV/yTUDrrIEtryDKw1ozJuS0lafm+WxT T75U+S/3vo5p9PjV6W1zxKCCwfNYrK1YnEH5J2FHXzcj5VaLgkO0Wt0dKglZnSYiVT8s 6AFrnFnNtqiv2VOUChMO11TlGZ/8IKr+uCShoqoaDn9Xvb6hA6q8q8wYs2bmD3E6+AtB AXSsa1OtyLFqaQJXj8edES4V6Iz+cc8QpHmuGb2W+Lr/urOrPocN6IEB6lbODp9APx7R fcrTAVVn3Y4FmXECRfyaYfQwXtgtFOgTvGrgIrwgYgirm0TQyd3RCebHdcaXUDQ514+y daXQ== X-Forwarded-Encrypted: i=1; AJvYcCW8egXzvCiVJosvs7Bk8eGpAEZCQx94ydalCQHY3rVxxlllunvUrWdahgbVa24HpqfjtfmwwRssAvVS@nongnu.org X-Gm-Message-State: AOJu0Yx5a5FzDvonoZvpZ4qBhWobT/oK/gTLHLei6Ch4NdQ0PAdzDWFh y1HTO6bSKCMvStPCeE3uBbxTtsNHfb7KMkmvN2euV8rIzFofTfe7yqWbOjD66ZQ= X-Gm-Gg: ASbGncs2+3msnvEj6xYMkUIMqFm0Ei+anO0J6WSkc8GV1no+jtpISagasCxv+Q9G+gU L7L5cPNVdkpG/bPwb3MKm/LcdIoqy/wytukItMSorvhEHBap7duARMlhuCKwYnSC6QnUAFlt7hJ TQZi3zbOYbsA695v3jMu/rLQS8qTfq7jyDNh1ZMMRc+W8tazfhcIMaYaD9GGNGQe0w7clwkkuDI KRdWwtWwT1lfoBa99PEPcKK+wRSeOnNBrE8rX9Mn7fqfmyqqeAAAWTt2S+eSyeTA9YQcZ50Uw/A 6IXvrNP1Ol+lPDILovs1 X-Received: by 2002:a05:600c:3c86:b0:434:a529:3b87 with SMTP id 5b1f17b1804b1-438dc3c2413mr155858565e9.10.1738428097520; Sat, 01 Feb 2025 08:41:37 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438dcc81d74sm127401525e9.37.2025.02.01.08.41.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Feb 2025 08:41:36 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 66/69] target/arm: Simplify fp_status indexing in mve_helper.c Date: Sat, 1 Feb 2025 16:40:09 +0000 Message-Id: <20250201164012.1660228-67-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250201164012.1660228-1-peter.maydell@linaro.org> References: <20250201164012.1660228-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.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.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-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Select on index instead of pointer. No functional change. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-id: 20250129013857.135256-16-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/mve_helper.c | 40 +++++++++++++------------------------ 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/target/arm/tcg/mve_helper.c b/target/arm/tcg/mve_helper.c index 3763d71e20b..274003e2e5b 100644 --- a/target/arm/tcg/mve_helper.c +++ b/target/arm/tcg/mve_helper.c @@ -2814,8 +2814,7 @@ DO_VMAXMINA(vminaw, 4, int32_t, uint32_t, DO_MIN) if ((mask & MAKE_64BIT_MASK(0, ESIZE)) == 0) { \ continue; \ } \ - fpst = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \ - &env->vfp.fp_status[FPST_STD]; \ + fpst = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \ if (!(mask & 1)) { \ /* We need the result but without updating flags */ \ scratch_fpst = *fpst; \ @@ -2888,8 +2887,7 @@ DO_2OP_FP_ALL(vminnma, minnuma) r[e] = 0; \ continue; \ } \ - fpst = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \ - &env->vfp.fp_status[FPST_STD]; \ + fpst = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \ if (!(tm & 1)) { \ /* We need the result but without updating flags */ \ scratch_fpst = *fpst; \ @@ -2926,8 +2924,7 @@ DO_VCADD_FP(vfcadd270s, 4, float32, float32_add, float32_sub) if ((mask & MAKE_64BIT_MASK(0, ESIZE)) == 0) { \ continue; \ } \ - fpst = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \ - &env->vfp.fp_status[FPST_STD]; \ + fpst = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \ if (!(mask & 1)) { \ /* We need the result but without updating flags */ \ scratch_fpst = *fpst; \ @@ -2964,8 +2961,7 @@ DO_VFMA(vfmss, 4, float32, true) if ((mask & MAKE_64BIT_MASK(0, ESIZE * 2)) == 0) { \ continue; \ } \ - fpst0 = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \ - &env->vfp.fp_status[FPST_STD]; \ + fpst0 = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \ fpst1 = fpst0; \ if (!(mask & 1)) { \ scratch_fpst = *fpst0; \ @@ -3049,8 +3045,7 @@ DO_VCMLA(vcmla270s, 4, float32, 3, DO_VCMLAS) if ((mask & MAKE_64BIT_MASK(0, ESIZE)) == 0) { \ continue; \ } \ - fpst = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \ - &env->vfp.fp_status[FPST_STD]; \ + fpst = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \ if (!(mask & 1)) { \ /* We need the result but without updating flags */ \ scratch_fpst = *fpst; \ @@ -3084,8 +3079,7 @@ DO_2OP_FP_SCALAR_ALL(vfmul_scalar, mul) if ((mask & MAKE_64BIT_MASK(0, ESIZE)) == 0) { \ continue; \ } \ - fpst = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \ - &env->vfp.fp_status[FPST_STD]; \ + fpst = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \ if (!(mask & 1)) { \ /* We need the result but without updating flags */ \ scratch_fpst = *fpst; \ @@ -3116,9 +3110,8 @@ DO_2OP_FP_ACC_SCALAR(vfmas_scalars, 4, float32, DO_VFMAS_SCALARS) unsigned e; \ TYPE *m = vm; \ TYPE ra = (TYPE)ra_in; \ - float_status *fpst = (ESIZE == 2) ? \ - &env->vfp.fp_status[FPST_STD_F16] : \ - &env->vfp.fp_status[FPST_STD]; \ + float_status *fpst = \ + &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \ for (e = 0; e < 16 / ESIZE; e++, mask >>= ESIZE) { \ if (mask & 1) { \ TYPE v = m[H##ESIZE(e)]; \ @@ -3168,8 +3161,7 @@ DO_FP_VMAXMINV(vminnmavs, 4, float32, true, float32_minnum) if ((mask & emask) == 0) { \ continue; \ } \ - fpst = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \ - &env->vfp.fp_status[FPST_STD]; \ + fpst = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \ if (!(mask & (1 << (e * ESIZE)))) { \ /* We need the result but without updating flags */ \ scratch_fpst = *fpst; \ @@ -3202,8 +3194,7 @@ DO_FP_VMAXMINV(vminnmavs, 4, float32, true, float32_minnum) if ((mask & emask) == 0) { \ continue; \ } \ - fpst = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \ - &env->vfp.fp_status[FPST_STD]; \ + fpst = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \ if (!(mask & (1 << (e * ESIZE)))) { \ /* We need the result but without updating flags */ \ scratch_fpst = *fpst; \ @@ -3267,8 +3258,7 @@ DO_VCMP_FP_BOTH(vfcmples, vfcmple_scalars, 4, float32, !DO_GT32) if ((mask & MAKE_64BIT_MASK(0, ESIZE)) == 0) { \ continue; \ } \ - fpst = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \ - &env->vfp.fp_status[FPST_STD]; \ + fpst = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \ if (!(mask & 1)) { \ /* We need the result but without updating flags */ \ scratch_fpst = *fpst; \ @@ -3300,9 +3290,8 @@ DO_VCVT_FIXED(vcvt_fu, 4, uint32_t, helper_vfp_touls_round_to_zero) unsigned e; \ float_status *fpst; \ float_status scratch_fpst; \ - float_status *base_fpst = (ESIZE == 2) ? \ - &env->vfp.fp_status[FPST_STD_F16] : \ - &env->vfp.fp_status[FPST_STD]; \ + float_status *base_fpst = \ + &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \ uint32_t prev_rmode = get_float_rounding_mode(base_fpst); \ set_float_rounding_mode(rmode, base_fpst); \ for (e = 0; e < 16 / ESIZE; e++, mask >>= ESIZE) { \ @@ -3427,8 +3416,7 @@ void HELPER(mve_vcvtt_hs)(CPUARMState *env, void *vd, void *vm) if ((mask & MAKE_64BIT_MASK(0, ESIZE)) == 0) { \ continue; \ } \ - fpst = (ESIZE == 2) ? &env->vfp.fp_status[FPST_STD_F16] : \ - &env->vfp.fp_status[FPST_STD]; \ + fpst = &env->vfp.fp_status[ESIZE == 2 ? FPST_STD_F16 : FPST_STD]; \ if (!(mask & 1)) { \ /* We need the result but without updating flags */ \ scratch_fpst = *fpst; \