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 ///////////////////////////////////////////////////////////////////////////////