summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2022-04-19 01:05:35 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-04-19 01:05:35 +0000
commitfd180047ea433b3e802bc0181ee75785a8e28622 (patch)
tree9e9a3b744080ed429c5afeb6691d44369c0a3740
parent20ca2dc226a7780a7e73d9a32307aff6f07d4901 (diff)
parent59f578b46d1541b9a45c876afa8eaa58946cd896 (diff)
downloadscudo-fd180047ea433b3e802bc0181ee75785a8e28622.tar.gz
Revert "[compiler-rt] [scudo] Use -mcrc32 on x86 when available" am: c8f0eaf1df am: f358990bf5 am: 59f578b46d
Original change: https://android-review.googlesource.com/c/platform/external/scudo/+/2066957 Change-Id: I7e2b38e1d5b100d7c04cf7e30d3ab40d78dc1f9e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--standalone/checksum.h5
-rw-r--r--standalone/chunk.h4
-rw-r--r--standalone/crc32_hw.cpp4
3 files changed, 6 insertions, 7 deletions
diff --git a/standalone/checksum.h b/standalone/checksum.h
index df3299543ae..a63b1b4f064 100644
--- a/standalone/checksum.h
+++ b/standalone/checksum.h
@@ -12,13 +12,12 @@
#include "internal_defs.h"
// Hardware CRC32 is supported at compilation via the following:
-// - for i386 & x86_64: -mcrc32 (earlier: -msse4.2)
+// - for i386 & x86_64: -msse4.2
// - for ARM & AArch64: -march=armv8-a+crc or -mcrc
// An additional check must be performed at runtime as well to make sure the
// emitted instructions are valid on the target host.
-#if defined(__CRC32__) || defined(__SSE4_2__)
-// NB: clang has <crc32intrin.h> but GCC does not
+#ifdef __SSE4_2__
#include <smmintrin.h>
#define CRC32_INTRINSIC FIRST_32_SECOND_64(_mm_crc32_u32, _mm_crc32_u64)
#endif
diff --git a/standalone/chunk.h b/standalone/chunk.h
index 0581420dfc9..69b8e1b12a9 100644
--- a/standalone/chunk.h
+++ b/standalone/chunk.h
@@ -25,7 +25,7 @@ inline u16 computeChecksum(u32 Seed, uptr Value, uptr *Array, uptr ArraySize) {
// as opposed to only for crc32_hw.cpp. This means that other hardware
// specific instructions were likely emitted at other places, and as a result
// there is no reason to not use it here.
-#if defined(__CRC32__) || defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
+#if defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
u32 Crc = static_cast<u32>(CRC32_INTRINSIC(Seed, Value));
for (uptr I = 0; I < ArraySize; I++)
Crc = static_cast<u32>(CRC32_INTRINSIC(Crc, Array[I]));
@@ -42,7 +42,7 @@ inline u16 computeChecksum(u32 Seed, uptr Value, uptr *Array, uptr ArraySize) {
Checksum = computeBSDChecksum(Checksum, Array[I]);
return Checksum;
}
-#endif // defined(__CRC32__) || defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
+#endif // defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
}
namespace Chunk {
diff --git a/standalone/crc32_hw.cpp b/standalone/crc32_hw.cpp
index d13c615498f..62841ba5101 100644
--- a/standalone/crc32_hw.cpp
+++ b/standalone/crc32_hw.cpp
@@ -10,10 +10,10 @@
namespace scudo {
-#if defined(__CRC32__) || defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
+#if defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
u32 computeHardwareCRC32(u32 Crc, uptr Data) {
return static_cast<u32>(CRC32_INTRINSIC(Crc, Data));
}
-#endif // defined(__CRC32__) || defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
+#endif // defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
} // namespace scudo