go/src
Kirill Smelkov bd91e3569a cmd/compile/internal/ssa: generate bswap/store for indexed bigendian byte stores too on AMD64
Commit 10f75748 (CL 32222) added rewrite rules to combine byte loads/stores +
shifts into larger loads/stores + bswap. For loads both MOVBload and
MOVBloadidx1 were handled but for store only MOVBstore was there without
MOVBstoreidx added to rewrite pattern. Fix it.

Here is how generated code changes for the following 2 functions
(ommitting staying the same prologue/epilogue):

    func put32(b []byte, i int, v uint32) {
            binary.BigEndian.PutUint32(b[i:], v)
    }

    func put64(b []byte, i int, v uint64) {
            binary.BigEndian.PutUint64(b[i:], v)
    }

"".put32 t=1 size=100 args=0x28 locals=0x0

	// before
	0x0032 00050 (x.go:5)	MOVL	CX, DX
	0x0034 00052 (x.go:5)	SHRL	$24, CX
	0x0037 00055 (x.go:5)	MOVQ	"".b+8(FP), BX
	0x003c 00060 (x.go:5)	MOVB	CL, (BX)(AX*1)
	0x003f 00063 (x.go:5)	MOVL	DX, CX
	0x0041 00065 (x.go:5)	SHRL	$16, DX
	0x0044 00068 (x.go:5)	MOVB	DL, 1(BX)(AX*1)
	0x0048 00072 (x.go:5)	MOVL	CX, DX
	0x004a 00074 (x.go:5)	SHRL	$8, CX
	0x004d 00077 (x.go:5)	MOVB	CL, 2(BX)(AX*1)
	0x0051 00081 (x.go:5)	MOVB	DL, 3(BX)(AX*1)

	// after
	0x0032 00050 (x.go:5)	BSWAPL	CX
	0x0034 00052 (x.go:5)	MOVQ	"".b+8(FP), DX
	0x0039 00057 (x.go:5)	MOVL	CX, (DX)(AX*1)

"".put64 t=1 size=155 args=0x28 locals=0x0

	// before
	0x0037 00055 (x.go:9)	MOVQ	CX, DX
	0x003a 00058 (x.go:9)	SHRQ	$56, CX
	0x003e 00062 (x.go:9)	MOVQ	"".b+8(FP), BX
	0x0043 00067 (x.go:9)	MOVB	CL, (BX)(AX*1)
	0x0046 00070 (x.go:9)	MOVQ	DX, CX
	0x0049 00073 (x.go:9)	SHRQ	$48, DX
	0x004d 00077 (x.go:9)	MOVB	DL, 1(BX)(AX*1)
	0x0051 00081 (x.go:9)	MOVQ	CX, DX
	0x0054 00084 (x.go:9)	SHRQ	$40, CX
	0x0058 00088 (x.go:9)	MOVB	CL, 2(BX)(AX*1)
	0x005c 00092 (x.go:9)	MOVQ	DX, CX
	0x005f 00095 (x.go:9)	SHRQ	$32, DX
	0x0063 00099 (x.go:9)	MOVB	DL, 3(BX)(AX*1)
	0x0067 00103 (x.go:9)	MOVQ	CX, DX
	0x006a 00106 (x.go:9)	SHRQ	$24, CX
	0x006e 00110 (x.go:9)	MOVB	CL, 4(BX)(AX*1)
	0x0072 00114 (x.go:9)	MOVQ	DX, CX
	0x0075 00117 (x.go:9)	SHRQ	$16, DX
	0x0079 00121 (x.go:9)	MOVB	DL, 5(BX)(AX*1)
	0x007d 00125 (x.go:9)	MOVQ	CX, DX
	0x0080 00128 (x.go:9)	SHRQ	$8, CX
	0x0084 00132 (x.go:9)	MOVB	CL, 6(BX)(AX*1)
	0x0088 00136 (x.go:9)	MOVB	DL, 7(BX)(AX*1)

	// after
	0x0033 00051 (x.go:9)	BSWAPQ	CX
	0x0036 00054 (x.go:9)	MOVQ	"".b+8(FP), DX
	0x003b 00059 (x.go:9)	MOVQ	CX, (DX)(AX*1)

