From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C2E8638754AB; Thu, 4 Mar 2021 04:02:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C2E8638754AB From: "sgk at troutmask dot apl.washington.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/95644] [F2018] IEEE_FMA is missing from the IEEE_ARITHMETIC module Date: Thu, 04 Mar 2021 04:02:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 9.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sgk at troutmask dot apl.washington.edu X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 04:02:24 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95644 --- Comment #11 from Steve Kargl = --- On Thu, Mar 04, 2021 at 02:22:46AM +0000, jvdelisle at gcc dot gnu.org wrot= e: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95644 >=20 > --- Comment #10 from Jerry DeLisle --- > It is very likely that the gcc optimizers will actually convert the to fma > machine instructions, but no guarantee. That's what __builtin_fma() will do. The second kludge I posted would still have the layer of indirection of calling on of fma04, fma08, fma10, or fma16. Also, note that the kludge declares these as IMPURE ELEMENTAL because of the BIND(C) stuff. This is technically incorrect. > I don't have much time, but it is likely some of the tricks we used in ma= tmul > can be used to get this to be "register" implemented . The correct approach would give interfaces in the ieee_arithmetic so that argument checking can be done. The implementation details would be contained in trans-intrinsic.c where conv_intrinsic_fma() is called and __builtin_fma is directly emitted. Another approach, where conv_intrinsic_fma() is unneeded, would be to register __builtin_fma() as builtin function with gfortran. This, however, requires more work because gfortran currently does not have a mechanism for registering a 3 argument builtin function.=