This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fw: [PATCH 1/2] BZ#13743: PowerPC - Add a new header forplatform specific functions
- From: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- To: Michael R Meissner <mrmeissn at us dot ibm dot com>, "Carlos O'Donell" <carlos at systemhalted dot org>, Ulrich Drepper <drepper at gmail dot com>, David Edelsohn <edelsohn at gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>, libc-alpha at sourceware dot org, munroesj at linux dot vnet dot ibm dot com, Roland McGrath <roland at hack dot frob dot com>, ryan dot arnold at gmail dot com, SteveMunroe/Rochester/IBM at IBMUS dot the-meissners dot org, Thomas Schwinge <thomas at codesourcery dot com>, Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>
- Cc: meissner at linux dot vnet dot ibm dot com
- Date: Thu, 8 Mar 2012 15:22:24 -0500
- Subject: Re: Fw: [PATCH 1/2] BZ#13743: PowerPC - Add a new header forplatform specific functions
- References: <OF25143771.5D6AAC35-ON852579BB.006EE26B-852579BB.006EE6D2@us.ibm.com>
Steven Munroe <munroesj@linux.vnet.ibm.com> wrote on 03/08/2012 12:29:23
PM:
> Bringing David and Michael into the conversation.
>
> > > We need these to APIs to be easy to find, documented, and durable (a
> > > commitment to be there in the next release).
> >
> > Do you feel then that the GCC community is unable to make this
commitment?
> >
> Well as a Toolchain Architect I can see a separation between language
> issues and APIs where GCC is focused on language and GLIBC is focused on
> APIs. And I would put the timebase and program priority register into
> the API category.
>
> So the GCC community can and does make such commitments (for example the
> __sync_fetch_and_* builtins) that can be implemented cross platform. But
> I can see where they might decide that this specific case is not a good
> example for GCC to carry.
>
> But I should let David and Michael speak for themselves.
>
> > The GLIBC community could certainly make such a commitment, but final
> > responsibility rests with you and Ryan as the official power maintainers.
My opinion is that in the case of timebase, there should be a ppc get timebase
builtin in the compiler, that on 32-bit generates the 3 mfspr's, compare, and
branch and on 64-bit just the single mfspr.
In general, things like this should be in the compiler, since the compiler can
adjust costs, etc. and schedule insns, while just doing them as random asms
means the code is just a blob that the compiler can't schedule arround. Of
course you can get to having too many builtins (one might argue we are already
there), but in this case, I think the compiler should provide the builtin.
Obviously you have a staging issue, where it might be useful for platform.h or
ppc-platform.h or whatever does an #ifdef and if the compiler is new enough,
just generate the builtin, otherwise generate the asms.
--
Michael Meissner, IBM
5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA
meissner@linux.vnet.ibm.com fax +1 (978) 399-6899