This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]