2016-12-21 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr47564.c
blobdc09bbec440f6917ef00e365ec7f324d9b542ce7
1 /* PR target/47564 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -msse2 -std=gnu89" } */
5 static inline unsigned long long
6 foo (const unsigned char *p)
8 return 1;
11 __attribute__ ((__target__ ("sse4"))) void
12 bar (unsigned long long *x, const void *b, long long m)
14 const unsigned char *p = (const unsigned char *) b;
15 const unsigned char *e = p + m;
16 unsigned int l = *x;
17 unsigned long long n = l;
19 if ((e - p) >= 8192)
21 while ((e - p) >= 128)
23 n = __builtin_ia32_crc32di (n, foo (p));
24 n = __builtin_ia32_crc32di (n, foo (p));
25 n = __builtin_ia32_crc32di (n, foo (p));
26 n = __builtin_ia32_crc32di (n, foo (p));
27 n = __builtin_ia32_crc32di (n, foo (p));
28 n = __builtin_ia32_crc32di (n, foo (p));
29 n = __builtin_ia32_crc32di (n, foo (p));
30 n = __builtin_ia32_crc32di (n, foo (p));
31 n = __builtin_ia32_crc32di (n, foo (p));
35 while ((e - p) >= 16)
37 n = __builtin_ia32_crc32di (n, foo (p));
38 n = __builtin_ia32_crc32di (n, foo (p));
40 l = n;
41 *x = l;