]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: use load and test instructions on s390x
authorRuixin(Peter) Bao <ruixin.bao@ibm.com>
Tue, 26 Nov 2019 20:33:37 +0000 (15:33 -0500)
committerMichael Munday <mike.munday@ibm.com>
Wed, 25 Mar 2020 13:10:07 +0000 (13:10 +0000)
commit16cfab8d89ec26a71356c73378ab92eafa6a7356
tree791a02e574a9eb3635161cf044a1408502412ce0
parent6b6414cab49fcc035e1f20bafdb723077e7d36bb
cmd/compile: use load and test instructions on s390x

The load and test instructions compare the given value
against zero and will produce a condition code indicating
one of the following scenarios:

0: Result is zero
1: Result is less than zero
2: Result is greater than zero
3: Result is not a number (NaN)

The instruction can be used to simplify floating point comparisons
against zero, which can enable further optimizations.

This CL also reduces the size of .text section of math.test binary by around
0.7 KB (in hexadecimal, from 1358f0 to 135620).

Change-Id: I33cb714f0c6feebac7a1c46dfcc735e7daceff9c
Reviewed-on: https://go-review.googlesource.com/c/go/+/209159
Reviewed-by: Michael Munday <mike.munday@ibm.com>
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
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
test/codegen/floats.go