crc32_hw.cpp 710 B

1234567891011121314151617181920
  1. //===-- crc32_hw.cpp --------------------------------------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #include "checksum.h"
  9. namespace scudo {
  10. #if defined(__CRC32__) || defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
  11. u32 computeHardwareCRC32(u32 Crc, uptr Data) {
  12. return static_cast<u32>(CRC32_INTRINSIC(Crc, Data));
  13. }
  14. #endif // defined(__CRC32__) || defined(__SSE4_2__) ||
  15. // defined(__ARM_FEATURE_CRC32)
  16. } // namespace scudo