Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 535BB606A325 for ; Mon, 30 Nov 2026 20:18:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=gBAPMwko Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xY7oU-0002X0-E0; Mon, 30 Nov 2026 15:17:26 -0500 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 1xY7nh-00026o-UJ for qemu-devel@nongnu.org; Mon, 30 Nov 2026 15:16:50 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xY7nb-0003a5-UA for qemu-devel@nongnu.org; Mon, 30 Nov 2026 15:16:36 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4bb55cda775so66809735e9.0 for ; Mon, 30 Nov 2026 12:16:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1796069787; x=1796674587; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=19j/VJP51/sLC8HkS7xPLPXx4gT5Qz26M2deoe+NLXc=; b=gBAPMwkoLnQ4i8r0Beq1rn8VrCzn4kR9XJt93w0GgxthGz1tj7N/YI7B7qQhr9KbAP nuE+effWj/ntdoLA1PwJBqb0S/uan2+5fno8dCmtUU0/FW5eDMz/mHL4e1qLnQIofUdA qrYjkMyd7Yd09LZJYxGhJ2W94Y0AAQ6jwqmxnPHw0bFpHssiqPprAdQxI32DWGWF8VEn 4HQvgNl+bEJVxEppac6B6Rv1SquZg3dgJMWPoNtWphKaecHY0LX9E5b19Jlx5EG+vrI7 KoN/rxaZcz8aS49N7FrhWwavdeJ908IHJHw/+hJ9AFLCl4xZFf8Wow6glborRvQ4lH6Q lhBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796069787; x=1796674587; h=content-transfer-encoding:content-type: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 :content-type; bh=19j/VJP51/sLC8HkS7xPLPXx4gT5Qz26M2deoe+NLXc=; b=sAQs/xB/gSZ5vQyEvPQfJyKtLfagumh2pU4CKCAA3oO7TA7FpqQqcyim6jpSZVWlpN mmepeaTU5u8GAEzrHKIOtQOMm5NIQ09TeJk8yt5PIRnwlzRcqr6Lapwr3zUUkxpqTGvd AjOQr2lWIUY0gYJbpsVJzpAExNMW0OoFCo2ji5RGU4eemdqw/tImpVp+DgHY4yRusfPm 0W1FznWLE1STOhj1R0QmbXH8cZhXSIHBorwiM+om3SdlPYI4Txiby2KmkSxFFvny6Zi/ GU0vOoZWQljUUxGbYfwDTZeD9XHcfG8MFloIyuRwajB7iDXIEd87bjcEM8iOyheJOpO+ 03DA== X-Gm-Message-State: APuU4Z/NzDXbdtiEXaRS8YBG4V1c0V9qdPdJ/WztapTpq1xlExlyx41Z dzbGxe17pVMy3mJMKQAlTLusinyah+ihb8FI6sDFZsiIBxo4C9nNJiLROT6f0cUYTMQ= X-Gm-Gg: AZFdTZdHOsvw8PAn9pewexH+EEsAf/2atdVUYf/WznhnQndOv/VC/KVDrBVM+LrAHx4 KR7ObQ/PYjFD28E115dGtGLtkbQhbJni8KUUDferm7zFFsJjXnY7EYOSbseXO8D/Wdh0ZIjPv2b ifajwcd5DSPWvjy+ugEwKg7qOZMuA65dfdEE93Xh/D1qEBfWC4LQurNK15s5eYsnSW0lZsbRlIO nhFSohZCDmUk1WHcT33aDtrDumJTxRjBAByWHwSIpdlG4VykJYPQe5cA82GYS2BhFnPJO9aNwFY tfwJLSJ06T/4/Rt5hJEsgfBlNgoxzYLPw3FDcXWnOVcb/3YqI3BCf9PLUyYpjLyzzkCVPj4ZsSb bfQwhs78p9BF21IwSSDWMjTMupHVvw75vY/Hf9GL00WaFeY2HDHTkFAzBOPRV9xFnaoKU4+OXrh 4OLAR6rGiYF8LGA36+seEs59tUTd2/P6bWM1gB1ewos0hHNF2lMyz7w/Y8/tXeg2LXWmCQzUTLU FAc1W2MhsH5y+KlV+WSTTMoPus9qBYCkMT9B/VQzoahhEVWOuuymzPG6gTDIe3tr+XRqiUa7Kh6 VepYydvCFaGToaSICP26KZS6UNSWig== X-Received: by 2002:a05:600c:3547:b0:4a1:c27d:e1a8 with SMTP id 5b1f17b1804b1-4bb8880b88fmr689586835e9.10.1796069786861; Mon, 30 Nov 2026 12:16:26 -0800 (PST) Received: from draig.lan ([185.124.0.158]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb88442693sm877373825e9.1.2026.11.30.12.16.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 12:16:26 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D89C95FA8F; Mon, 30 Nov 2026 20:16:23 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Yoshinori Sato , Liu Zhiwei , qemu-s390x@nongnu.org, Aleksandar Rikalo , David Hildenbrand , Laurent Vivier , Song Gao <17746591750@163.com>, Jiaxun Yang , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Xianglai Li , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Daniel Henrique Barboza , qemu-ppc@nongnu.org, Brian Cain , Nicholas Piggin , Ilya Leoshkevich , Alistair Francis , Helge Deller , Weiwei Li , Richard Henderson , Aurelien Jarno , Chao Liu , Pierrick Bouvier , Palmer Dabbelt , Stafford Horne , Glenn Miles , Harsh Prateek Bora , Chinmay Rath , Paolo Bonzini , Bibo Mao Subject: [PATCH 4/4] fpu/softfloat: gate hardfloat on working fmaf Date: Mon, 30 Nov 2026 20:16:22 +0000 Message-ID: <20261130201623.159433-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261130201623.159433-1-alex.bennee@linaro.org> References: <20261130201623.159433-1-alex.bennee@linaro.org> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.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-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-23.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_PASS,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 We already had a test against fma to catch broken glibc's but apparently there are mingw64 cases that are broken for fmaf on Windows. Add a test to softfloat_init so we can disable if we detect the brokenness. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/5023 Signed-off-by: Alex Bennée --- fpu/softfloat.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index bc244a44ffb..4531de5e6cf 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -5161,4 +5161,14 @@ static void __attribute__((constructor)) softfloat_init(void) if (ur.s != 0x0020000000000001ULL) { force_soft_fma = true; } + + /* + * Test that the host's fmaf is not obviously broken. For example, + * mingw-w64 can perform an incorrect fmaf on certain hosts; see + * https://gitlab.com/qemu-project/qemu/-/issues/5023 + * https://sourceforge.net/p/mingw-w64/bugs/848/ + */ + if (fmaf(FLT_MAX, 2.0f, -FLT_MAX) != FLT_MAX) { + force_soft_fma = true; + } } -- 2.47.3