| 1 |
/* PR target/47564 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -msse2 -std=gnu89" } */ |
| 4 |
|
| 5 |
static inline unsigned long long |
| 6 |
foo (const unsigned char *p) |
| 7 |
{ |
| 8 |
return 1; |
| 9 |
} |
| 10 |
|
| 11 |
__attribute__ ((__target__ ("sse4"))) void |
| 12 |
bar (unsigned long long *x, const void *b, long long m) |
| 13 |
{ |
| 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; |
| 18 |
|
| 19 |
if ((e - p) >= 8192) |
| 20 |
{ |
| 21 |
while ((e - p) >= 128) |
| 22 |
{ |
| 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)); |
| 32 |
} |
| 33 |
} |
| 34 |
|
| 35 |
while ((e - p) >= 16) |
| 36 |
{ |
| 37 |
n = __builtin_ia32_crc32di (n, foo (p)); |
| 38 |
n = __builtin_ia32_crc32di (n, foo (p)); |
| 39 |
} |
| 40 |
l = n; |
| 41 |
*x = l; |
| 42 |
} |