From patchwork Wed Jan 29 01:38:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 860645 Delivered-To: patch@linaro.org Received: by 2002:a5d:6b8c:0:b0:385:e875:8a9e with SMTP id n12csp648008wrx; Tue, 28 Jan 2025 17:42:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW+oxnpzeOEqatsAKLkfSTHEKan1CCCPKnrsgkwf/8spvNceHTFfDDH74dBtQWVlNhEtvHzqw==@linaro.org X-Google-Smtp-Source: AGHT+IFt5Ymppy4W+NLIMjIMZ+zcrsFZzgr7B3+YEbFVyMA9y77FleJMFf2bLD3ZPqtQ6qpyAHsy X-Received: by 2002:a05:620a:2588:b0:7b6:deaa:3191 with SMTP id af79cd13be357-7bffcd9c454mr198994985a.55.1738114929742; Tue, 28 Jan 2025 17:42:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738114929; cv=none; d=google.com; s=arc-20240605; b=dimN/tJ2eaqgfkNGsGcE1761o2tmIsDnHN5ViCzYOVqWT+VwJz6ROQ+igKsJTpgI7u VUFGbz4dhKOXFiznG4eSOfnOjJdpmby02zjd/nL7Li8MAZROTwT54zfmpxC3S8jXpi+D k2o53EqyDS2fYKnQnOSvZ2ewj7RtVCAt00vVCL18A83aYVMkma3KW6uHIy62vxNniXQr aQbY4zsbksku7aOnTVn6LgE4cNtFtB2m5+lQEP+oFr+krFW+OauM8OjoluO455Dp9Y+E 7pcUE+WBKNzKgmmQuakr10ARJH8xpS/42y+dnTnJQYf4B+u78eUYZmdFFqPlpDeoKkJV 6SpA== 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:cc:to :from:dkim-signature; bh=b7xWXB+eng8DnKFn3D01/tYMXRHmURU0wtcrE+/Ypck=; fh=UQCixiNfr28ZOrfhmxiGPA65dFhly8CmRsnoYC6xI9k=; b=OWJMqw9d8XBe8GbwJ7i9zlXnfJ6hGJFZCrNof3G9LjlMLA1uckDhLh1BeotZ5RXKTn mrSz6pWc8NvUztAa+Ar6/AzR2pNV0wGx1BZviT7DBea9OiB8E1JOzTlkZw6dyZlN9jsP hUWkAboKXiHKZKcAnJ/KOtL+Wp2H7qJs8c99LSqRTjn5d1PURgV/yUrEZJVzgN6efEgt rKK64+veFJPMDvRl+7RWbaHCOJPKq2OJv/+ZWjXf3qC5FGH1UG5O3uCfo21xIdulSiVp 1+bVL83/3Ssno592dGobKN+mZ/z98oTdSVwEAwnFb93VWGtADNysMuTsS6tbntw3Fy6z 6gUw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=exHhm0dQ; 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 af79cd13be357-7be9af11c6fsi1387916485a.542.2025.01.28.17.42.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Jan 2025 17:42:09 -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=exHhm0dQ; 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 1tcx2y-0000se-Bf; Tue, 28 Jan 2025 20:39:16 -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 1tcx2u-0000qF-SP for qemu-devel@nongnu.org; Tue, 28 Jan 2025 20:39:12 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcx2t-0003Wl-0L for qemu-devel@nongnu.org; Tue, 28 Jan 2025 20:39:12 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-21628b3fe7dso112724915ad.3 for ; Tue, 28 Jan 2025 17:39:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738114749; x=1738719549; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=b7xWXB+eng8DnKFn3D01/tYMXRHmURU0wtcrE+/Ypck=; b=exHhm0dQ+7JlR5Y4LKxDHH7LlpNGKc26s5rImlens5AlA24KprtEKb0NmbdpcWwCO7 QWymafJPIvdB/cbr6ZioTVXW+C21xG0S0EeUwTAuSiu+okUgL0SulyllUyNteUc4MUOX GIvjUg5RuqVCLmkyzGXbEW93wVr+60zCLhleCO5/NwubWr/92+IDmG4cLUzwNJsM6xcU bSShK5tP5RmZnM3HkCmXid0ELZ/OBsCKeS5j3+NyzZoHtI24q2Zf+GbmF/COZTCtEWOL AKOspeMWbzSMblJO0JEzMNJTQPhIrPrJm1tl3edJgaHAQaVEcScu/rF9YuuT/AkPGXGI mfmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738114749; x=1738719549; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b7xWXB+eng8DnKFn3D01/tYMXRHmURU0wtcrE+/Ypck=; b=nQQ2ZtQ6DYkfoXSesoAXLx5RCVxyWrmGAkyRUAc8a7iygV6Fb11fMLB7HlFq0PtZ/6 oae1F5u7jAmJ1ncK/J85azGeso4aPg8Qu63etc+OjaQl1XiNRG8siLcABJnvc+liMKKE YJFaDjYBa+h8fjLXnnToTZgjY0WaCJWp4N8zC9bsTV+6ussptLU/sW/UbJ1G9aAvKNPg 7A7kO8Z8WaFFAVVfq42IIcSF8OvhdPjS9LtV8kZeWJvuJ1tB+KVAgPbIcJgP1iJ6lktI ix9oUWzbN7tt9QZo5lGc7cOh4f3JU9pkQDiNA8ZpZg+gKuvemnzxr9SBPbIj+CmxyV8Q imXQ== X-Gm-Message-State: AOJu0YxKemxtLISLrs5ASriIg8vrNQj/YMYdqR1XjtFvBn1CxU93wRtl nzvBGtGf7kVhSBL3GKoJSjuHaPtwaAmkVVq1AUDWUJ0VeP244AN7R9zohCd51sPBFUjEnDrtaTe o X-Gm-Gg: ASbGnct3uugCUh8oHRHOua4UyeYEJxuY/+Gayq/rQMUPAfU4Gp3EysOWjTK2BD3xneE kmGqK62uuR+3JzmqlCjzRFSsaO0sYF+cw7F9FvTNObjAd/6Mm/IguJCFndSCiZfmrDfOhilfBlE PqAH65Y2VKzifNTbo2bH0WZKiZMorVCcEbOalWf/YaIEHlgWr8B4K6jWFH76M7RKjsEZFoF1Sjv UiRv/7toX+p6DD24yDny/ZDSqHic+g9Qv8l0dOxdrZx8tTAozyLNBUQIxPVbbGVtmy3yHrWtBkb cIvj2M/BUxjFXVecCcaP8uxyWCT83IkVLSs6xwztsyuIbDXzgw== X-Received: by 2002:a17:902:ea12:b0:215:9a73:6c45 with SMTP id d9443c01a7336-21dd7d6e17bmr19880255ad.22.1738114749226; Tue, 28 Jan 2025 17:39:09 -0800 (PST) Received: from stoup.. (71-212-32-190.tukw.qwest.net. [71.212.32.190]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21da3ea4200sm89341745ad.88.2025.01.28.17.39.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 17:39:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v2 15/34] target/arm: Simplify fp_status indexing in mve_helper.c Date: Tue, 28 Jan 2025 17:38:38 -0800 Message-ID: <20250129013857.135256-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250129013857.135256-1-richard.henderson@linaro.org> References: <20250129013857.135256-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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-bounces+patch=linaro.org@nongnu.org Select on index instead of pointer. No functional change. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- 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 3763d71e20..274003e2e5 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; \