diff options
| author | Ben Shi <powerman1st@163.com> | 2018-10-18 05:11:38 +0000 |
|---|---|---|
| committer | Ben Shi <powerman1st@163.com> | 2018-10-19 02:21:04 +0000 |
| commit | 95dda75bde8a6625b857b5f8013eed5e9563fd02 (patch) | |
| tree | 71637cbd3647d13d1518781a3a845399c3b52bd0 /test/codegen | |
| parent | 2d58fbac2f4c5c77b219e4d94b89c218ffa6f98f (diff) | |
| download | go-95dda75bde8a6625b857b5f8013eed5e9563fd02.tar.xz | |
cmd/compile: optimize store combination on 386/amd64
This CL add 3 rules to combine byte-store to word-store on386 and
amd64.
Change-Id: Iffd9cda42f1961680c81def4edc773ad58f211b3
Reviewed-on: https://go-review.googlesource.com/c/143057
Run-TryBot: Ben Shi <powerman1st@163.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'test/codegen')
| -rw-r--r-- | test/codegen/memcombine.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/codegen/memcombine.go b/test/codegen/memcombine.go index db49142e25..b3d2cb2067 100644 --- a/test/codegen/memcombine.go +++ b/test/codegen/memcombine.go @@ -434,6 +434,7 @@ func store_le_byte_2(b []byte, val uint16) { func store_le_byte_2_inv(b []byte, val uint16) { _ = b[2] // 386:`MOVW\s[A-Z]+,\s1\([A-Z]+\)`,-`MOVB` + // amd64:`MOVW\s[A-Z]+,\s1\([A-Z]+\)`,-`MOVB` b[2], b[1] = byte(val>>8), byte(val) } @@ -542,6 +543,8 @@ func zero_byte_2(b1, b2 []byte) { // 386:`MOVW\s[$]0,\s\([A-Z]+\)` b1[0], b1[1] = 0, 0 // arm64:"MOVH\tZR",-"MOVB" + // 386:`MOVW\s[$]0,\s\([A-Z]+\)` + // amd64:`MOVW\s[$]0,\s\([A-Z]+\)` b2[1], b2[0] = 0, 0 } @@ -596,6 +599,8 @@ func zero_uint16_2(h1, h2 []uint16) { // 386:`MOVL\s[$]0,\s\([A-Z]+\)` h1[0], h1[1] = 0, 0 // arm64:"MOVW\tZR",-"MOVB",-"MOVH" + // amd64:`MOVL\s[$]0,\s\([A-Z]+\)` + // 386:`MOVL\s[$]0,\s\([A-Z]+\)` h2[1], h2[0] = 0, 0 } @@ -620,6 +625,7 @@ func zero_uint32_2(w1, w2 []uint32) { // amd64:`MOVQ\s[$]0,\s\([A-Z]+\)` w1[0], w1[1] = 0, 0 // arm64:"MOVD\tZR",-"MOVB",-"MOVH",-"MOVW" + // amd64:`MOVQ\s[$]0,\s\([A-Z]+\)` w2[1], w2[0] = 0, 0 } |
