]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/compiler-rt/lib/scudo/scudo_crc32.cpp
MFV 331702:
[FreeBSD/FreeBSD.git] / contrib / compiler-rt / lib / scudo / scudo_crc32.cpp
1 //===-- scudo_crc32.cpp -----------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// CRC32 function leveraging hardware specific instructions. This has to be
11 /// kept separated to restrict the use of compiler specific flags to this file.
12 ///
13 //===----------------------------------------------------------------------===//
14
15 #include "scudo_crc32.h"
16
17 namespace __scudo {
18
19 #if defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
20 u32 computeHardwareCRC32(u32 Crc, uptr Data) {
21   return CRC32_INTRINSIC(Crc, Data);
22 }
23 #endif  // defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
24
25 }  // namespace __scudo