This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: builtin_bswap plus enhancements
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: iant at google dot com (Ian Lance Taylor)
- Cc: echristo at apple dot com (Eric Christopher), gcc-patches at gcc dot gnu dot org (gcc-patches at gcc dot gnu dot org Patches), paul at codesourcery dot com, falk at debian dot org
- Date: Tue, 8 Aug 2006 12:40:05 -0400 (EDT)
- Subject: Re: builtin_bswap plus enhancements
> > Index: gcc/testsuite/gcc.dg/builtin-bswap-1.c
> > ===================================================================
> > --- gcc/testsuite/gcc.dg/builtin-bswap-1.c (revision 0)
> > +++ gcc/testsuite/gcc.dg/builtin-bswap-1.c (revision 0)
> > @@ -0,0 +1,14 @@
> > +/* { dg-do compile } */
> > +/* { dg-options "" } */
> > +/* { dg-final { scan-assembler-not "__builtin_" } } */
> > +
> > +#include <stdint.h>
> > +
> > +uint32_t foo (uint32_t a)
> > +{
> > + int b;
> > +
> > + b = __builtin_bswap32 (a);
> > +
> > + return b;
> > +}
>
> Is this test really going to pass on a processor which does not
> support a byte swap instruction? I must be missing something.
Yes because the call would to be __bswapsi and not to the builtin name.
Thanks,
Andrew Pinski