[compiler-rt] [scudo] Add support for LoongArch hardware CRC32 checksumming (PR #83113)
Lu Weining via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 27 19:05:46 PST 2024
================
@@ -75,6 +77,15 @@ bool hasHardwareCRC32() {
return !!(getauxval(AT_HWCAP) & HWCAP_CRC32);
#endif // SCUDO_FUCHSIA
}
+#elif defined(__loongarch__)
+// Query HWCAP for platform capability, according to *Software Development and
+// Build Convention for LoongArch Architectures* v0.1, Section 9.1.
+//
+// Link:
+// https://github.com/loongson/la-softdev-convention/blob/v0.1/la-softdev-convention.adoc#kernel-development
+bool hasHardwareCRC32() {
+ return !!(getauxval(AT_HWCAP) & HWCAP_LOONGARCH_CRC32);
----------------
SixWeining wrote:
I got this error:
```
compiler-rt/lib/scudo/standalone/checksum.cpp:87:35: error: use of undeclared identifier 'HWCAP_LOONGARCH_CRC32'
```
Maybe a `.h` file should be included?
https://github.com/llvm/llvm-project/pull/83113
More information about the llvm-commits
mailing list