public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: "Gabriel F. T. Gomes" <gftg@linux.vnet.ibm.com>
Cc: <libc-alpha@sourceware.org>
Subject: Re: [PATCH 3/8] float128: Add wrappers for IEEE functions.
Date: Wed, 07 Dec 2016 21:47:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.20.1612072133300.28567@digraph.polyomino.org.uk> (raw)
In-Reply-To: <20161207173544.36123848@keller.br.ibm.com>

On Wed, 7 Dec 2016, Gabriel F. T. Gomes wrote:

> > Source files in sysdeps certainly take precedence; that's by design, so 
> > that architectures can easily have their own implementations that override 
> > the templates.  Are you saying that this only works for source files in 
> > sysdeps and not for those in math/?
> 
> When building from sysdeps (e.g. sysdeps/ieee754/ldbl-opt/w_acosl.c),
> the command that is used to build it, puts <build_dir>/math first in
> the include search path:
> 
> gcc ../sysdeps/ieee754/ldbl-opt/w_acosl.c [...] -I../include
> -I/home/gftg/build/glibc/math  -I/home/gftg/build/glibc
> -I../sysdeps/unix/sysv/linux/powerpc/powerpc64le/fpu [...]
> 
> And that will make sysdeps files try to use the new, auto-generated
> wrappers:
> 
> In file included from /home/gftg/build/glibc/math/w_acosl.c:2:0,
>                  from ../sysdeps/ieee754/ldbl-opt/w_acosl.c:4:
> ./w_acos_template.c:1:2: error: #error 
> 
> Is that what you expected?

Well, the detailed design is Paul's; I don't know if he considered the 
case of wanting a non-type-generic file in math/ to override a 
type-generic one.

> Is it OK to have <build_dir>/math be searched first for include files?

It looks like there are two possible issues involved.

(a) Which .c file gets built if there aren't any in sysdeps?  Is it the 
one in math/ in the source directory, or the one generated in the build 
directory?

(b) When sysdeps files do a #include of w_* files, where do those 
#included files come from?

Your command line shows a problem with (b): because of the -I of the 
*top-level* build directory (not that of the math/ subdirectory), 
"#include <math/w_acosl.c>" wrongly includes the generated file.

In my previous comments I was thinking of (a).  But it doesn't really 
matter, as renaming the existing files like I suggested (and updating the 
#includes of them) would solve both issues.  (Moving them into 
sysdeps/generic without renaming would probably also do the trick, but 
that's uglier and I don't think it's really any easier since you still 
need to update the #includes wherever you move them.)

> For this first part.. this is independent of the other patches, right?
> Is the attached patch in the lines of what you had in mind?
> (I just wrote it for log1p, because I still don't know what to do about
> scalbln (I think I can't use declare_mgen_alias because w_scalbln
> doesn't create a strong alias).  Besides, I still don't know how to
> deal with the IS_IN (libm) test in
> sysdeps/ieee754/ldbl-64-128/w_scalblnl.c)

For scalbln, look at math/s_ldexp_template.c and the ldbl-opt s_ldexp* 
files for an example - the issues are pretty similar.

For log1p, I'd expect the template file to use -1 (or M_LIT (-1.0) in the 
islessequal call) rather than the double value -1.0.  And I'd hope that 
you can remove the ldbl-128ibm/w_log1pl.c and ldbl-64-128/w_log1pl.c files 
completely and the generated file will do the right thing automatically.

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2016-12-07 21:47 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-09 18:41 [PATCH 0/8] More float128 declarations Gabriel F. T. Gomes
2016-11-09 18:41 ` [PATCH 1/8] ldbl-128: Use mathx_hidden_def inplace of hidden_def Gabriel F. T. Gomes
2016-11-09 18:41 ` [PATCH 3/8] float128: Add wrappers for IEEE functions Gabriel F. T. Gomes
2016-11-09 21:38   ` Joseph Myers
2016-12-05 16:48     ` Gabriel F. T. Gomes
2016-12-05 18:51       ` Joseph Myers
2016-12-05 22:52         ` Steven Munroe
2016-12-06  0:31           ` Joseph Myers
2016-12-06  2:39             ` Steven Munroe
2016-12-07 19:36         ` Gabriel F. T. Gomes
2016-12-07 21:47           ` Joseph Myers [this message]
2016-12-09 21:24             ` Gabriel F. T. Gomes
2016-12-14  0:47               ` Joseph Myers
2016-12-14 13:36                 ` Gabriel F. T. Gomes
2016-12-14 14:33                   ` Joseph Myers
2016-11-09 18:41 ` [PATCH 6/8] float128: Expose _Float128 finite math functions Gabriel F. T. Gomes
2016-11-09 22:06   ` Joseph Myers
2017-03-03 20:17     ` Gabriel F. T. Gomes
2017-03-03 20:50       ` Joseph Myers
2016-11-09 18:41 ` [PATCH 4/8] Add support for testing __STDC_WANT_IEC_60559_TYPES_EXT__ Gabriel F. T. Gomes
2016-11-09 21:42   ` Joseph Myers
2016-11-09 18:41 ` [PATCH 5/8] float128: Add public _Float128 declarations to libm Gabriel F. T. Gomes
2016-11-09 22:04   ` Joseph Myers
2016-11-09 18:41 ` [PATCH 8/8] float128: Add wrappers to override ldbl-128 as float128 Gabriel F. T. Gomes
2016-11-09 22:13   ` Joseph Myers
2016-11-09 18:41 ` [PATCH 2/8] float128: Add _Float128 make bits to libm Gabriel F. T. Gomes
2016-12-09 21:23   ` Tulio Magno Quites Machado Filho
2016-12-12 22:49     ` Joseph Myers
2016-11-09 18:41 ` [PATCH 7/8] float128: Add private _Float128 declarations for libm Gabriel F. T. Gomes
2016-11-09 22:08   ` Joseph Myers
2016-11-10 22:13   ` Joseph Myers
2016-11-09 21:31 ` [PATCH 0/8] More float128 declarations Joseph Myers
2016-11-09 23:52   ` 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=alpine.DEB.2.20.1612072133300.28567@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=gftg@linux.vnet.ibm.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).