Print "Global Exported" to dump_file from set_range_info.
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / optimize-bswapdi-2.c
blobf7ff3d3c6022655e43f7dc2d684184ba2ae7846b
1 /* { dg-require-effective-target stdint_types } */
2 /* { dg-require-effective-target lp64 } */
3 /* { dg-options "-O2 -mdejagnu-cpu=power5" } */
5 /* This is a clone of gcc-dg/optimize-bswapdi-1.c, redone to use load and stores
6 to test whether lwbrx/stwbrx is generated for normal power systems. */
8 #include <stdint.h>
9 #define __const_swab64(x) ((uint64_t)( \
10 (((uint64_t)(x) & (uint64_t)0x00000000000000ffULL) << 56) | \
11 (((uint64_t)(x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
12 (((uint64_t)(x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
13 (((uint64_t)(x) & (uint64_t)0x00000000ff000000ULL) << 8) | \
14 (((uint64_t)(x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \
15 (((uint64_t)(x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
16 (((uint64_t)(x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
17 (((uint64_t)(x) & (uint64_t)0xff00000000000000ULL) >> 56)))
20 /* This byte swap implementation is used by the Linux kernel and the
21 GNU C library. */
23 uint64_t
24 swap64_load (uint64_t *in)
26 return __const_swab64 (*in);
29 void
30 swap64_store (uint64_t *out, uint64_t in)
32 *out = __const_swab64 (in);
35 /* { dg-final { scan-assembler-times "lwbrx" 2 } } */
36 /* { dg-final { scan-assembler-times "stwbrx" 2 } } */