1 /* { dg-do compile { target arm*-*-* alpha*-*-* i?86-*-* powerpc*-*-* rs6000-*-* x86_64-*-* s390*-*-* } } */ 2 /* { dg-require-effective-target stdint_types } */ 3 /* { dg-options "-O2 -fdump-rtl-combine" } */ 4 /* { dg-options "-O2 -fdump-rtl-combine -march=z900" { target s390-*-* } } */ 5 6 #include <stdint.h> 7 8 #define BS(X) __builtin_bswap32(X) 9 foo1(uint32_t a)10uint32_t foo1 (uint32_t a) 11 { 12 return BS (~ BS (a)); 13 } 14 foo2(uint32_t a)15uint32_t foo2 (uint32_t a) 16 { 17 return BS (BS (a) & 0xA0000); 18 } 19 foo3(uint32_t a)20uint32_t foo3 (uint32_t a) 21 { 22 return BS (BS (a) | 0xA0000); 23 } 24 foo4(uint32_t a)25uint32_t foo4 (uint32_t a) 26 { 27 return BS (BS (a) ^ 0xA0000); 28 } 29 foo5(uint32_t a,uint32_t b)30uint32_t foo5 (uint32_t a, uint32_t b) 31 { 32 return BS (BS (a) & BS (b)); 33 } 34 foo6(uint32_t a,uint32_t b)35uint32_t foo6 (uint32_t a, uint32_t b) 36 { 37 return BS (BS (a) | BS (b)); 38 } 39 foo7(uint32_t a,uint32_t b)40uint32_t foo7 (uint32_t a, uint32_t b) 41 { 42 return BS (BS (a) ^ BS (b)); 43 } 44 45 /* { dg-final { scan-rtl-dump-not "bswapsi" "combine" } } */ 46