Skip to content

Commit

Permalink
[dev.power64] liblink: recognize add instruction as adjusting SP
Browse files Browse the repository at this point in the history
LGTM=minux
R=minux
CC=golang-codereviews
https://golang.org/cl/128360043
  • Loading branch information
rsc authored and minux committed Aug 19, 2014
1 parent d0be55a commit 04d5796
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/liblink/list9.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 4 additions & 0 deletions src/liblink/obj9.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 04d5796

Please sign in to comment.