aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private/SkFixed.h
diff options
context:
space:
mode:
authorGravatar Ben Wagner <benjaminwagner@google.com>2017-11-09 12:18:09 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-09 17:46:44 +0000
commit31366872a55d0760e1742db0f9a0d1329a51f709 (patch)
tree73369a7a00ad3eb87343b842246159b0f138468a /include/private/SkFixed.h
parentae99d29f6bf147346f3360cd0b764223afadfc99 (diff)
Guard VFPv3 ASM with an ifdef.
Change-Id: Id31de8dc0d9d68369896f2686068b29e07135a39 Reviewed-on: https://skia-review.googlesource.com/68641 Commit-Queue: Ben Wagner <benjaminwagner@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'include/private/SkFixed.h')
-rw-r--r--include/private/SkFixed.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/private/SkFixed.h b/include/private/SkFixed.h
index 6361bdaab5..5cd811ba6f 100644
--- a/include/private/SkFixed.h
+++ b/include/private/SkFixed.h
@@ -94,8 +94,8 @@ inline SkFixed SkFixedMul_longlong(SkFixed a, SkFixed b) {
}
#define SkFixedMul(a,b) SkFixedMul_longlong(a,b)
-
-#if defined(SK_CPU_ARM32)
+// The VCVT float-to-fixed instruction is part of the VFPv3 instruction set.
+#if defined(__ARM_VFPV3__)
/* This guy does not handle NaN or other obscurities, but is faster than
than (int)(x*65536). When built on Android with -Os, needs forcing
to inline or we lose the speed benefit.
@@ -107,6 +107,11 @@ inline SkFixed SkFixedMul_longlong(SkFixed a, SkFixed b) {
memcpy(&y, &x, sizeof(y));
return y;
}
+ #undef SkFloatToFixed
+ #define SkFloatToFixed(x) SkFloatToFixed_arm(x)
+#endif
+
+#if defined(SK_CPU_ARM32)
inline SkFixed SkFixedMul_arm(SkFixed x, SkFixed y)
{
int32_t t;
@@ -121,9 +126,6 @@ inline SkFixed SkFixedMul_longlong(SkFixed a, SkFixed b) {
}
#undef SkFixedMul
#define SkFixedMul(x, y) SkFixedMul_arm(x, y)
-
- #undef SkFloatToFixed
- #define SkFloatToFixed(x) SkFloatToFixed_arm(x)
#endif
///////////////////////////////////////////////////////////////////////////////