]> Cypherpunks repositories - gostls13.git/commit
cmd/{asm,compile}: replace TESTB op with CMPWconst on s390x
authorMichael Munday <munday@ca.ibm.com>
Fri, 7 Oct 2016 18:29:55 +0000 (14:29 -0400)
committerMichael Munday <munday@ca.ibm.com>
Fri, 7 Oct 2016 20:02:59 +0000 (20:02 +0000)
commit45b26a93f31071deee38b6579da34c2ebe98b978
tree7f27ae2a64cf6d192386a862ca5c37783dd3037a
parentf4e37c8ec5f54964221fc950c2f0260140f438d8
cmd/{asm,compile}: replace TESTB op with CMPWconst on s390x

TESTB was implemented as AND $0xff, Rx, REGTMP. Unfortunately there
is no 3-operand AND-with-immediate instruction and so it was emulated
by the assembler using two instructions.

This CL uses CMPW instead of AND and also optimizes CMPW to use
the chi instruction where possible.

Overall this CL reduces the size of the .text section of the
bin/go binary by ~2%.

Change-Id: Ic335c29fc1129378fcbb1265bfb10f5b744a0f3f
Reviewed-on: https://go-review.googlesource.com/30690
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/asm/internal/asm/testdata/s390x.s
src/cmd/compile/internal/s390x/ssa.go
src/cmd/compile/internal/ssa/gen/S390X.rules
src/cmd/compile/internal/ssa/gen/S390XOps.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewriteS390X.go
src/cmd/internal/obj/s390x/asmz.go