| 1 |
/* { dg-options "-march=armv8-a+crypto" } */ |
| 2 |
|
| 3 |
#include <stdint-gcc.h> |
| 4 |
int8_t crc8_data8 () |
| 5 |
{ |
| 6 |
return __builtin_crc8_data8 ('a', 0xff, 0x12); |
| 7 |
} |
| 8 |
int16_t crc16_data8 () |
| 9 |
{ |
| 10 |
return __builtin_crc16_data8 (0x1234, 'a', 0x1021); |
| 11 |
} |
| 12 |
|
| 13 |
int16_t crc16_data16 () |
| 14 |
{ |
| 15 |
return __builtin_crc16_data16 (0x1234, 0x3214, 0x1021); |
| 16 |
} |
| 17 |
|
| 18 |
int32_t crc32_data8 () |
| 19 |
{ |
| 20 |
return __builtin_crc32_data8 (0xffffffff, 0x32, 0x4002123); |
| 21 |
} |
| 22 |
int32_t crc32_data16 () |
| 23 |
{ |
| 24 |
return __builtin_crc32_data16 (0xffffffff, 0x3232, 0x4002123); |
| 25 |
} |
| 26 |
|
| 27 |
int32_t crc32_data32 () |
| 28 |
{ |
| 29 |
return __builtin_crc32_data32 (0xffffffff, 0x123546ff, 0x4002123); |
| 30 |
} |
| 31 |
|
| 32 |
int8_t rev_crc8_data8 () |
| 33 |
{ |
| 34 |
return __builtin_rev_crc8_data8 (0x34, 'a', 0x12); |
| 35 |
} |
| 36 |
|
| 37 |
int16_t rev_crc16_data8 () |
| 38 |
{ |
| 39 |
return __builtin_rev_crc16_data8 (0x1234, 'a', 0x1021); |
| 40 |
} |
| 41 |
|
| 42 |
int16_t rev_crc16_data16 () |
| 43 |
{ |
| 44 |
return __builtin_rev_crc16_data16 (0x1234, 0x3214, 0x1021); |
| 45 |
} |
| 46 |
|
| 47 |
int32_t rev_crc32_data8 () |
| 48 |
{ |
| 49 |
return __builtin_rev_crc32_data8 (0xffffffff, 0x32, 0x4002123); |
| 50 |
} |
| 51 |
|
| 52 |
int32_t rev_crc32_data16 () |
| 53 |
{ |
| 54 |
return __builtin_rev_crc32_data16 (0xffffffff, 0x3232, 0x4002123); |
| 55 |
} |
| 56 |
|
| 57 |
int32_t rev_crc32_data32 () |
| 58 |
{ |
| 59 |
return __builtin_rev_crc32_data32 (0xffffffff, 0x123546ff, 0x4002123); |
| 60 |
} |
| 61 |
/* { dg-final { scan-assembler-times "pmull" 24 } } */ |