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