blob: f9a6d32e6e6dcad9c87c22bb91f8f14f25a2de30 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
--- third_party/skia/src/core/SkCpu.cpp.orig 2020-11-13 06:42:23 UTC
+++ third_party/skia/src/core/SkCpu.cpp
@@ -72,6 +72,23 @@
return features;
}
+#elif defined(SK_CPU_ARM64) && defined(__FreeBSD__)
+ #include <machine/armreg.h>
+ #ifndef ID_AA64ISAR0_CRC32_VAL
+ #define ID_AA64ISAR0_CRC32_VAL ID_AA64ISAR0_CRC32
+ #endif
+
+ static uint32_t read_cpu_features() {
+ uint32_t features = 0;
+ uint64_t id_aa64isar0;
+
+ id_aa64isar0 = READ_SPECIALREG(id_aa64isar0_el1);
+ if (ID_AA64ISAR0_CRC32_VAL(id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE) {
+ features |= SkCpu::CRC32;
+ }
+ return features;
+ }
+
#elif defined(SK_CPU_ARM64) && __has_include(<sys/auxv.h>)
#include <sys/auxv.h>
|