This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Improving math function wrappers
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- Cc: <nd at arm dot com>, Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Tue, 4 Apr 2017 17:34:23 +0000
- Subject: Re: Improving math function wrappers
- Authentication-results: sourceware.org; auth=none
- References: <AM5PR0802MB2610AA7EDC518B39F6D7152683260@AM5PR0802MB2610.eurprd08.prod.outlook.com> <AM5PR0802MB261064538EBF55E8B7CF1F7783260@AM5PR0802MB2610.eurprd08.prod.outlook.com> <alpine.DEB.2.20.1703161407060.3566@digraph.polyomino.org.uk> <58CAD45E.6050601@arm.com> <alpine.DEB.2.20.1703161816370.18031@digraph.polyomino.org.uk> <58E3D6EE.6020601@arm.com>
On Tue, 4 Apr 2017, Szabolcs Nagy wrote:
> > Compilers for non-C languages without the concept of these functions
> > setting errno can of course default to -fno-math-errno by default (and
> > built-in no-errno functions that can be used with -fmath-errno is
> > otherwise enabled would also be desirable for fma, sqrt, etc.).
>
> then fortran can only use no-errno functions
> when those can be inlined, since extern calls
> use the standard libc symbols which set errno
> in glibc.
No, you should think of the implementation as a whole. The Fortran
compiler can know about what functions outside the standard are available
in the C libm, and so generate calls to such nonstandard functions where
appropriate. That can either be hardcoded information about functions in
particular glibc versions, or a system (e.g. file in the sysroot read by
the compiler) for glibc to communicate such information to the Fortran
compiler.
--
Joseph S. Myers
joseph@codesourcery.com