]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.power64] liblink: recognize add instruction as adjusting SP
authorRuss Cox <rsc@golang.org>
Tue, 19 Aug 2014 02:24:15 +0000 (22:24 -0400)
committerShenghou Ma <minux@golang.org>
Tue, 19 Aug 2014 02:24:15 +0000 (22:24 -0400)
LGTM=minux
R=minux
CC=golang-codereviews
https://golang.org/cl/128360043

src/liblink/list9.c
src/liblink/obj9.c

index 9700a16849bb8deab3c62e51ae4736485478e1cc..9e205b7a9ec649d3f20874da53550387086193a1 100644 (file)
@@ -125,6 +125,8 @@ Pconv(Fmt *fp)
                                s += sprint(s, ",%D", &p->from3);
                        sprint(s, ",%D", &p->to);
                }
+               if(p->spadj != 0)
+                       return fmtprint(fp, "%s # spadj=%d", str, p->spadj);
        }
        return fmtstrcpy(fp, str);
 }
index 28793676cc6405291d59742027a92f95ef0e5e56..d0c14dfb5737214396247d2be2156cb586403572 100644 (file)
@@ -617,6 +617,10 @@ addstacksplit(Link *ctxt, LSym *cursym)
                        q->link = q1;
                        break;
 
+               case AADD:
+                       if(p->to.type == D_REG && p->to.reg == REGSP && p->from.type == D_CONST)
+                               p->spadj = -p->from.offset;
+                       break;
                }
        }