]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/compiler-rt/lib/scudo/standalone/crc32_hw.cc
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm-project / compiler-rt / lib / scudo / standalone / crc32_hw.cc
1 //===-- crc32_hw.h ----------------------------------------------*- 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
9 #include "checksum.h"
10
11 namespace scudo {
12
13 #if defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
14 u32 computeHardwareCRC32(u32 Crc, uptr Data) {
15   return static_cast<u32>(CRC32_INTRINSIC(Crc, Data));
16 }
17 #endif // defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
18
19 } // namespace scudo