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

Issue 81370046: code review 81370046: runtime: get rid of most uses of REP for copying/zeroing. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years ago by khr
Modified:
10 years, 12 months ago
Reviewers:
gobot, rsc
CC:
golang-codereviews, rsc, r
Visibility:
Public.

Description

runtime: get rid of most uses of REP for copying/zeroing. REP MOVSQ and REP STOSQ have a really high startup overhead. Use a Duff's device to do the repetition instead. benchmark old ns/op new ns/op delta BenchmarkClearFat32 7.20 1.60 -77.78% BenchmarkCopyFat32 6.88 2.38 -65.41% BenchmarkClearFat64 7.15 3.20 -55.24% BenchmarkCopyFat64 6.88 3.44 -50.00% BenchmarkClearFat128 9.53 5.34 -43.97% BenchmarkCopyFat128 9.27 5.56 -40.02% BenchmarkClearFat256 13.8 9.53 -30.94% BenchmarkCopyFat256 13.5 10.3 -23.70% BenchmarkClearFat512 22.3 18.0 -19.28% BenchmarkCopyFat512 22.0 19.7 -10.45% BenchmarkCopyFat1024 36.5 38.4 +5.21% BenchmarkClearFat1024 35.1 35.0 -0.28% TODO: use for stack frame zeroing TODO: REP prefixes are still used for "reverse" copying when src/dst regions overlap. Might be worth fixing.

Patch Set 1 #

Patch Set 2 : diff -r a70a32dc121a https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 3 : diff -r a70a32dc121a https://khr%40golang.org@code.google.com/p/go/ #

Total comments: 2

Patch Set 4 : diff -r 1427fb6bcfa3 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 5 : diff -r 1427fb6bcfa3 https://khr%40golang.org@code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1726 lines, -4 lines) Patch
M src/cmd/6g/cgen.c View 1 2 3 2 chunks +8 lines, -1 line 0 comments Download
M src/cmd/6g/ggen.c View 1 2 3 1 chunk +7 lines, -1 line 0 comments Download
M src/cmd/6g/prog.c View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M src/cmd/6l/6.out.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/8g/cgen.c View 1 2 3 2 chunks +8 lines, -1 line 0 comments Download
M src/cmd/8g/ggen.c View 1 2 3 2 chunks +8 lines, -1 line 0 comments Download
M src/cmd/8g/prog.c View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M src/cmd/8l/8.out.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/liblink/asm6.c View 1 2 3 3 chunks +9 lines, -0 lines 0 comments Download
M src/liblink/asm8.c View 1 2 3 3 chunks +9 lines, -0 lines 0 comments Download
M src/pkg/runtime/asm_386.s View 1 2 1 chunk +794 lines, -0 lines 0 comments Download
M src/pkg/runtime/asm_amd64.s View 1 1 chunk +795 lines, -0 lines 0 comments Download
M src/pkg/runtime/memmove_test.go View 1 1 chunk +80 lines, -0 lines 0 comments Download

Messages

Total messages: 6
khr
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://khr%40golang.org@code.google.com/p/go/
11 years ago (2014-03-27 22:45:44 UTC) #1
khr
On 2014/03/27 22:45:44, khr wrote: > Hello mailto:golang-codereviews@googlegroups.com, > > I'd like you to review ...
11 years ago (2014-04-01 15:29:57 UTC) #2
rsc
Sorry, I haven't scanned golang-codereviews in a few days. Please feel free to add --cc ...
10 years, 12 months ago (2014-04-01 16:50:38 UTC) #3
rsc
LGTM https://codereview.appspot.com/81370046/diff/40001/src/cmd/6g/cgen.c File src/cmd/6g/cgen.c (right): https://codereview.appspot.com/81370046/diff/40001/src/cmd/6g/cgen.c#newcode1459 src/cmd/6g/cgen.c:1459: // 14 = magic constant: see ../../pkg/runtime/asm_amd64.s 128 ...
10 years, 12 months ago (2014-04-01 16:55:04 UTC) #4
khr
*** Submitted as https://code.google.com/p/go/source/detail?r=dd4a24daae43 *** runtime: get rid of most uses of REP for copying/zeroing. ...
10 years, 12 months ago (2014-04-01 19:51:04 UTC) #5
gobot
10 years, 12 months ago (2014-04-01 20:04:03 UTC) #6
Message was sent while issue was closed.
This CL appears to have broken the netbsd-amd64-bsiegert builder.
See http://build.golang.org/log/0092e977d88baa4f0a4a7722db7f7a323b981317
Sign in to reply to this message.

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