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

Unified Diff: src/core/SkUtilsArm.h

Issue 1952953004: Remove NEON runtime detection support. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (x) Created 4 years, 7 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/SkOpts.cpp ('k') | src/opts/SkOpts_neon.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkUtilsArm.h
diff --git a/src/core/SkUtilsArm.h b/src/core/SkUtilsArm.h
index dde933bafa974056c8ef9e533a491162dee5b6eb..0d35193e0407c125d1a1845b41274a085fa1891d 100644
--- a/src/core/SkUtilsArm.h
+++ b/src/core/SkUtilsArm.h
@@ -8,75 +8,12 @@
#ifndef SkUtilsArm_DEFINED
#define SkUtilsArm_DEFINED
-#include "SkCpu.h"
-#include "SkUtils.h"
+#include "SkTypes.h"
-// Define SK_ARM_NEON_MODE to one of the following values
-// corresponding respectively to:
-// - No ARM Neon support at all (not targetting ARMv7-A, or don't have NEON)
-// - Full ARM Neon support (i.e. assume the CPU always supports it)
-// - Optional ARM Neon support (i.e. probe CPU at runtime)
-//
-#define SK_ARM_NEON_MODE_NONE 0
-#define SK_ARM_NEON_MODE_ALWAYS 1
-#define SK_ARM_NEON_MODE_DYNAMIC 2
-
-#if defined(SK_ARM_HAS_OPTIONAL_NEON)
-# define SK_ARM_NEON_MODE SK_ARM_NEON_MODE_DYNAMIC
-#elif defined(SK_ARM_HAS_NEON)
-# define SK_ARM_NEON_MODE SK_ARM_NEON_MODE_ALWAYS
-#else
-# define SK_ARM_NEON_MODE SK_ARM_NEON_MODE_NONE
-#endif
-
-// Convenience test macros, always defined as 0 or 1
-#define SK_ARM_NEON_IS_NONE (SK_ARM_NEON_MODE == SK_ARM_NEON_MODE_NONE)
-#define SK_ARM_NEON_IS_ALWAYS (SK_ARM_NEON_MODE == SK_ARM_NEON_MODE_ALWAYS)
-#define SK_ARM_NEON_IS_DYNAMIC (SK_ARM_NEON_MODE == SK_ARM_NEON_MODE_DYNAMIC)
-
-// The sk_cpu_arm_has_neon() function returns true iff the target device
-// is ARMv7-A and supports Neon instructions. In DYNAMIC mode, this actually
-// probes the CPU at runtime (and caches the result).
-
-static inline bool sk_cpu_arm_has_neon(void) {
-#if SK_ARM_NEON_IS_NONE
- return false;
+#if defined(SK_ARM_HAS_NEON)
+ #define SK_ARM_NEON_WRAP(x) (x ## _neon)
#else
- return SkCpu::Supports(SkCpu::NEON);
-#endif
-}
-
-// Use SK_ARM_NEON_WRAP(symbol) to map 'symbol' to a NEON-specific symbol
-// when applicable. This will transform 'symbol' differently depending on
-// the current NEON configuration, i.e.:
-//
-// NONE -> 'symbol'
-// ALWAYS -> 'symbol_neon'
-// DYNAMIC -> 'symbol' or 'symbol_neon' depending on runtime check.
-//
-// The goal is to simplify user code, for example:
-//
-// return SK_ARM_NEON_WRAP(do_something)(params);
-//
-// Replaces the equivalent:
-//
-// #if SK_ARM_NEON_IS_NONE
-// return do_something(params);
-// #elif SK_ARM_NEON_IS_ALWAYS
-// return do_something_neon(params);
-// #elif SK_ARM_NEON_IS_DYNAMIC
-// if (sk_cpu_arm_has_neon())
-// return do_something_neon(params);
-// else
-// return do_something(params);
-// #endif
-//
-#if SK_ARM_NEON_IS_NONE
-# define SK_ARM_NEON_WRAP(x) (x)
-#elif SK_ARM_NEON_IS_ALWAYS
-# define SK_ARM_NEON_WRAP(x) (x ## _neon)
-#elif SK_ARM_NEON_IS_DYNAMIC
-# define SK_ARM_NEON_WRAP(x) (sk_cpu_arm_has_neon() ? x ## _neon : x)
+ #define SK_ARM_NEON_WRAP(x) (x)
djsollen 2016/05/05 17:55:08 can we remove this wrapper now as well?
mtklein_C 2016/05/05 17:57:33 There are still a few files where this chooses bet
#endif
#endif // SkUtilsArm_DEFINED
« no previous file with comments | « src/core/SkOpts.cpp ('k') | src/opts/SkOpts_neon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698