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

Issue 21703003: Minor sk_memset{16|32}_SSE2 optimization. (Closed)

Created:
7 years, 4 months ago by f(malita)
Modified:
7 years, 4 months ago
Reviewers:
Stephen White, reed1
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

Minor sk_memset{16|32}_SSE2 optimization. Using explicitly indexed references allows some compilers to generate more efficient loops. For gcc 4.6.3: 613c18: 83 ea 10 sub $0x10,%edx 613c1b: 66 0f 7f 07 movdqa %xmm0,(%rdi) 613c1f: 66 0f 7f 47 10 movdqa %xmm0,0x10(%rdi) 613c24: 66 0f 7f 47 20 movdqa %xmm0,0x20(%rdi) 613c29: 66 0f 7f 47 30 movdqa %xmm0,0x30(%rdi) 613c2e: 48 83 c7 40 add $0x40,%rdi 613c32: 83 fa 0f cmp $0xf,%edx 613c35: 7f e1 jg 613c18 <_Z16sk_memset32_SSE2Pjji+0x38> vs. previous: 613c18: 83 ea 10 sub $0x10,%edx 613c1b: 66 0f 7f 07 movdqa %xmm0,(%rdi) 613c1f: 66 0f 7f 47 10 movdqa %xmm0,0x10(%rdi) 613c24: 66 0f 7f 47 20 movdqa %xmm0,0x20(%rdi) 613c29: 48 83 c7 40 add $0x40,%rdi 613c2d: 83 fa 0f cmp $0xf,%edx 613c30: 66 0f 7f 47 f0 movdqa %xmm0,-0x10(%rdi) 613c35: 7f e1 jg 613c18 <_Z16sk_memset32_SSE2Pjji+0x38> This yields a 0.2% - 1% improvement with the memset micro benchmarks, presumably due to avoiding a stall on the next store after the %rdi increment. R=reed@google.com,senorblanco@chromium.org Committed: http://code.google.com/p/skia/source/detail?r=10545

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -8 lines) Patch
M src/opts/SkUtils_opts_SSE2.cpp View 2 chunks +10 lines, -8 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
f(malita)
Memset bench numbers (sorted) for 10 runs of nice -n -20 taskset 0x00000001 bench --timers ...
7 years, 4 months ago (2013-08-04 18:01:43 UTC) #1
Stephen White
LGTM. Hard to believe the compiler can't figure that out.
7 years, 4 months ago (2013-08-05 13:56:55 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/fmalita@chromium.org/21703003/1
7 years, 4 months ago (2013-08-05 20:21:13 UTC) #3
commit-bot: I haz the power
7 years, 4 months ago (2013-08-05 20:26:02 UTC) #4
Message was sent while issue was closed.
Change committed as 10545

Powered by Google App Engine
This is Rietveld 408576698