summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr42589.c
blob: 1366ef5b32a8e45ae3d04a1b2603db2bef21dfa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=i486" } } */
/* { dg-options "-O2 -march=i486" } */

void
foo (unsigned long long *p)
{
  unsigned long long tmp;
  tmp = *p;
  tmp = (tmp >> 32) | (tmp << 32);
  tmp = (((tmp & 0xff00ff00ff00ff00ULL) >> 8)
	 | ((tmp & 71777214294589695ULL) << 8));
  *p = (((tmp & 0xffff0000ffff0000ULL) >> 16)
	| ((tmp & 281470681808895ULL) << 16));
}

/* { dg-final { scan-assembler-times "bswap" 2 } } */