From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [IPv6:2001:67c:2050:0:465::102]) by sourceware.org (Postfix) with ESMTPS id 6AC5D3858439 for ; Wed, 30 Nov 2022 10:04:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6AC5D3858439 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=gdcproject.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gdcproject.org Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4NMZZF6VL2z9sQc; Wed, 30 Nov 2022 11:04:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gdcproject.org; s=MBO0001; t=1669802693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E5YBt76Y4yUTtal9EdYZmaJhqvffRVq9ib1qi5JWm6I=; b=TohTwAFDIM1m9kWRsfqbo/QXOQi0WRthyytDOLncGrg+wv3iqMjtd+mOJDqQaV6uIA5sAH LRG3A5wLgwTvd6eGzQChfrB4AJv3R7/9R+7d83iFsjR2Ba6rmzo7fda5j1HI+62R0JWlx3 0ttq7PVFoQpGOnunoreGfF7stqwefVlvWu44UD8WCDnRZQfNtUScIIR3f4l93CRrSe/Xma osqCnr1qYQqZv05t3jUVcxsj+DXqfIJByMIxrgR7RZgHGAvcl7Q6WoJtHzGfxb6cEz975E 90VUIWQ8sYn9akjzB2DZy26YF4fiMSxxQ54mKmWml/C4aX8ujnnK0dLIBp+6aA== Date: Wed, 30 Nov 2022 11:04:49 +0100 From: Iain Buclaw Subject: Re: [PATCH] range-op: Implement floating point division fold_range [PR107569] To: Aldy Hernandez , Jakub Jelinek Cc: gcc-patches@gcc.gnu.org References: In-Reply-To: MIME-Version: 1.0 Message-Id: <1669801980.z33h1asvgy.astroid@pulse.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4NMZZF6VL2z9sQc X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Excerpts from Jakub Jelinek via Gcc-patches's message of November 11, 2022 = 10:09 am: > Hi! >=20 > Here is the floating point division fold_range implementation, > as I wrote in the last mail, we could outline some of the common parts > into static methods with descriptive names and share them between > foperator_div and foperator_mult. >=20 > Bootstrapped/regtested on top of the earlier version of the multiplicatio= n > fold_range on x86_64-linux and i686-linux, regressions are > +FAIL: gcc.dg/pr95115.c execution test > +FAIL: libphobos.phobos/std/math/hardware.d execution test > +FAIL: libphobos.phobos_shared/std/math/hardware.d execution test I've had some time to look at the Phobos failures, and seems to me that it's a poorly written test. pragma(inline, false) static void blockopt(ref real x) {} real a =3D 3.5; // Set all the flags to zero resetIeeeFlags(); assert(!ieeeFlags.divByZero); blockopt(a); // avoid constant propagation by the optimizer // Perform a division by zero. a /=3D 0.0L; assert(a =3D=3D real.infinity); assert(ieeeFlags.divByZero); blockopt(a); // avoid constant propagation by the optimizer 1. Since this patch, that `a /=3D 0.0L` operation no longer appears in the final assembly - so no divide-by-zero flags are raised. 2. Whoever introduced blockopt() perhaps did not understand that `a /=3D 0.0L` is not safe from constant propagation just because it is surrounded by some uninlinable call. I'll fix the test in upstream, it should really be something like: pragma(inline, false) static real forceDiv(real x, real y) { return x / y; } a =3D forceDiv(a, 0.0L); assert(a =3D=3D real.infinity); assert(ieeeFlags.divByZero); Regards, Iain.