1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-options "-O2 -mdejagnu-cpu=power6 -mavoid-indexed-addresses" } */
4 /* { dg-final { scan-assembler-times "lwbrx" 12 } } */
5 /* { dg-final { scan-assembler-times "stwbrx" 6 } } */
7 /* PR 51399: bswap gets an error if -mavoid-indexed-addresses was used in
8 creating the two lwbrx instructions. */
11 load64_reverse_1 (long long *p
)
13 return __builtin_bswap64 (*p
);
17 load64_reverse_2 (long long *p
)
19 return __builtin_bswap64 (p
[1]);
23 load64_reverse_3 (long long *p
, int i
)
25 return __builtin_bswap64 (p
[i
]);
29 load64_reverse_4 (long long dummy
__attribute__ ((unused
)), long long *p
)
31 return __builtin_bswap64 (*p
);
35 load64_reverse_5 (long long dummy
__attribute__ ((unused
)), long long *p
)
37 return __builtin_bswap64 (p
[1]);
41 load64_reverse_6 (long long dummy
__attribute__ ((unused
)), long long *p
, int i
)
43 return __builtin_bswap64 (p
[i
]);
47 store64_reverse_1 (long long *p
, long long x
)
49 *p
= __builtin_bswap64 (x
);
53 store64_reverse_2 (long long *p
, long long x
)
55 p
[1] = __builtin_bswap64 (x
);
59 store64_reverse_3 (long long *p
, long long x
, int i
)
61 p
[i
] = __builtin_bswap64 (x
);
65 reg_reverse_1 (long long x
)
67 return __builtin_bswap64 (x
);
71 reg_reverse_2 (long long dummy
__attribute__ ((unused
)), long long x
)
73 return __builtin_bswap64 (x
);