annotate gcc/testsuite/gcc.dg/optimize-bswapsi-3.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 /* { dg-require-effective-target bswap } */
111
kono
parents:
diff changeset
3 /* { dg-require-effective-target stdint_types } */
kono
parents:
diff changeset
4 /* { dg-options "-O2 -fdump-tree-bswap" } */
kono
parents:
diff changeset
5 /* { dg-additional-options "-march=z900" { target s390-*-* } } */
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 typedef int SItype __attribute__ ((mode (SI)));
kono
parents:
diff changeset
8 typedef int DItype __attribute__ ((mode (DI)));
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 /* This variant comes from optimize-bswapsi-1.c swap32_d. It detects a missing
kono
parents:
diff changeset
11 cast of MARKER_BYTE_UNKNOWN to uint64_t for the CASE_CONVERT case for host
kono
parents:
diff changeset
12 architecture where a left shift with too big an operand gives zero. */
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 SItype
kono
parents:
diff changeset
15 swap32 (SItype in)
kono
parents:
diff changeset
16 {
kono
parents:
diff changeset
17 return (((in >> 0) & 0xFF) << 24)
kono
parents:
diff changeset
18 | (((in >> 8) & 0xFF) << 16)
kono
parents:
diff changeset
19 | (((((DItype) in) & 0xFF00FF0000llu) >> 16) << 8)
kono
parents:
diff changeset
20 | (((in >> 24) & 0xFF) << 0);
kono
parents:
diff changeset
21 }
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 /* { dg-final { scan-tree-dump-not "32 bit bswap implementation found at" "bswap" } } */