From patchwork Wed Jan 29 01:38:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 860632 Delivered-To: patch@linaro.org Received: by 2002:a5d:6b8c:0:b0:385:e875:8a9e with SMTP id n12csp647516wrx; Tue, 28 Jan 2025 17:40:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVdQMDQu0w1gGcD8YhFQrsyhugqbDgiC9KloEu2uCPHJdC0EpaHH2CdqlS/zafepX+rWaqj9g==@linaro.org X-Google-Smtp-Source: AGHT+IG0/0EHIE927YU47t9koQp/v35ECgC9D0ZFhi9doC8aXMuclvkZfWu/7CnYWPtjn6eHYvdv X-Received: by 2002:ac8:5d53:0:b0:467:7295:b75f with SMTP id d75a77b69052e-46fd0b87e74mr24194651cf.38.1738114817470; Tue, 28 Jan 2025 17:40:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738114817; cv=none; d=google.com; s=arc-20240605; b=FLB3ErsFcvsVx7vAVXxgjfRSKH0jWOkDnVrtJKZZEk7vFcORZYGbmBoY2npyjCLa+U RLtYnMASymWcSj94C+CKcaYP1Z8kgZGuld9V9rGCgBEmZWYPlCgPgrxVOfkXEvPjy9w/ DJ+B011DBEXg0NTbJBqXetxO1+9Fn4Q3BVrcHUXDM12js6dr0JnGLaSuazUJPiHDpkIK iC8AnQvCTwTGYuq6SaNMNfd4qPL+5f678ehaLy6Uw15y802a+oPG8LH6nfNOEBEizpF+ DJzvcWBkoBc+R3Y9BdbKM6Kn5zNHm4Jt7/sgQI9PFaeHjJ1rGpjganbiuCKYoqbQP9nD Uz3w== 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=HYl4PCTFZMV0eYLHMXpsl9mxtIOIi9P6hK3LvJJsFQ8=; fh=UQCixiNfr28ZOrfhmxiGPA65dFhly8CmRsnoYC6xI9k=; b=FX+Xc43mQqii9WV5aBfDLgBfC6qUUfwDTT1rLmcdWT0x/QDAz7VQCcIgOOaKtybJSG Ji1LnvOBvIQczd1U51HsI6b983pwngMiNv6CXeHDTVak7WyRMDtTfojNU+lLYlaGFSRt pCRDG5RYBbLeLgxnV5zQsi6KEX38+drZrOdPoicS+UTo6dYeI5WzFc3f5I6Z/DfXTtUd vUcRObMMgctFCuiWnF2l9rFElVmXeVYnNfSbjymyC+tASHXXQgc3EBP2emHdxo2BrO1V vBstvdPJNGXbrDg3f2eF+qVeIZxL8vCTqLy3dlWCWZmcEtnrTk0sEgcAf0Y5kbwT7PMm jb2A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vztsb0sf; 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-46e66bc8c42si134515471cf.603.2025.01.28.17.40.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Jan 2025 17:40:17 -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=Vztsb0sf; 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 1tcx3C-00010s-Nc; Tue, 28 Jan 2025 20:39:30 -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 1tcx34-0000xN-V2 for qemu-devel@nongnu.org; Tue, 28 Jan 2025 20:39:22 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcx33-0003bL-5D for qemu-devel@nongnu.org; Tue, 28 Jan 2025 20:39:22 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-21669fd5c7cso112548345ad.3 for ; Tue, 28 Jan 2025 17:39:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738114760; x=1738719560; 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=HYl4PCTFZMV0eYLHMXpsl9mxtIOIi9P6hK3LvJJsFQ8=; b=Vztsb0sfpaA1e+hIGwBC4c4OJATh2qmGOJkxdgk/+glzzasorDrGPGWG5syVKUxs0k hkS4ZVyHD8g91rOm4vtFgoarOOLaokcJ5ydnmF/q4eaMbiWTplEm/TNjBg26ppf+CCLb zLNbrW5CPRuaKeuppaRUmBzacwX7fROeIRcgGHmj1IDffLaLTbq2T4jNtb+EITkU5sDO A1rvPMTruCAwdCO9CvzuaZKAOMWBeREs+cyh63H/7uw/qoedt8eb6JrLd8HT5cdeov3l T0/QqxE0reuaGerTk0Ux564ZnbxWwd3jQKhiOZ1wmxc0NGpI7jviNvy1pZ21+U7W0Qbf WOQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738114760; x=1738719560; 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=HYl4PCTFZMV0eYLHMXpsl9mxtIOIi9P6hK3LvJJsFQ8=; b=eLh2bTOlZHS3kLPNdzP6PWWf1gJVGqvR14HnUXXuYlr00a2mp0UI8pd3o/DMARZ1/E a0QM4j0lN8qd/14KWasby2hBovQ/OpzQniqw+2fPF+Hrg4x4YZztIzwIjoLGkJCTSmh8 /6KLyrgrs6Js8OF7SSwYSTditF0GUNZJEvgyQ7F2RGkeWW6rWnFKE1qI/xQOAfthkcta 9bPIkMs+eA9WZBCdvaqh0BcDC+VTRh004T0YCztV6rC+EF8e+eQ1AD36n9aA0LXexM7f N4hS45FBI7Tyh5HF6ZhLhnG8xDwHOmzbbPw2oQ6IiRJdky4xpekWWMB1cwZOGQheF+Iw ULTQ== X-Gm-Message-State: AOJu0YwWttD8UpXKAmMrkJHzIdrlJs/mqGYhvK4NKmEMYLoSO5yZXgpR hGIohUBTS4rtgvwH+C5S5rfosqfvWlsuBdR7a5bZCd5zhSsIwScWsc3zqFjICP6gFrZNKjHW+cF K X-Gm-Gg: ASbGncsiosTgVWZ/L8YOdkEEp1ccDIGz0WSsaII8RTEQL6HeZi5jfEwze5L6PpkXB9p tQ3Oksiv/Z0F4LKMxMpUeE7+TXmcVyx22qB4gD20tfLoxrNJswU31jVRwcvDgHTdHg8dzxANdLk kgzZ6zocXLUkBGKtgozMgYixjKKYTSNtTJSNceJuMErqASi+sWZ1LXTFxvY41ZpxxWUzCYz5iLv +SnCdPH36mpaHG94XdpVttJ+OknpctTVUnfjiCeRowlZqe9fEhGAAMZOzhND4RKW5eu9WtAt27W L+EExp2Aj8evu+GtwdsH7ntzoqqHFaaWwJAOKzRWgP/aEwDbEw== X-Received: by 2002:a17:902:d54d:b0:215:e98c:c5b5 with SMTP id d9443c01a7336-21dd7c356d3mr23463675ad.1.1738114759883; Tue, 28 Jan 2025 17:39:19 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 17:39:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v2 31/34] target/arm: Handle FPCR.AH in sve2_fmlal_zzxw_s Date: Tue, 28 Jan 2025 17:38:54 -0800 Message-ID: <20250129013857.135256-32-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::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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 Signed-off-by: Richard Henderson --- target/arm/tcg/vec_helper.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index 9b14885ef2..c716bd774a 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -2252,23 +2252,32 @@ void HELPER(sve2_fmlal_zzxw_s)(void *vd, void *vn, void *vm, void *va, CPUARMState *env, uint32_t desc) { intptr_t i, j, oprsz = simd_oprsz(desc); - uint16_t negn = extract32(desc, SIMD_DATA_SHIFT, 1) << 15; + bool is_s = extract32(desc, SIMD_DATA_SHIFT, 1); intptr_t sel = extract32(desc, SIMD_DATA_SHIFT + 1, 1) * sizeof(float16); intptr_t idx = extract32(desc, SIMD_DATA_SHIFT + 2, 3) * sizeof(float16); float_status *status = &env->vfp.fp_status[FPST_A64]; bool fz16 = get_flush_inputs_to_zero(&env->vfp.fp_status[FPST_A64_F16]); + int negx = 0, negf = 0; + + if (is_s) { + if (env->vfp.fpcr & FPCR_AH) { + negf = float_muladd_negate_product; + } else { + negx = 0x8000; + } + } for (i = 0; i < oprsz; i += 16) { float16 mm_16 = *(float16 *)(vm + i + idx); float32 mm = float16_to_float32_by_bits(mm_16, fz16); for (j = 0; j < 16; j += sizeof(float32)) { - float16 nn_16 = *(float16 *)(vn + H1_2(i + j + sel)) ^ negn; + float16 nn_16 = *(float16 *)(vn + H1_2(i + j + sel)) ^ negx; float32 nn = float16_to_float32_by_bits(nn_16, fz16); float32 aa = *(float32 *)(va + H1_4(i + j)); *(float32 *)(vd + H1_4(i + j)) = - float32_muladd(nn, mm, aa, 0, status); + float32_muladd(nn, mm, aa, negf, status); } } }