]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: merge loads into operations on s390x
authorMichael Munday <munday@ca.ibm.com>
Wed, 14 Sep 2016 14:42:14 +0000 (10:42 -0400)
committerMichael Munday <munday@ca.ibm.com>
Mon, 17 Oct 2016 19:45:20 +0000 (19:45 +0000)
commit1cfb5c3fd5578a3665231a302ef7f03abec78d1d
tree091e2b6aef827ecef6b626559ac0dd7055b1c80d
parent92221fe8bc73ec6d487bd479f9739fdddb6fcada
cmd/compile: merge loads into operations on s390x

Adds the new canMergeLoad function which can be used by rules to
decide whether a load can be merged into an operation. The function
ensures that the merge will not reorder the load relative to memory
operations (for example, stores) in such a way that the block can no
longer be scheduled.

This new function enables transformations such as:

MOVD 0(R1), R2
ADD  R2, R3

to:

ADD  0(R1), R3

The two-operand form of the following instructions can now read a
single memory operand:

 - ADD
 - ADDC
 - ADDW
 - MULLD
 - MULLW
 - SUB
 - SUBC
 - SUBE
 - SUBW
 - AND
 - ANDW
 - OR
 - ORW
 - XOR
 - XORW

Improves SHA3 performance by 6-8%.

Updates #15054.

Change-Id: Ibcb9122126cd1a26f2c01c0dfdbb42fe5e7b5b94
Reviewed-on: https://go-review.googlesource.com/29272
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@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/rewrite.go
src/cmd/compile/internal/ssa/rewriteS390X.go
src/cmd/internal/obj/s390x/asmz.go