]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix SSA immediate sign extension on s390x
authorMichael Munday <mike.munday@ibm.com>
Tue, 7 Nov 2017 09:40:56 +0000 (04:40 -0500)
committerMichael Munday <mike.munday@ibm.com>
Tue, 7 Nov 2017 14:18:00 +0000 (14:18 +0000)
commit33c246ff9250ea07b5e0178e0638cb703f90fba3
tree0a145a04afea18d28b3effa8c59239b89081cd43
parent83a1a2ba63cd79ed65a97bead2c31ef0753f4cd2
cmd/compile: fix SSA immediate sign extension on s390x

The CMPWUconst op (32-bit unsigned comparison with immediate) takes
an unsigned immediate value. In SSA this should be sign extended to
64-bits to match the Int32 type given in the op and then zero
extended when producing the final assembly. Before this CL we were
zero extending in SSA which caused ssacheck to fail.

While we are here also ensure other 32-bit immediates are sign
extended in SSA.

Passes toolstash -cmp on std on s390x.

Fixes #22611.

Change-Id: I5c061a76a710b10ecb0650c9c42efd9fa1c123cc
Reviewed-on: https://go-review.googlesource.com/76336
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
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