Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Unified Diff: src/core/SkCpu.cpp

Issue 2259133002: Detect CRC32 instructions on ARMv8. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkCpu.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCpu.cpp
diff --git a/src/core/SkCpu.cpp b/src/core/SkCpu.cpp
index 0858abd40a7fcf22328926797c04ce034561372f..0f1c7511a645481f6b04caf5ba13a182933d0d74 100644
--- a/src/core/SkCpu.cpp
+++ b/src/core/SkCpu.cpp
@@ -71,6 +71,19 @@
return features;
}
+#elif defined(SK_CPU_ARM64) && \
+ defined(SK_BUILD_FOR_ANDROID) && \
+ !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK)
+ #include <cpu-features.h>
+
+ static uint32_t read_cpu_features() {
+ uint32_t features = 0;
+
+ uint64_t android_features = android_getCpuFeatures();
+ if (android_features & ANDROID_CPU_ARM64_FEATURE_CRC32) { features |= SkCpu::CRC32; }
+ return features;
+ }
+
#else
static uint32_t read_cpu_features() {
return 0;
« no previous file with comments | « src/core/SkCpu.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698