diff options
| author | Keith Randall <khr@google.com> | 2018-10-30 12:58:50 -0700 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2018-10-30 20:27:03 +0000 |
| commit | 0ad332d80cf3e2bbeef5f1e5f5eb50272bbde92e (patch) | |
| tree | 70a1799013122163e84bade9e89ffa85d911ee0a /test/codegen/strings.go | |
| parent | 56b7c61c5e88e684c1bdb3b9ae61dadbeda96fd0 (diff) | |
| download | go-0ad332d80cf3e2bbeef5f1e5f5eb50272bbde92e.tar.xz | |
cmd/compile: implement some moves using non-overlapping reads&writes
For moves >8,<16 bytes, do a move using non-overlapping loads/stores
if it would require no more instructions.
This helps a bit with the case when the move is from a static
constant, because then the code to materialize the value being moved
is smaller.
Change-Id: Ie47a5a7c654afeb4973142b0a9922faea13c9b54
Reviewed-on: https://go-review.googlesource.com/c/146019
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'test/codegen/strings.go')
| -rw-r--r-- | test/codegen/strings.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/codegen/strings.go b/test/codegen/strings.go index 39ee2e8b9f..d688b6cbf9 100644 --- a/test/codegen/strings.go +++ b/test/codegen/strings.go @@ -44,6 +44,18 @@ func ConstantLoad() { // 386:`MOVL\t\$858927408, \(`,`DUFFCOPY` // arm64:`MOVD\t\$3978425819141910832`,`MOVD\t\$1650538808`,`MOVD\t\$25699`,`MOVD\t\$101` bsink = []byte("0123456789abcde") + + // 56 = 0x38 + // amd64:`MOVQ\t\$3978425819141910832`,`MOVB\t\$56` + bsink = []byte("012345678") + + // 14648 = 0x3938 + // amd64:`MOVQ\t\$3978425819141910832`,`MOVW\t\$14648` + bsink = []byte("0123456789") + + // 1650538808 = 0x62613938 + // amd64:`MOVQ\t\$3978425819141910832`,`MOVL\t\$1650538808` + bsink = []byte("0123456789ab") } var bsink []byte |
