diff options
| author | Cherry Zhang <cherryyz@google.com> | 2019-11-04 18:11:57 -0500 |
|---|---|---|
| committer | Cherry Zhang <cherryyz@google.com> | 2019-11-07 19:20:57 +0000 |
| commit | 3c47eada3f628cbd8a0f47563e6c9287d91d4765 (patch) | |
| tree | a95c2f524420bc6480dafdf218094516454a9050 /src/cmd/internal/obj/ppc64/obj9.go | |
| parent | ceca99bdebf1154879288d108c8506372e1a0173 (diff) | |
| download | go-3c47eada3f628cbd8a0f47563e6c9287d91d4765.tar.xz | |
cmd/internal/obj/ppc64: handle MOVDU for SP delta
If a MOVDU instruction is used with an offset of SP, the
instruction changes SP therefore needs an SP delta, which is used
for generating the PC-SP table for stack unwinding. MOVDU is
frequently used for allocating the frame and saving the LR in the
same instruction, so this is particularly useful.
Change-Id: Icb63eb55aa01c3dc350ac4e4cff6371f4c3c5867
Reviewed-on: https://go-review.googlesource.com/c/go/+/205279
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/internal/obj/ppc64/obj9.go')
| -rw-r--r-- | src/cmd/internal/obj/ppc64/obj9.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cmd/internal/obj/ppc64/obj9.go b/src/cmd/internal/obj/ppc64/obj9.go index 266c982549..4b6910d5ca 100644 --- a/src/cmd/internal/obj/ppc64/obj9.go +++ b/src/cmd/internal/obj/ppc64/obj9.go @@ -961,6 +961,13 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) { if p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP && p.From.Type == obj.TYPE_CONST { p.Spadj = int32(-p.From.Offset) } + case AMOVDU: + if p.To.Type == obj.TYPE_MEM && p.To.Reg == REGSP { + p.Spadj = int32(-p.To.Offset) + } + if p.From.Type == obj.TYPE_MEM && p.From.Reg == REGSP { + p.Spadj = int32(-p.From.Offset) + } case obj.AGETCALLERPC: if cursym.Leaf() { /* MOVD LR, Rd */ |
