Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(40)

Issue 6247058: rm: First step towards dynamic NEON support. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 4 months ago by digit
Modified:
12 years, 4 months ago
Reviewers:
DerekS, caryclark1, reed1
CC:
skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

arm: First step towards dynamic NEON support. This patch adds minimal support for dynamic ARM NEON support, i.e. the ability to probe the CPU at runtime for NEON and provide alternate code paths when it is available. - Add include/core/SkUtilsArm.h, which declares a few helper macros (e.g. SK_NEON_ARM_IS_DYNAMIC), plus the handy function 'sk_cpu_arm_has_neon()' which returns true if the target CPU supports the ARM NEON instruction set. Note that the header is in include/core/ because it will have to be included from NEON-specific code under src/code/ It would probably be more logical to put it under include/opts/ instead, but this would require moving all the NEON-specific stuff under src/code/ into src/opts/, which is not trivial due to the way the code is currently architected. - Add src/core/SkUtilsArm.cpp which implements 'sk_cpu_arm_has_neon' for ARM-based Linux systems, only when SK_NEON_ARM_IS_DYNAMIC is true. (For other cases, 'sk_cpu_arm_has_neon' is an inline function that returns a constant 'true' or 'false' value). There is no user-level accessible CPUID instruction on ARM, so do all CPU feature probing by parsing /proc/cpuinfo. This is Linux-specific. For Debug build types, the CPU probing result is printed to the Android log (or Linux command-line) for easier debugging. - Create a new 'opts_neon' target (static library) which shall contain all the NEON-specific code paths for the library. This is necessary because -mfpu=neon impacts also non-scalar code. Just like with -mssse3 on x86, we can't build the rest of the library with this flag. Note that for now, we only include memset16_neon and memset32_neon in this library. - Modify opts_check_arm.cpp to implement SK_ARM_NEON_IS_DYNAMIC properly. Compared to a 'xoom' build, the only difference is the use of NEON-optimized memset16/32 functions. Later patches will move more NEON-specific code paths to 'opts_neon'. Committed: https://code.google.com/p/skia/source/detail?r=4069

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 4

Patch Set 4 : #

Total comments: 16

Patch Set 5 : #

Total comments: 2

Patch Set 6 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+308 lines, -13 lines) Patch
M gyp/common_conditions.gypi View 2 chunks +9 lines, -1 line 0 comments Download
M gyp/core.gyp View 2 chunks +8 lines, -1 line 0 comments Download
M gyp/opts.gyp View 2 chunks +37 lines, -2 lines 0 comments Download
A include/core/SkUtilsArm.h View 1 2 1 chunk +53 lines, -0 lines 0 comments Download
A src/core/SkUtilsArm.cpp View 1 2 3 4 5 1 chunk +178 lines, -0 lines 0 comments Download
M src/opts/opts_check_arm.cpp View 2 chunks +23 lines, -9 lines 0 comments Download

Messages

