From nobody Sat May 30 17:45:08 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1779366652; cv=none; d=zohomail.com; s=zohoarc; b=gfTfWao3eYajs3SpmUnpLriG9Rc6bV0m3xtCb5KBYzyvpvig41iv/vqEFae/5QlITO4TmXIz8kiIc80/Fd2qafajWDb9kWQNIXCOJHHD5Mw560DsW41k5WqFBraOkl/lde+nbVMNSqU99nVOPg5THmogfjI+Gx3TYj1hY4O3iZ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779366652; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=W8ZF++qrDnuZBikX/tugNauIXQvtq2xExzyD11E2IKo=; b=ZaW9JQO6tlEWbQxW0l04xotUG3r6+GbCqWrYXNk/L97O6inn4lMcnQnSc39s0eECnOr6/ArX5wh5RAd/rwe/tjh3FDUfbGwSVS1qZIjKv9yoAA5xNdnwPpgl1WWdhSo+8H9riWkpqZdQAUvEJQR0VpD2s4xfjhuC+9HCTnbbpNA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1779366652572595.579603030121; Thu, 21 May 2026 05:30:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wQ2X9-00011G-FY; Thu, 21 May 2026 08:29:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wQ2Wg-0000xu-1w for qemu-devel@nongnu.org; Thu, 21 May 2026 08:29:24 -0400 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 1wQ2We-0001cZ-CD for qemu-devel@nongnu.org; Thu, 21 May 2026 08:29:21 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4903dba5c3cso2095605e9.0 for ; Thu, 21 May 2026 05:29:19 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49035c72c78sm22054245e9.3.2026.05.21.05.29.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2026 05:29:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1779366558; x=1779971358; 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=W8ZF++qrDnuZBikX/tugNauIXQvtq2xExzyD11E2IKo=; b=q5AkWG4BEDQUFM2cogmJG8FduKuQn0sJjN/LLNnESzr2BLAix2d+t74a5ySest63gX CU65ulzWxY1jriAmCohlXP+SjcDRo32BZPDgyXxF/y8oJwPb6JB4U0ayr+mJuA3KxPCw KYFBtp6ovIwBvjWhEwTZcO/uWvOdH2Kjfv0qNGww3Uk0pvW3rALhYrW817nJYFv+DK/N Tm0W004vFj1/YQCKlBiXSCbvElRhyY76A1LGGXvu5TtKjJ1xXsi8O5Y7Pr8Ls5m3eQgY lGakIh3M9zTnTRWJNtngfgXTEjq5HiLE1x7rxZfLSeRXsc8dTdywjpZKTamHpb2J1OFF eqMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779366558; x=1779971358; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=W8ZF++qrDnuZBikX/tugNauIXQvtq2xExzyD11E2IKo=; b=iZUpDo7SmpUEHS52RzlCE5L03JNFvJe3QvR3fz7L2Il6m468bG2B2No8lIeTcxXZ00 X03OaORwvnT7qDb8v1LZNvqBqW5oYuGezvSKTZU4QO5kEogztJIcWzqwjHXeAV5cp1Jv sNPL6AihCwVImoWQ+DoIZgBoPYhGKCg1wK5KHu7Ev02ibUgSHzrY7jSmTZ32GTWwljn7 X24UsbbI0YHbl5nL7d/rGUdsF+6BHxLqJGNgwkxEp/QfooxmyOXfDDn2mf2Ul+TFbgRa HbuzyAsnfPAam7njTMdfdhMuyMH+223mkGD97TTRlOgleofQxyOERZwEEbaYjUV1zuVS GZ0A== X-Forwarded-Encrypted: i=1; AFNElJ+neyZuFOepRIYOqZKQVlEnOm5PHY1kbYwi2NBhIvQPthQ3HTLWzyJjpSVXM4tWlr8t/r00QN3XF8BL@nongnu.org X-Gm-Message-State: AOJu0Yz8R1K6qBwy2ClbvU9TSsPIwQJlswdVgeGpMafNOMjzcuUjD9fa A0Fcep0QpOg6EHKNHvmL3TfpN3Tw/T2jRP6ltA6nh4ChT4rZ5KKv3SW6+jsh6/Bz6Kh6uRgBdDw arnYC X-Gm-Gg: Acq92OEsLuHkIARVpbAhF+gT51R3oZMFfFxQ2gJdxfomWf4rQRFQTzT2MBPAf4/xoQs sOJvbCqeEIsMQS8dWggbgGgKM+oGLEO7A8FyGnGzPdupO6kOR4tJk3XhTo67WVDEqxVWbqz/Nrm NEZvw+C669TUumHLTaIeWJv5xAHPMo/Nc66JMc7v632O7FC9qAYpFRKuL8MZk/bmQjZ0sgZD1t/ CtSEwQ5ZlVjC/l36TQ2eXmWT8SwdaH2sEubLskx5XBJ4B8JuXDGsOHYe64BlwBHcE9LeHqkCrSe uH+N056sQLLK+QQap3LBTzHfOyuRKRBBsKJH89i1XaEjJBgv0vrxxuhwoKhQELr6Ppk+KjlOvoW vu0F67IJPhxdPyk7vhfM5tzEVTbMlNiE+tPIeMeTwflcOdHoWGpO7wYNXh7tKXkVo2ZRHAHSGZL COPMTtTYXWaKx2LfQKQ/jKk6ZLrITjd7fLZv/B+O8bpkOo+2lIvvB9NC/6P34mmko46Ks3tn3Qb CJOovOXG5JEk71mcKIVj5jjOOgw3b0= X-Received: by 2002:a05:600c:4e92:b0:490:3b84:c106 with SMTP id 5b1f17b1804b1-4903b84c8ffmr28205435e9.26.1779366557662; Thu, 21 May 2026 05:29:17 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org Subject: [PATCH 1/3] target/arm: SVE2 FMAXP, FMINP must honour AH=1 Date: Thu, 21 May 2026 13:29:11 +0100 Message-ID: <20260521122913.1565011-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260521122913.1565011-1-peter.maydell@linaro.org> References: <20260521122913.1565011-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; 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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1779366655481154100 Content-Type: text/plain; charset="utf-8" The behaviour of floating-point maximum and minimum insns has some odd special cases when FPCR.AH=3D1. We get this right in most places (for instance, the ASIMD FMAXP, FMINP) but forgot about it for the SVE2 versions of FMAXP and FMINP. Cc: qemu-stable@nongnu.org Fixes: 384433e70983 ("target/arm: Implement FPCR.AH semantics for FMINP and= FMAXP") Signed-off-by: Peter Maydell Reviewed-by: Alex Benn=C3=A9e --- target/arm/tcg/helper-sve-defs.h | 14 ++++++++++++++ target/arm/tcg/sve_helper.c | 8 ++++++++ target/arm/tcg/translate-sve.c | 4 ++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/target/arm/tcg/helper-sve-defs.h b/target/arm/tcg/helper-sve-d= efs.h index c3541a8ca8..cd05dd0fb4 100644 --- a/target/arm/tcg/helper-sve-defs.h +++ b/target/arm/tcg/helper-sve-defs.h @@ -2914,6 +2914,20 @@ DEF_HELPER_FLAGS_6(sve2_fminp_zpzz_s, TCG_CALL_NO_RW= G, DEF_HELPER_FLAGS_6(sve2_fminp_zpzz_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, fpst, i32) =20 +DEF_HELPER_FLAGS_6(sve2_ah_fmaxp_zpzz_h, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, fpst, i32) +DEF_HELPER_FLAGS_6(sve2_ah_fmaxp_zpzz_s, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, fpst, i32) +DEF_HELPER_FLAGS_6(sve2_ah_fmaxp_zpzz_d, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, fpst, i32) + +DEF_HELPER_FLAGS_6(sve2_ah_fminp_zpzz_h, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, fpst, i32) +DEF_HELPER_FLAGS_6(sve2_ah_fminp_zpzz_s, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, fpst, i32) +DEF_HELPER_FLAGS_6(sve2_ah_fminp_zpzz_d, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, fpst, i32) + DEF_HELPER_FLAGS_5(sve2_eor3, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i= 32) DEF_HELPER_FLAGS_5(sve2_bcax, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i= 32) DEF_HELPER_FLAGS_5(sve2_bsl1n, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, = i32) diff --git a/target/arm/tcg/sve_helper.c b/target/arm/tcg/sve_helper.c index 062d8881bd..179cbd74fb 100644 --- a/target/arm/tcg/sve_helper.c +++ b/target/arm/tcg/sve_helper.c @@ -778,6 +778,14 @@ DO_ZPZZ_PAIR_FP(sve2_fminp_zpzz_h, float16, H1_2, floa= t16_min) DO_ZPZZ_PAIR_FP(sve2_fminp_zpzz_s, float32, H1_4, float32_min) DO_ZPZZ_PAIR_FP(sve2_fminp_zpzz_d, float64, H1_8, float64_min) =20 +DO_ZPZZ_PAIR_FP(sve2_ah_fmaxp_zpzz_h, float16, H1_2, helper_vfp_ah_maxh) +DO_ZPZZ_PAIR_FP(sve2_ah_fmaxp_zpzz_s, float32, H1_4, helper_vfp_ah_maxs) +DO_ZPZZ_PAIR_FP(sve2_ah_fmaxp_zpzz_d, float64, H1_8, helper_vfp_ah_maxd) + +DO_ZPZZ_PAIR_FP(sve2_ah_fminp_zpzz_h, float16, H1_2, helper_vfp_ah_minh) +DO_ZPZZ_PAIR_FP(sve2_ah_fminp_zpzz_s, float32, H1_4, helper_vfp_ah_mins) +DO_ZPZZ_PAIR_FP(sve2_ah_fminp_zpzz_d, float64, H1_8, helper_vfp_ah_mind) + #undef DO_ZPZZ_PAIR_FP =20 /* Three-operand expander, controlled by a predicate, in which the diff --git a/target/arm/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c index aa7d72a35e..bf9f0ae179 100644 --- a/target/arm/tcg/translate-sve.c +++ b/target/arm/tcg/translate-sve.c @@ -7667,8 +7667,8 @@ TRANS_FEAT_NONSTREAMING(HISTSEG, aa64_sve2, gen_gvec_= ool_arg_zzz, DO_ZPZZ_FP(FADDP, aa64_sme_or_sve2, sve2_faddp_zpzz) DO_ZPZZ_FP(FMAXNMP, aa64_sme_or_sve2, sve2_fmaxnmp_zpzz) DO_ZPZZ_FP(FMINNMP, aa64_sme_or_sve2, sve2_fminnmp_zpzz) -DO_ZPZZ_FP(FMAXP, aa64_sme_or_sve2, sve2_fmaxp_zpzz) -DO_ZPZZ_FP(FMINP, aa64_sme_or_sve2, sve2_fminp_zpzz) +DO_ZPZZ_AH_FP(FMAXP, aa64_sme_or_sve2, sve2_fmaxp_zpzz, sve2_ah_fmaxp_zpzz) +DO_ZPZZ_AH_FP(FMINP, aa64_sme_or_sve2, sve2_fminp_zpzz, sve2_ah_fminp_zpzz) =20 static bool do_fmmla(DisasContext *s, arg_rrrr_esz *a, gen_helper_gvec_4_ptr *fn) --=20 2.43.0 From nobody Sat May 30 17:45:08 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1779366719; cv=none; d=zohomail.com; s=zohoarc; b=CpiBZbAcWoXKliMOwaNQ+E8wlvNrcxJBXjiUGbKhK5iyDOIY+dB/d7dHHdduCnM4+dD7SFXQ54INDmQhPVqLYhKEy7GY3/LIBxLIOm+jAgj+EwJFZ2DhxeAQNg/fOqexedas4VuAFPFaOAJSy9kI0aUCcVHtaLPOy74ADoFFh9Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779366719; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fH5hlcFtdcnQevD+hJ39wNb6pHC99dGw7i2XR1TiCJs=; b=jmCow0KeUXty6ZBNlHMRvjIRb307IEq6+RU75+UdhRqHqYpz3GDlr+CF1XhIO6KbIeLMzKc8Nc8qpWxaWbwNfab6cPAeml4PODAON/NsOgn2gQFjNCSruBexeSZy8iMpPKFMY6XqEJOGBCZ0BLe9Hr3KEcsqCrLcfMBLP8RTfTQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1779366719973575.3143239415527; Thu, 21 May 2026 05:31:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wQ2YI-0001je-4J; Thu, 21 May 2026 08:31:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wQ2Wg-0000y5-MY for qemu-devel@nongnu.org; Thu, 21 May 2026 08:29:28 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wQ2We-0001ci-T7 for qemu-devel@nongnu.org; Thu, 21 May 2026 08:29:22 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-48d146705b4so67258925e9.3 for ; Thu, 21 May 2026 05:29:20 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49035c72c78sm22054245e9.3.2026.05.21.05.29.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2026 05:29:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1779366559; x=1779971359; 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=fH5hlcFtdcnQevD+hJ39wNb6pHC99dGw7i2XR1TiCJs=; b=HMT0T6vUmEu5TDOCS7UZ9lnuM55eRyhXIjS1IxesuuTg/OV8l2nb/lMMnzqG46eQWp a+Szctsde/0LIZUrUpy7baQrJxYcKM6JL3lDPbMw+LcDVo9HlmOQ0wUTfgzmCJiL24xI 8XX/E1m5U2VCDn/BW6XdtoAgu2E8jY51+MhsZlnjKhlUXKPV1ZRVEAGbx6nN28VsS5MT ixICat+zi4DKuxDfKTxr243BOv2V23ZLolwVVJcTFcmxRjJYnMYhRlf8/qgvziZiIIFn 9N5EKGtaB4DkHCPeFpKKA5Aiupo8KLZzdYYnTxJsA0baqUFuW3uWhJT9j7BBgYdnDRao Se8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779366559; x=1779971359; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fH5hlcFtdcnQevD+hJ39wNb6pHC99dGw7i2XR1TiCJs=; b=k+Zp1k6Y9o3w5aWGan6huSuK14vYZxnHL+kMM2MGjatPgGneny8rPK3MPU1BOcetC4 r18WVaeDef18GiZtUHA2cTvHxAs9vm/Z2v1+ze7+Z1WTbyhMc1Is8FBgMVjJL6h16Tlu PmaHwGDgyabY4D2u+wZGVC/36uX0UhpRVc5Auk1LFRPTEXPYcCjAgLhzKY1hsnRRKslR PNgHvjust1lQqYbW7geX3I/xxCZgqk6qt8p5U0OvzlQGjkHBQ+ft7Dpe8Uj6desQMNQZ O9oR0p2oBcWADTM1vN5RtEyFRQhW3HhChNcmBD5Jm264o2nQ0YJtbS7tO9rIFd65CUVq NVzw== X-Forwarded-Encrypted: i=1; AFNElJ870mjc2nOdzDe0xEzWv2B+OhFpruT8Tk3jpZccpd8v3UONDolm6v1uF0quI4uM4YuDfEqGhyDcZOrD@nongnu.org X-Gm-Message-State: AOJu0YxBOxwYKnemLXySQ7BHv15Yh25oBxJf2/g2+8L8y0Svi7moYyox BcUKshbcpmyOf05VK3cu3PcE4rWgi8jyC0P7x+x9C7bwZYe+7sqwjCvxxkd3MvqneERNYz/BqJf K5t5q X-Gm-Gg: Acq92OE/j6+bpUbq6qEc8JPO6hzOtvSP41ZyL+5OHCmPV1ew2AYk4tduRUQn88ndDeD R5/uUuNKzy8EwjnMYZiPAyyAuv2XufRav0PIiJRduza0Z5d+wgGPLTGmbELDerMuzE7AgbusWBy dqvuRcqhm2PJNtpKUal5k8ykMrva+VOhYiamzRHU2eIJE3r3d/UvWta/52STN40YLKf79gG8ISP TETZe3KtsKQU8NMfVm5V9Jg/Rv3OJydnCOJ4HeHQ+ZO8OW1d6w0qaPye3qgZpnasp8OEuE9YzgG U3w0zLXGoe5d9sYaVr5ZEOPGUvWr/R/Ges2S3N0qGjitbeBmfF9VZa61YY8jawsbNTQar/yNt+Z 0o2hwAQ9tMJWymFjplD6ZchLMHOvtcMtDBAaZC4t5UpRrSYb0eTLmfEmnkznduAeL/kBImuLVls A+ks/ooxFe//uwIxqrmmdeBJZ7SL0fWHYoRxRH9tpZ6j/7Vu1dfXSnnjLaXXnVTxEt1FY6+C76f 1jlM53OhLkR/cPMO8omibLb3ytBhFs= X-Received: by 2002:a05:600c:1f89:b0:488:d6eb:e63c with SMTP id 5b1f17b1804b1-4903607fd11mr35515065e9.15.1779366559242; Thu, 21 May 2026 05:29:19 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org Subject: [PATCH 2/3] target/arm: Use FPST_A64_F16 for SVE FCVTLT_hs Date: Thu, 21 May 2026 13:29:12 +0100 Message-ID: <20260521122913.1565011-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260521122913.1565011-1-peter.maydell@linaro.org> References: <20260521122913.1565011-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1779366722515154100 Content-Type: text/plain; charset="utf-8" The SVE FCVTLT_hs operation produces a halfprec result, so we should use the FPST_A64_F16 fpstatus for it. Getting this wrong means we will incorrectly set FPCR.IDC for input-denormals when FPCR.AH=3D1. We missed this instruction when we updated the halfproc-to-other conversion insns to use FPST_A64_F16 in commit e07b48995aaa as part of implementing FEAT_AHP. Cc: qemu-stable@nongnu.org Fixes: e07b48995aaa ("target/arm: Use FPST_A64_F16 for halfprec-to-other co= nversions")a Signed-off-by: Peter Maydell Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- target/arm/tcg/translate-sve.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c index bf9f0ae179..59b8c494a8 100644 --- a/target/arm/tcg/translate-sve.c +++ b/target/arm/tcg/translate-sve.c @@ -7827,7 +7827,7 @@ TRANS_FEAT(BFCVTNT, aa64_sme_sve_bf16, gen_gvec_fpst_= arg_zpz, s->fpcr_ah ? FPST_AH : FPST_A64) =20 TRANS_FEAT(FCVTLT_hs, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, - gen_helper_sve2_fcvtlt_hs, a, 0, FPST_A64) + gen_helper_sve2_fcvtlt_hs, a, 0, FPST_A64_F16) TRANS_FEAT(FCVTLT_sd, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, gen_helper_sve2_fcvtlt_sd, a, 0, FPST_A64) =20 --=20 2.43.0 From nobody Sat May 30 17:45:08 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1779366694; cv=none; d=zohomail.com; s=zohoarc; b=j+SphkhzhBE1xH59S4LS3iRaipOuLg3xS+iylmUachDQMwJTUwDBnqT5sW9L0joWDa5J+veaqyRVXU/3xzEFt2ZoWM10NBY88BDvpIVy16A6UYSQecZKvzJiJD+E1SG5OSn8unmVcfwmKQWcpORQbWCNOwQWwFXltuSDbJ32va0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779366694; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Pryi5TKCDpB8CFidgAdyXB10hiTus4CQlxwL4fbFbdo=; b=VJiR/foZVIEQrHBujUKFyw8PiKv312Mrc5YgsyFL6shJDOvLi4rCQ940Uz4/L+Ib+gJghLEJMndlZoA2XH4eRXQ2jRcabRewd7+GG/oXVNd4Ynyd0/MCnKhMsQPTUh8tqHqXnkTYsvPN7QIt6nkt2TTxxJxnBoQSytvC7czQDOw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1779366694702644.5384089894382; Thu, 21 May 2026 05:31:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wQ2Y3-0001WF-D9; Thu, 21 May 2026 08:30:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wQ2Wi-0000y8-4x for qemu-devel@nongnu.org; Thu, 21 May 2026 08:29:30 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wQ2Wg-0001dK-Ew for qemu-devel@nongnu.org; Thu, 21 May 2026 08:29:23 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4903d5c67bfso1419905e9.1 for ; Thu, 21 May 2026 05:29:21 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49035c72c78sm22054245e9.3.2026.05.21.05.29.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2026 05:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1779366561; x=1779971361; 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=Pryi5TKCDpB8CFidgAdyXB10hiTus4CQlxwL4fbFbdo=; b=wNBbZy6UK44dmLcQnDZxIHTNJ4Q+eyhVdOLwGiatWNjmijH5MnylNFcJc8g1oa9eR2 4+30eg+od6xtCcfY1kMRk0+4AMguvLNM2dV5gg+K9+vTRajCxHa43qoSSa2u7HSaWog/ Jia1YoXOF7xT8+kCo2dQREI4Cyktg46nscfY519MDuUdXdXErHMGd1f/ZdTVxHzeja9+ iqbnxgzk3bKCkWZDzAwL1RjI9GZE5FvkEVYzKAsGMT/xL9ZYBbwZpRfRgnSFT7XsTPaV ZhJQj7u9HIkSt0CYHZXw+7iN86JpxzLKjEYOafCn4umT2IL5QOAScd4RnzCGmreB4Ihj 2oXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779366561; x=1779971361; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Pryi5TKCDpB8CFidgAdyXB10hiTus4CQlxwL4fbFbdo=; b=acM7Jr1bGQMcjnPrF9r0D5NTK5wANX5YK8kZt1Ftc+pgv5aDzNrwC5ZyerJdT33YF+ flBlvIg4wc0UoTPoODQenuz/QBzHFuQ8cZpt8nPapzRysulbSREf4cX052wSJRLqIAjD Q6q9dIMReueZAbavTtk+Ji7zHiuz95gAw/k24A/Q/VepJ6BY8VpQlYxAnzpihi0vUnpv dpl9Q7MdWmRUcWyHGLVItcLz6+ECrzq6vpYSa6sqsH76PHW/JIKANvnGh7QZPgd6i+81 hfG/tX31ciCiXxMv1opYKdkZdIDpGptqNE/qJnZiaTFvOfYaRojCtiYS4apDq7+SG1Cq Yv/g== X-Forwarded-Encrypted: i=1; AFNElJ9RIYNkW7iGSfHgnYPAKqBvhS+sB2YIeOvKGI5TXylUt1sbQJAKEujmtV85bpJ9LTaMkRU7ASs8Xwom@nongnu.org X-Gm-Message-State: AOJu0YynzDEGQxv/0RrCBZDsYJAGkqBnJ6b/x5hnxz2IemlOKMky4A85 L8YOgNH7ciXPr09rklj2vIVZbuGTNYBbxYnfQr5gBgBtX/8WVqArqYM3NR8T40s2YP8= X-Gm-Gg: Acq92OGS4oBRoLkcZeWGGijkmHS5X0TQhj0eGyI9X5pebaZMWAiM7Uh94OFVKhUconG V+VUIL6lKGeRQsLTB8uuiyOH61xz5LnE1mnP5tue13dqTTeo8ujuVI+bMbya6EqQ1k9xGNABQGK J4zu6f1wcHbNQLt0haPEC3xZ0cT5B3llR6kZm9l7Rqgde7/srkRgaqqsf2Snb0xnWLT4KXNiXub 9iJG/GEhlegzR9mUWRuH999ZRMlOY1EqZTRKNpCCMzdE4sTduxG7Pk9zbrfN2rEYoG+lEwkMX8y UDYyYEjYNK7EjeY2Sv4JLZpZVc3pmuAnzVE300MriTHdYi6mOunC2cr/HVMMRVV3OyLHFjtSnJL CpTlBF3djr4HnYbUUiuXpAihefad90VWKfj4niPtWFFiZg06Ap4WNk5JaWVDZp+FYKCscJsG4uU J6XMG54cWIg8uhnFDKg59pVTRuuJpbJuYvo/VJ6pHYAxBeN27nkbYi4656Jfawa1FGDi7cdsJcI fFv5FnekozJewMDH4yQAXgb9pbmNvR+hFxQyvzUDQ== X-Received: by 2002:a05:600c:1f89:b0:48a:8905:a500 with SMTP id 5b1f17b1804b1-49036080e18mr36554365e9.12.1779366560954; Thu, 21 May 2026 05:29:20 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org Subject: [PATCH 3/3] target/arm: Set correct fp flags for FLOGB when FPCR.AH = 1 Date: Thu, 21 May 2026 13:29:13 +0100 Message-ID: <20260521122913.1565011-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260521122913.1565011-1-peter.maydell@linaro.org> References: <20260521122913.1565011-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1779366698237154100 Content-Type: text/plain; charset="utf-8" Our implementation of the FLOGB insn does the operations entirely in the helper function, without needing to use fpu functions. This means it needs to handle all the fp status flags itself. We aren't setting float_flag_input_denormal_used when we use (i.e. do not flush to zero) an input denormal, which means that FPCR.IDC isn't set when it should be for FPCR.AH=3D1. We missed this when we added float_flag_input_denormal_used and made the fpu/ code set it. Add the missing float_raise(). Cc: qemu-stable@nongnu.org Fixes: d38a57a3f ("target/arm: Enable FEAT_AFP for '-cpu max'") Signed-off-by: Peter Maydell Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- target/arm/tcg/sve_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/arm/tcg/sve_helper.c b/target/arm/tcg/sve_helper.c index 179cbd74fb..d884ba474f 100644 --- a/target/arm/tcg/sve_helper.c +++ b/target/arm/tcg/sve_helper.c @@ -5036,6 +5036,7 @@ static int16_t do_float16_logb_as_int(float16 a, floa= t_status *s) if (frac !=3D 0) { if (!get_flush_inputs_to_zero(s)) { /* denormal: bias - fractional_zeros */ + float_raise(float_flag_input_denormal_used, s); return -15 - clz32(frac); } /* flush to zero */ @@ -5064,6 +5065,7 @@ static int32_t do_float32_logb_as_int(float32 a, floa= t_status *s) if (frac !=3D 0) { if (!get_flush_inputs_to_zero(s)) { /* denormal: bias - fractional_zeros */ + float_raise(float_flag_input_denormal_used, s); return -127 - clz32(frac); } /* flush to zero */ @@ -5092,6 +5094,7 @@ static int64_t do_float64_logb_as_int(float64 a, floa= t_status *s) if (frac !=3D 0) { if (!get_flush_inputs_to_zero(s)) { /* denormal: bias - fractional_zeros */ + float_raise(float_flag_input_denormal_used, s); return -1023 - clz64(frac); } /* flush to zero */ --=20 2.43.0