From: "Gabriel F. T. Gomes" <gabriel@inconstante.eti.br>
To: Joseph Myers <joseph@codesourcery.com>
Cc: <libc-alpha@sourceware.org>
Subject: Re: [PATCH 2/3] powerpc: Add redirection for finitef128, isinf128, and isnanf128
Date: Fri, 08 Sep 2017 15:25:00 -0000 [thread overview]
Message-ID: <20170908122540.4ee0fffb@keller> (raw)
In-Reply-To: <alpine.DEB.2.20.1709071437260.21759@digraph.polyomino.org.uk>
On Thu, 7 Sep 2017 14:39:42 +0000
Joseph Myers <joseph@codesourcery.com> wrote:
>On Thu, 7 Sep 2017, Gabriel F. T. Gomes wrote:
>
>> This patch defines __finitef128 as __redirect___finitef128 in
>> sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c, similarly to what's
>> done for the float, double, and long double versions of these functions,
>> to get rid of the build error. Likewise for isinff128 and isnanf128.
>
>What is the build error? Why should s_finite.c need to redirect
>__finitef128, or to redirect __finitef or __finitel for that matter?
>s_finitef.c manages to redirect only __finitef, not any of the other
>versions, after all.
I'm sorry for not making this clear in the patch itself. I'll try to
explain what was my rationale and if that sounds OK, I'll add that to the
commit message and comments.
This is the build error:
In file included from <command-line>:0:0:
../include/math.h:29:15: error: ‘__finitef128’ undeclared here (not in a function); did you mean ‘__rintf128’?
hidden_proto (__finitef128)
^~~~~~~~~~~~
./../include/libc-symbols.h:518:27: note: in definition of macro ‘__hidden_proto’
extern thread __typeof (name) name __hidden_proto_hiddenattr (attrs);
^~~~
../include/math.h:29:1: note: in expansion of macro ‘hidden_proto’
hidden_proto (__finitef128)
^~~~~~~~~~~~
The output of the preprocessor has the following lines (snippets):
# 21 "../math/bits/mathcalls-helper-functions.h"
[...]
extern int __redirect___finite (double __value) __attribute__ ((__nothrow__ )) __attribute__ ((__const__));
[...]
extern int __redirect___finitef (float __value) __attribute__ ((__nothrow__ )) __attribute__ ((__const__));
[...]
extern int __redirect___finitel (long double __value) __attribute__ ((__nothrow__ )) __attribute__ ((__const__));
[...]
extern int __redirect___finitef128 (_Float128 __value) __attribute__ ((__nothrow__ )) __attribute__ ((__const__));
(from the multiple inclusions of mathcalls-helper-functions.h (see comment
about the differences between s_finite.c and s_finitef.c further down this
message))
But include/math.h declares hidden prototypes for them (snippet):
# 9 "../include/math.h" 2
[...]
extern __typeof (__redirect___finite) __redirect___finite __attribute__ ((visibility ("hidden")));
[...]
extern __typeof (__redirect___finitef) __redirect___finitef __attribute__ ((visibility ("hidden")));
[...]
extern __typeof (__redirect___finitel) __redirect___finitel __attribute__ ((visibility ("hidden")));
[...]
extern __typeof (__finitef128) __finitef128 __attribute__ ((visibility ("hidden")));
~~~~~~~~~~~
Here's the source of the error.
As for the difference between s_finite.c and s_finitef.c, that happens
because include/math.h includes math/math.h before creating the hidden
prototypes.
On top of that, math/math.h includes bits/mathcalls-helper-functions.h
(once for each floating-point type). However, the declarations in
bits/mathcalls-helper-functions.h are macroized using __MATHDECL_1.
__MATHDECL_1 receives the suffix (f, l, f128, or nothing) as a parameter
and expands the base name (e.g.: __finite).
When s_finite.c defines __finite as __redirect_finite, all declarations in
bits/mathcalls-helper-functions.h are also redefined. That doesn't happen
with s_finitef.c because it only defines __finitef, which does not match
with anything in bits/mathcalls-helper-functions.h.
next prev parent reply other threads:[~2017-09-08 15:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-07 10:44 [PATCH 0/3] Fixes for -mfloat128 being enabled by default on gcc for power Gabriel F. T. Gomes
2017-09-07 10:44 ` [PATCH 3/3] powerpc64le: Disable compiler support for float128 when reusing ldbl-128 Gabriel F. T. Gomes
2017-09-07 14:45 ` Joseph Myers
2017-09-07 10:44 ` [PATCH 1/3] powerpc: Add -mfloat128 to tst-strtod-nan-locale testcase Gabriel F. T. Gomes
2017-09-07 10:44 ` [PATCH 2/3] powerpc: Add redirection for finitef128, isinf128, and isnanf128 Gabriel F. T. Gomes
2017-09-07 14:39 ` Joseph Myers
2017-09-08 15:25 ` Gabriel F. T. Gomes [this message]
2017-09-08 16:24 ` Joseph Myers
2017-09-26 22:05 ` [PATCH 0/3] Fixes for -mfloat128 being enabled by default on gcc for power Joseph Myers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170908122540.4ee0fffb@keller \
--to=gabriel@inconstante.eti.br \
--cc=joseph@codesourcery.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).