mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 21:16:05 +00:00

This reverts commit 09b53121c323f260ab97cecd067d4e7b3be1bf7c. Breaks the build with GCC 11.2 on x86_64: In file included from /home/npopov/repos/llvm-project/compiler-rt/lib/scudo/scudo_crc32.h:27, from /home/npopov/repos/llvm-project/compiler-rt/lib/scudo/scudo_crc32.cpp:14: /usr/lib/gcc/x86_64-redhat-linux/11/include/smmintrin.h: In function ‘__sanitizer::u32 __scudo::computeHardwareCRC32(__sanitizer::u32, __sanitizer::uptr)’: /usr/lib/gcc/x86_64-redhat-linux/11/include/smmintrin.h:846:1: error: inlining failed in call to ‘always_inline’ ‘long long unsigned int _mm_crc32_u64(long long unsigned int, long long unsigned int)’: target specific option mismatch 846 | _mm_crc32_u64 (unsigned long long __C, unsigned long long __V)
20 lines
656 B
C++
20 lines
656 B
C++
//===-- crc32_hw.cpp --------------------------------------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "checksum.h"
|
|
|
|
namespace scudo {
|
|
|
|
#if defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
|
|
u32 computeHardwareCRC32(u32 Crc, uptr Data) {
|
|
return static_cast<u32>(CRC32_INTRINSIC(Crc, Data));
|
|
}
|
|
#endif // defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
|
|
|
|
} // namespace scudo
|