Skip to content

Commit

Permalink
cmd/compile: mark 'store multiple' as clobbering flags on s390x
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mundaym committed Apr 2, 2020
1 parent 801cd7c commit a7a0f03
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/cmd/compile/internal/ssa/gen/S390XOps.go
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/cmd/compile/internal/ssa/opGen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a7a0f03

Please sign in to comment.