diff options
| author | Mikael Urankar <mikael@FreeBSD.org> | 2020-11-11 13:38:27 +0000 |
|---|---|---|
| committer | Mikael Urankar <mikael@FreeBSD.org> | 2020-11-11 13:38:27 +0000 |
| commit | adbc0f6151660cf1ca4590731f69713c65a486c9 (patch) | |
| tree | 0e0063be74fa87b155dedc28a92cbc0354432d34 /www/chromium/files | |
| parent | Ignore grep return value. (diff) | |
www/chromium: improve cpu features detection on aarch64
Approved by: portmgr (tier-2 blanket)
Diffstat (limited to 'www/chromium/files')
| -rw-r--r-- | www/chromium/files/patch-third__party_skia_src_core_SkCpu.cpp | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/www/chromium/files/patch-third__party_skia_src_core_SkCpu.cpp b/www/chromium/files/patch-third__party_skia_src_core_SkCpu.cpp index 4d7db67f8556..1650759a114e 100644 --- a/www/chromium/files/patch-third__party_skia_src_core_SkCpu.cpp +++ b/www/chromium/files/patch-third__party_skia_src_core_SkCpu.cpp @@ -1,19 +1,26 @@ --- third_party/skia/src/core/SkCpu.cpp.orig 2019-07-24 19:03:35 UTC +++ third_party/skia/src/core/SkCpu.cpp -@@ -76,6 +76,8 @@ - #include <sys/auxv.h> - - static uint32_t read_cpu_features() { -+return 0; -+#if 0 - const uint32_t kHWCAP_CRC32 = (1<< 7), - kHWCAP_ASIMDHP = (1<<10); - -@@ -112,6 +114,7 @@ - } - } +@@ -72,6 +72,23 @@ return features; -+#endif } - #elif defined(SK_CPU_ARM32) && __has_include(<sys/auxv.h>) && \ ++#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> + |