Updates #17151

Change-Id: I3f4a7f28f210e62e153e60da5abd1d39508cc6c4
Reviewed-on: https://go-review.googlesource.com/34635
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
2017-02-14 18:35:43 +00:00
..
archive time: record monotonic clock reading in time.Now, for more accurate comparisons 2017-02-03 19:04:52 +00:00
bufio
builtin
bytes bytes, strings: optimize Split* 2017-02-08 18:39:43 +00:00
cmd cmd/compile/internal/ssa: generate bswap/store for indexed bigendian byte stores too on AMD64 2017-02-14 18:35:43 +00:00
compress all: test adjustments for the iOS builder 2017-01-14 03:27:53 +00:00
container
context context: lazily initialize cancelCtx done channel 2017-02-01 20:08:41 +00:00
crypto crypto/sha512: Add AVX2 version for AMD64 2017-02-10 16:26:32 +00:00
database/sql database/sql: convert test timeouts to explicit waits with checks 2017-02-13 19:05:28 +00:00
debug
encoding encoding/json: clarify documention for Unmarshal into a pointer. 2017-02-10 13:39:10 +00:00
errors
expvar expvar: make BenchmarkAdd{Same,Different} comparable to 1.8 2017-02-10 20:08:14 +00:00
flag
fmt
go net: refactor poller into new internal/poll package 2017-02-13 18:36:28 +00:00
hash hash/crc32: use sub-benchmarks 2017-02-08 17:17:08 +00:00
html
image image/png: reduce memory allocs encoding images by reusing buffers 2017-02-12 05:40:47 +00:00
index/suffixarray
internal internal/poll: only build str.go on plan9 2017-02-14 02:02:39 +00:00
io io: fix test when MultiReader is inlined with -l=3 2017-02-02 18:56:20 +00:00
log
math all: fix some printf format strings 2017-02-14 02:09:30 +00:00
mime mime/multipart: allow boundary len <= 70 2017-02-01 21:06:49 +00:00
net net/http: document ErrServerClosed 2017-02-14 16:36:23 +00:00
os os: make Stdin.Stat() return ModeCharDevice if Stdin is console 2017-02-07 23:59:31 +00:00
path path/filepath: add test for directory junction walk 2017-02-12 23:33:01 +00:00
plugin plugin: remove unnecessary import "C" from example 2017-02-09 18:32:53 +00:00
reflect reflect: clear ptrToThis in Ptr when allocating result on heap 2017-02-10 17:22:07 +00:00
regexp
runtime runtime: remove g.stackAlloc 2017-02-14 15:52:56 +00:00
sort sort: optimize average calculation in symMerge and doPivot. 2017-02-10 16:53:24 +00:00
strconv
strings strings: make parameters names less confusing 2017-02-11 19:55:21 +00:00
sync
syscall cmd/go: add "syscall" to the set of packages that run extFiles++ 2017-02-13 20:28:02 +00:00
testing testing: fix copy/paste in docs 2017-02-11 22:56:41 +00:00
text text/template: fix method lookup on addressable nil pointer 2017-02-09 14:58:40 +00:00
time time: add Duration.Truncate and Duration.Round 2017-02-14 00:40:31 +00:00
unicode
unsafe
vendor/golang_org/x vendor/golang.org/x/crypto/curve25519: avoid loss of R15 in -dynlink mode 2017-02-06 20:14:03 +00:00
Make.dist
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash buildall.bash: clarify target selection 2017-02-04 04:34:36 +00:00
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash
make.bash
make.bat
make.rc
naclmake.bash
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc