111
|
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
|
|
10 uint32_t foo1 (uint32_t a)
|
|
11 {
|
|
12 return BS (~ BS (a));
|
|
13 }
|
|
14
|
|
15 uint32_t foo2 (uint32_t a)
|
|
16 {
|
|
17 return BS (BS (a) & 0xA0000);
|
|
18 }
|
|
19
|
|
20 uint32_t foo3 (uint32_t a)
|
|
21 {
|
|
22 return BS (BS (a) | 0xA0000);
|
|
23 }
|
|
24
|
|
25 uint32_t foo4 (uint32_t a)
|
|
26 {
|
|
27 return BS (BS (a) ^ 0xA0000);
|
|
28 }
|
|
29
|
|
30 uint32_t foo5 (uint32_t a, uint32_t b)
|
|
31 {
|
|
32 return BS (BS (a) & BS (b));
|
|
33 }
|
|
34
|
|
35 uint32_t foo6 (uint32_t a, uint32_t b)
|
|
36 {
|
|
37 return BS (BS (a) | BS (b));
|
|
38 }
|
|
39
|
|
40 uint32_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" } } */
|