aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-28 17:56:14 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-28 17:56:14 +0000
commit7a0e27577dddd63e035e3ad8fde71f880d39943e (patch)
tree588effaadbd4715785ec9d13210ad7a29fd85271 /include
parentcb3f07940c11beaf2ccd3bfe76c18994f0cc4154 (diff)
ARM Skia NEON patches - 35 - First AArch64 support
Aarch64 support This change contains the necessary modifications to have Skia build and run properly on an ARMv8 processor in aarch64 execution state. Here's a list of the changes: - add an arm64 target to the build system + SK_CPU_ARM64 flag - MatrixTest was failing when built in Release mode. Fused MAC instructions were generated which made some intermediate results more accurate. As the test relies on result comparison, the more precise results when compared to others led to a gap bigger than what was tolerated. As I don't know if some actual skia code relies on results being comparable, I've disabled fused MAC instruction with -ffp-contract=off for arm64. - Modify include/core/SkOnce.h to have barriers work. - SK_CPU_ARM64 implies SK_ARM_NEON_MODE_ALWAYS. - use existing Xfermode optimisations with modifications that can be removed in the future when toolchains are ready. Also save a few instructions is two Xfermodes (will apply to ARM too). - use existing SkBoxBlur and SkMorphology optimisations. - use existing SkBlitMask optimisations - use existing BitmapProcState and Convolution optimisations. Future changes will include: - Blitters (only partialy merged upstream) - SkUtils (there's little value in sending asm optimisations without having them benchmarked on real hardware). Signed-off-by: Kevin PETIT <kevin.petit@arm.com> BUG=skia: R=djsollen@google.com, reed@google.com, mtklein@google.com, halcanary@google.com Author: kevin.petit@arm.com Review URL: https://codereview.chromium.org/143423004 git-svn-id: http://skia.googlecode.com/svn/trunk@13980 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/core/SkOnce.h8
-rw-r--r--include/core/SkPreConfig.h4
2 files changed, 7 insertions, 5 deletions
diff --git a/include/core/SkOnce.h b/include/core/SkOnce.h
index daeb819d42..d5330b9408 100644
--- a/include/core/SkOnce.h
+++ b/include/core/SkOnce.h
@@ -85,12 +85,10 @@ inline static void compiler_barrier() {
#endif
inline static void full_barrier_on_arm() {
-#ifdef SK_CPU_ARM
-# if SK_ARM_ARCH >= 7
- asm volatile("dmb" : : : "memory");
-# else
+#if (defined(SK_CPU_ARM) && SK_ARM_ARCH >= 7) || defined(SK_CPU_ARM64)
+ asm volatile("dmb ish" : : : "memory");
+#elif defined(SK_CPU_ARM)
asm volatile("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory");
-# endif
#endif
}
diff --git a/include/core/SkPreConfig.h b/include/core/SkPreConfig.h
index 406a159d89..73b54886bf 100644
--- a/include/core/SkPreConfig.h
+++ b/include/core/SkPreConfig.h
@@ -174,6 +174,10 @@
#endif
#endif
+#if defined(__aarch64__)
+ #define SK_CPU_ARM64
+#endif
+
//////////////////////////////////////////////////////////////////////
#if !defined(SKIA_IMPLEMENTATION)