Stop only if there aren't any usable algorithms
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / crc32-1.c
blobb3ed5b6842a15a5945e5a441ff9155329c3dd776
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" } } */
7 unsigned int
8 crc32b (unsigned int x, unsigned char y)
10 return __builtin_ia32_crc32qi (x, y);
13 unsigned int
14 crc32w (unsigned int x, unsigned short y)
16 return __builtin_ia32_crc32hi (x, y);
19 unsigned int
20 crc32d (unsigned int x, unsigned int y)
22 return __builtin_ia32_crc32si (x, y);