aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Munday <mike.munday@ibm.com>2020-04-01 03:21:03 -0700
committerMichael Munday <mike.munday@ibm.com>2020-04-02 13:38:07 +0000
commita7a0f0305035948f4c86e08e6e64409ab11a6f67 (patch)
tree3bb5b2e0db73e9cbd7bdd29da9cb9cda413d59eb
parent801cd7c84d42dcf18256416524aa0d31d6305830 (diff)
downloadgo-a7a0f0305035948f4c86e08e6e64409ab11a6f67.tar.gz
go-a7a0f0305035948f4c86e08e6e64409ab11a6f67.zip
cmd/compile: mark 'store multiple' as clobbering flags on s390x
Store multiple instructions can clobber flags on s390x when the offset passed into the assembler is outside the range representable with a signed 20 bit integer. This is because the assembler uses the agfi instruction to implement the large offset. The assembler could use a different sequence of instructions, but for now just mark the instruction as 'clobberFlags' since this is risk free. Noticed while investigating #38195. No test yet since I'm not sure how to get this bug to trigger and I haven't seen it affect real code. Change-Id: I4a6ab96455a3ef8ffacb76ef0166b97eb40ff925 Reviewed-on: https://go-review.googlesource.com/c/go/+/226759 Run-TryBot: Michael Munday <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-rw-r--r--src/cmd/compile/internal/ssa/gen/S390XOps.go6
-rw-r--r--src/cmd/compile/internal/ssa/opGen.go6
2 files changed, 12 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/gen/S390XOps.go b/src/cmd/compile/internal/ssa/gen/S390XOps.go
index 283a0fa6b5..65460bf6f7 100644
--- a/src/cmd/compile/internal/ssa/gen/S390XOps.go
+++ b/src/cmd/compile/internal/ssa/gen/S390XOps.go
@@ -630,6 +630,7 @@ func init() {
asm: "STMG",
faultOnNilArg0: true,
symEffect: "Write",
+ clobberFlags: true, // TODO(mundaym): currently uses AGFI to handle large offsets
},
{
name: "STMG3",
@@ -640,6 +641,7 @@ func init() {
asm: "STMG",
faultOnNilArg0: true,
symEffect: "Write",
+ clobberFlags: true, // TODO(mundaym): currently uses AGFI to handle large offsets
},
{
name: "STMG4",
@@ -657,6 +659,7 @@ func init() {
asm: "STMG",
faultOnNilArg0: true,
symEffect: "Write",
+ clobberFlags: true, // TODO(mundaym): currently uses AGFI to handle large offsets
},
{
name: "STM2",
@@ -667,6 +670,7 @@ func init() {
asm: "STMY",
faultOnNilArg0: true,
symEffect: "Write",
+ clobberFlags: true, // TODO(mundaym): currently uses AGFI to handle large offsets
},
{
name: "STM3",
@@ -677,6 +681,7 @@ func init() {
asm: "STMY",
faultOnNilArg0: true,
symEffect: "Write",
+ clobberFlags: true, // TODO(mundaym): currently uses AGFI to handle large offsets
},
{
name: "STM4",
@@ -694,6 +699,7 @@ func init() {
asm: "STMY",
faultOnNilArg0: true,
symEffect: "Write",
+ clobberFlags: true, // TODO(mundaym): currently uses AGFI to handle large offsets
},
// large move
diff --git a/src/cmd/compile/internal/ssa/opGen.go b/src/cmd/compile/internal/ssa/opGen.go
index 46ca7936dc..bf48bff8f1 100644
--- a/src/cmd/compile/internal/ssa/opGen.go
+++ b/src/cmd/compile/internal/ssa/opGen.go
@@ -30110,6 +30110,7 @@ var opcodeTable = [...]opInfo{
name: "STMG2",
auxType: auxSymOff,
argLen: 4,
+ clobberFlags: true,
faultOnNilArg0: true,
symEffect: SymWrite,
asm: s390x.ASTMG,
@@ -30125,6 +30126,7 @@ var opcodeTable = [...]opInfo{
name: "STMG3",
auxType: auxSymOff,
argLen: 5,
+ clobberFlags: true,
faultOnNilArg0: true,
symEffect: SymWrite,
asm: s390x.ASTMG,
@@ -30141,6 +30143,7 @@ var opcodeTable = [...]opInfo{
name: "STMG4",
auxType: auxSymOff,
argLen: 6,
+ clobberFlags: true,
faultOnNilArg0: true,
symEffect: SymWrite,
asm: s390x.ASTMG,
@@ -30158,6 +30161,7 @@ var opcodeTable = [...]opInfo{
name: "STM2",
auxType: auxSymOff,
argLen: 4,
+ clobberFlags: true,
faultOnNilArg0: true,
symEffect: SymWrite,
asm: s390x.ASTMY,
@@ -30173,6 +30177,7 @@ var opcodeTable = [...]opInfo{
name: "STM3",
auxType: auxSymOff,
argLen: 5,
+ clobberFlags: true,
faultOnNilArg0: true,
symEffect: SymWrite,
asm: s390x.ASTMY,
@@ -30189,6 +30194,7 @@ var opcodeTable = [...]opInfo{
name: "STM4",
auxType: auxSymOff,
argLen: 6,
+ clobberFlags: true,
faultOnNilArg0: true,
symEffect: SymWrite,
asm: s390x.ASTMY,