From 157d94465a47a57e30e5cf49cd57dccd903e27e2 Mon Sep 17 00:00:00 2001 From: "digit@google.com" Date: Mon, 6 Aug 2012 14:53:32 +0000 Subject: rm: Introduce SK_ARM_NEON_WRAP handy wrapper macro. It is used to simplify arm/neon dispatch logic code. Review URL: https://codereview.appspot.com/6458060 git-svn-id: http://skia.googlecode.com/svn/trunk@4958 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkPreConfig.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/core') diff --git a/include/core/SkPreConfig.h b/include/core/SkPreConfig.h index bbf0124117..55b1abf3bc 100644 --- a/include/core/SkPreConfig.h +++ b/include/core/SkPreConfig.h @@ -173,5 +173,21 @@ #define SK_API #endif +////////////////////////////////////////////////////////////////////// + +/** + * Use SK_PURE_FUNC as an attribute to indicate that a function's + * return value only depends on the value of its parameters. This + * can help the compiler optimize out successive calls. + * + * Usage: + * void function(int params) SK_PURE_FUNC; + */ +#if defined(__GNUC__) +# define SK_PURE_FUNC __attribute__((pure)) +#else +# define SK_PURE_FUNC /* nothing */ +#endif + #endif -- cgit v1.2.3