aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkMath.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/core/SkMath.h')
-rw-r--r--include/core/SkMath.h22
1 files changed, 5 insertions, 17 deletions
diff --git a/include/core/SkMath.h b/include/core/SkMath.h
index 2da1a3a921..cee3257197 100644
--- a/include/core/SkMath.h
+++ b/include/core/SkMath.h
@@ -40,24 +40,12 @@ int32_t SkSqrtBits(int32_t value, int bitBias);
//! Returns the number of leading zero bits (0...32)
int SkCLZ_portable(uint32_t);
+#if defined(SK_CPU_ARM)
+ #define SkCLZ(x) __builtin_clz(x)
+#endif
+
#ifndef SkCLZ
- #if defined(_MSC_VER) && _MSC_VER >= 1400
- #include <intrin.h>
-
- static inline int SkCLZ(uint32_t mask) {
- if (mask) {
- DWORD index;
- _BitScanReverse(&index, mask);
- return index ^ 0x1F;
- } else {
- return 32;
- }
- }
- #elif defined(SK_CPU_ARM) || defined(__GNUC__)
- #define SkCLZ(x) __builtin_clz(x)
- #else
- #define SkCLZ(x) SkCLZ_portable(x)
- #endif
+ #define SkCLZ(x) SkCLZ_portable(x)
#endif
/**