Total messages: 19
DerekS
do you want us to start reviewing this or is this CL still a work ...
12 years, 4 months ago (2012-05-29 19:40:10 UTC) #1
digit
On 2012/05/29 19:40:10, DerekS wrote: > do you want us to start reviewing this or ...
12 years, 4 months ago (2012-05-29 19:44:25 UTC) #2
digit
On 2012/05/29 19:44:25, digit wrote: > On 2012/05/29 19:40:10, DerekS wrote: > > do you ...
12 years, 4 months ago (2012-05-29 19:51:57 UTC) #3
reed1
some inline comments, plus a style nit: skia functions (should) place their opening { on ...
12 years, 4 months ago (2012-05-29 20:37:31 UTC) #4
reed1
btw -- I think SkUtilsArm.h is very clear
12 years, 4 months ago (2012-05-29 20:37:52 UTC) #5
digit
http://codereview.appspot.com/6247058/diff/5001/src/core/SkUtilsArm.cpp File src/core/SkUtilsArm.cpp (right): http://codereview.appspot.com/6247058/diff/5001/src/core/SkUtilsArm.cpp#newcode40 src/core/SkUtilsArm.cpp:40: On 2012/05/29 20:37:31, reed1 wrote: > Why not place ...
12 years, 4 months ago (2012-05-29 21:03:15 UTC) #6
digit
Ping. Any chance you can review patch 4 today? I have 3 more waiting after ...
12 years, 4 months ago (2012-05-30 11:16:22 UTC) #7
caryclark1
http://codereview.appspot.com/6247058/diff/9001/src/core/SkUtilsArm.cpp File src/core/SkUtilsArm.cpp (right): http://codereview.appspot.com/6247058/diff/9001/src/core/SkUtilsArm.cpp#newcode32 src/core/SkUtilsArm.cpp:32: # defined D(...) (fprintf(stderr,__VA_ARGS__), fprintf(stderr, "\n")) s/defined/define/ (which makes ...
12 years, 4 months ago (2012-05-30 12:09:36 UTC) #8
DerekS
http://codereview.appspot.com/6247058/diff/9001/src/core/SkUtilsArm.cpp File src/core/SkUtilsArm.cpp (right): http://codereview.appspot.com/6247058/diff/9001/src/core/SkUtilsArm.cpp#newcode30 src/core/SkUtilsArm.cpp:30: # define D(...) __android_log_print(ANDROID_LOG_INFO, "skia", __VA_ARGS__) In addition to ...
12 years, 4 months ago (2012-05-30 12:20:44 UTC) #9
digit
http://codereview.appspot.com/6247058/diff/9001/src/core/SkUtilsArm.cpp File src/core/SkUtilsArm.cpp (right): http://codereview.appspot.com/6247058/diff/9001/src/core/SkUtilsArm.cpp#newcode30 src/core/SkUtilsArm.cpp:30: # define D(...) __android_log_print(ANDROID_LOG_INFO, "skia", __VA_ARGS__) On 2012/05/30 12:20:44, ...
12 years, 4 months ago (2012-05-30 12:32:35 UTC) #10
digit
http://codereview.appspot.com/6247058/diff/9001/src/core/SkUtilsArm.cpp File src/core/SkUtilsArm.cpp (right): http://codereview.appspot.com/6247058/diff/9001/src/core/SkUtilsArm.cpp#newcode169 src/core/SkUtilsArm.cpp:169: static bool sHasArmNeon; Damn, the line above is a ...
12 years, 4 months ago (2012-05-30 12:46:04 UTC) #11
digit
And here comes Patch 5. Please have a look. Thanks.
12 years, 4 months ago (2012-05-30 13:05:43 UTC) #12
DerekS
http://codereview.appspot.com/6247058/diff/9002/src/core/SkUtilsArm.cpp File src/core/SkUtilsArm.cpp (right): http://codereview.appspot.com/6247058/diff/9002/src/core/SkUtilsArm.cpp#newcode47 src/core/SkUtilsArm.cpp:47: # else 403db1eb1e586509e8b2c4feae80670759d565f1 I don't think you intended to ...
12 years, 4 months ago (2012-05-30 13:15:26 UTC) #13
digit
Thanks, a new patch has been uploaded. Surprisingly the old one compiled without complaints, even ...
12 years, 4 months ago (2012-05-30 13:19:47 UTC) #14
digit
http://codereview.appspot.com/6247058/diff/9002/src/core/SkUtilsArm.cpp File src/core/SkUtilsArm.cpp (right): http://codereview.appspot.com/6247058/diff/9002/src/core/SkUtilsArm.cpp#newcode47 src/core/SkUtilsArm.cpp:47: # else 403db1eb1e586509e8b2c4feae80670759d565f1 On 2012/05/30 13:15:26, DerekS wrote: > ...
12 years, 4 months ago (2012-05-30 13:19:55 UTC) #15
reed1
would still like to see functions() { with the open-{ on the same line (in ...
12 years, 4 months ago (2012-05-30 13:51:51 UTC) #16
digit
On 2012/05/30 13:51:51, reed1 wrote: > would still like to see functions() { with the ...
12 years, 4 months ago (2012-05-30 13:52:23 UTC) #17
caryclark1
lgtm
12 years, 4 months ago (2012-05-30 13:57:06 UTC) #18
DerekS
12 years, 4 months ago (2012-05-30 14:03:46 UTC) #19
lgtm
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b