This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v2 9/10] Tilera (and Linux asm-generic) support for glibc
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Andrew Pinski <pinskia at gmail dot com>
- Cc: Chris Metcalf <cmetcalf at tilera dot com>, Roland McGrath <roland at hack dot frob dot com>, libc-alpha at sourceware dot org, Arnd Bergmann <arnd at arndb dot de>, Linas Vepstas <linas at codeaurora dot org>, Guan Xuetao <gxt at mprc dot pku dot edu dot cn>, Jonas Bonn <jonas at southpole dot se>, Chen Liqin <liqin dot chen at gmail dot com>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Fri, 11 Nov 2011 21:31:28 +0000 (UTC)
- Subject: Re: [PATCH v2 9/10] Tilera (and Linux asm-generic) support for glibc
- References: <201111100054.pAA0sf6u025585@farm-0002.internal.tilera.com> <201111100056.pAA0uKcv025809@farm-0002.internal.tilera.com> <20111111180905.A02A22C0F8@topped-with-meat.com> <4EBD81EA.3000605@tilera.com> <CA+=Sn1nGhhYy7wkEkjcXD-FrV-5eHJGfhZv9H3TJ+wQVQSnt3A@mail.gmail.com> <4EBD885D.7020308@tilera.com> <CA+=Sn1=C6WuHziV7fJR902hZ3L3H5ygAmZ3PKdVmHqBX_9qbsA@mail.gmail.com>
On Fri, 11 Nov 2011, Andrew Pinski wrote:
> On Fri, Nov 11, 2011 at 12:41 PM, Chris Metcalf <cmetcalf@tilera.com> wrote:
> > (The 16-bit swap would be done via __builtin_bswap32(x)>> Â16.)
> > If it's no worse for any platform, and better for some, that's
> > probably sufficient reason to make the change in glibc to use it.
>
> It does produce worse code if the target does not implement the
> patterns because the function is not inlined by default. It produces
> a call to bswapsi and bswapdi.
Out-of-line does not necessarily mean "worse"; it will be slower in
isolation, but probably results in smaller code size (for bswap32 and
bswap64, that is) and for most code in practice it seems reduced cache
usage produces speed gains that outweigh local slowdown from smaller code.
--
Joseph S. Myers
joseph@codesourcery.com