From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 446ED384F487; Fri, 18 Nov 2022 09:19:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 446ED384F487 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668763177; bh=kjroeR+nZLqyVf0V7+4kjgpenIKJW1+xtBehGIC9Pqo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=i5hP+t47z0KomEYQeNHGHkqLiEpHQ3QYpjNz/vnvFP0arVIrd9ePLqQ9Br2l0Mn1X WFSWf1+AycpRfsN3E4OI2R+SGAvicI1xM4XcOguv/XYpWD4hFUabNET3YpmpGobYTo sSbJIOYMI9ON5qEIpoCOSalJQfWAvzAkteEsNgrE= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107745] long double constexprs don't work with * or /, but work with + and - (JUST ON PPC) Date: Fri, 18 Nov 2022 09:19:36 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: DUPLICATE X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107745 --- Comment #4 from Jakub Jelinek --- I think we have many dups on this. IBM double double isn't accurately emul= ated inside of GCC (GCC emulation pretends it is a 106-bit mantissa type, which isn't true, e.g. for denormals it has only 53-bit mantissa, while in some c= ases it has up to 2000-ish bit mantissa), so the constant evaluation punts if computations in this mode are inexact, because they can differ from what one gets at runtime. Fixing this would involve representing MODE_COMPOSITE_P inside of gcc not as one REAL_VALUE_TYPE, but a pair of DFmode REAL_VALUE_TYPEs at least for the basic arithmetics and enforce on that the IBM double double constraints. What to do with constexpr evaluation of math functions, starting with nextafterl etc. is unknown, even libm is full of comments where it doesn't really know what to do for those cases. E.g. I think for nextafterl it mos= tly pretends it is a 106-bit mantissa type except for subnormals. Anyway, I'm afraid this is a month or more of work and so far nobody was willing to invest that time in a dying format with numerically unusable properties. powerpc64le-linux is phasing that out and switching to IEEE quad instead.=