| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -mcrc32" } */ |
| 3 |
/* { dg-final { scan-assembler "crc32b\[^\\n\]*eax" } } */ |
| 4 |
/* { dg-final { scan-assembler "crc32w\[^\\n\]*eax" } } */ |
| 5 |
/* { dg-final { scan-assembler "crc32l\[^\\n\]*eax" } } */ |
| 6 |
/* { dg-final { scan-assembler "crc32q\[^\\n\]*rax" { target { ! ia32 } } } } */ |
| 7 |
|
| 8 |
#include <immintrin.h> |
| 9 |
|
| 10 |
unsigned int |
| 11 |
test_mm_crc32_u8 (unsigned int CRC, unsigned char V) |
| 12 |
{ |
| 13 |
return _mm_crc32_u8 (CRC, V); |
| 14 |
} |
| 15 |
|
| 16 |
unsigned int |
| 17 |
test_mm_crc32_u16 (unsigned int CRC, unsigned short V) |
| 18 |
{ |
| 19 |
return _mm_crc32_u16 (CRC, V); |
| 20 |
} |
| 21 |
|
| 22 |
unsigned int |
| 23 |
test_mm_crc32_u32 (unsigned int CRC, unsigned int V) |
| 24 |
{ |
| 25 |
return _mm_crc32_u32 (CRC, V); |
| 26 |
} |
| 27 |
|
| 28 |
#ifdef __x86_64__ |
| 29 |
unsigned long long |
| 30 |
test_mm_crc32_u64 (unsigned long long CRC, unsigned long long V) |
| 31 |
{ |
| 32 |
return _mm_crc32_u64 (CRC, V); |
| 33 |
} |
| 34 |
#endif |