From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74194 invoked by alias); 7 Dec 2016 21:47:47 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 74185 invoked by uid 89); 7 Dec 2016 21:47:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_40,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=w_log1plc, UD:w_log1pl.c, w_scalbln, gomes X-HELO: relay1.mentorg.com Date: Wed, 07 Dec 2016 21:47:00 -0000 From: Joseph Myers To: "Gabriel F. T. Gomes" CC: Subject: Re: [PATCH 3/8] float128: Add wrappers for IEEE functions. In-Reply-To: <20161207173544.36123848@keller.br.ibm.com> Message-ID: References: <1478716859-3246-1-git-send-email-gftg@linux.vnet.ibm.com> <1478716859-3246-4-git-send-email-gftg@linux.vnet.ibm.com> <20161205144754.4c0c7c13@keller.br.ibm.com> <20161207173544.36123848@keller.br.ibm.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-SW-Source: 2016-12/txt/msg00257.txt.bz2 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 /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 /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 " 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