CRC Builtins (Using the GNU Compiler Collection (GCC))

#### 7.2.4 CRC Builtins ¶

Built-in Function: `uint8_t` __builtin_rev_crc8_data8 `(uint8_t crc, uint8_t data, uint8_t poly)` ¶

  Returns the calculated 8-bit bit-reversed CRC using the initial CRC (8-bit), data (8-bit) and the polynomial (8-bit). crc is the initial CRC, data is the data and poly is the polynomial without leading 1. poly is required to be a compile-time constant. Table-based or clmul-based CRC may be used for the calculation, depending on the target architecture.

Built-in Function: `uint16_t` __builtin_rev_crc16_data16 `(uint16_t crc, uint16_t data, uint16_t poly)` ¶

  Similar to `__builtin_rev_crc8_data8`, except the argument and return types are 16-bit.

Built-in Function: `uint16_t` __builtin_rev_crc16_data8 `(uint16_t crc, uint8_t data, uint16_t poly)` ¶

  Similar to `__builtin_rev_crc16_data16`, except the data argument type is 8-bit.

Built-in Function: `uint32_t` __builtin_rev_crc32_data32 `(uint32_t crc, uint32_t data, uint32_t poly)` ¶

  Similar to `__builtin_rev_crc8_data8`, except the argument and return types are 32-bit and for the CRC calculation may be also used crc* machine instruction depending on the target and the polynomial.

Built-in Function: `uint32_t` __builtin_rev_crc32_data8 `(uint32_t crc, uint8_t data, uint32_t poly)` ¶

  Similar to `__builtin_rev_crc32_data32`, except the data argument type is 8-bit.

Built-in Function: `uint32_t` __builtin_rev_crc32_data16 `(uint32_t crc, uint16_t data, uint32_t poly)` ¶

  Similar to `__builtin_rev_crc32_data32`, except the data argument type is 16-bit.

Built-in Function: `uint64_t` __builtin_rev_crc64_data64 `(uint64_t crc, uint64_t data, uint64_t poly)` ¶

  Similar to `__builtin_rev_crc8_data8`, except the argument and return types are 64-bit.

Built-in Function: `uint64_t` __builtin_rev_crc64_data8 `(uint64_t crc, uint8_t data, uint64_t poly)` ¶

  Similar to `__builtin_rev_crc64_data64`, except the data argument type is 8-bit.

Built-in Function: `uint64_t` __builtin_rev_crc64_data16 `(uint64_t crc, uint16_t data, uint64_t poly)` ¶

  Similar to `__builtin_rev_crc64_data64`, except the data argument type is 16-bit.

Built-in Function: `uint64_t` __builtin_rev_crc64_data32 `(uint64_t crc, uint32_t data, uint64_t poly)` ¶

  Similar to `__builtin_rev_crc64_data64`, except the data argument type is 32-bit.

Built-in Function: `uint8_t` __builtin_crc8_data8 `(uint8_t crc, uint8_t data, uint8_t poly)` ¶

  Returns the calculated 8-bit bit-forward CRC using the initial CRC (8-bit), data (8-bit) and the polynomial (8-bit). crc is the initial CRC, data is the data and poly is the polynomial without leading 1. poly is required to be a compile-time constant. Table-based or clmul-based CRC may be used for the calculation, depending on the target architecture.

Built-in Function: `uint16_t` __builtin_crc16_data16 `(uint16_t crc, uint16_t data, uint16_t poly)` ¶

  Similar to `__builtin_crc8_data8`, except the argument and return types are 16-bit.

Built-in Function: `uint16_t` __builtin_crc16_data8 `(uint16_t crc, uint8_t data, uint16_t poly)` ¶

  Similar to `__builtin_crc16_data16`, except the data argument type is 8-bit.

Built-in Function: `uint32_t` __builtin_crc32_data32 `(uint32_t crc, uint32_t data, uint32_t poly)` ¶

  Similar to `__builtin_crc8_data8`, except the argument and return types are 32-bit.

Built-in Function: `uint32_t` __builtin_crc32_data8 `(uint32_t crc, uint8_t data, uint32_t poly)` ¶

  Similar to `__builtin_crc32_data32`, except the data argument type is 8-bit.

Built-in Function: `uint32_t` __builtin_crc32_data16 `(uint32_t crc, uint16_t data, uint32_t poly)` ¶

  Similar to `__builtin_crc32_data32`, except the data argument type is 16-bit.

Built-in Function: `uint64_t` __builtin_crc64_data64 `(uint64_t crc, uint64_t data, uint64_t poly)` ¶

  Similar to `__builtin_crc8_data8`, except the argument and return types are 64-bit.

Built-in Function: `uint64_t` __builtin_crc64_data8 `(uint64_t crc, uint8_t data, uint64_t poly)` ¶

  Similar to `__builtin_crc64_data64`, except the data argument type is 8-bit.

Built-in Function: `uint64_t` __builtin_crc64_data16 `(uint64_t crc, uint16_t data, uint64_t poly)` ¶

  Similar to `__builtin_crc64_data64`, except the data argument type is 16-bit.

Built-in Function: `uint64_t` __builtin_crc64_data32 `(uint64_t crc, uint32_t data, uint64_t poly)` ¶

  Similar to `__builtin_crc64_data64`, except the data argument type is 32-bit.