builtin_bswap plus enhancements

Andrew Pinski pinskia@physics.uc.edu
Tue Aug 8 17:02:00 GMT 2006


> > 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



More information about the Gcc-patches mailing list