• Michael Munday's avatar
    cmd/compile: fix SSA immediate sign extension on s390x · 33c246ff
    Michael Munday authored
    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: 's avatarCherry Zhang <cherryyz@google.com>
    33c246ff
ssa.go 23.5 KB