Skip to content

Commit

Permalink
liblink: support MOV $large(FP), R
Browse files Browse the repository at this point in the history
This is compiled as:
	MOV poollit(PC), REGTEMP
	ADD SP, REGTMP, R

This change allows DWORDs for C_LACON in optab, and sets the pool literal
correctly in addpool.

Fixes golang#53
  • Loading branch information
4ad committed Jan 15, 2015
1 parent 3969919 commit 89ddd0f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/liblink/asm7.c
Expand Up @@ -268,6 +268,7 @@ static Optab optab[] = {
{ ADWORD, C_NONE, C_NONE, C_VCON, 11, 8, 0 },
{ ADWORD, C_NONE, C_NONE, C_LEXT, 11, 8, 0 },
{ ADWORD, C_NONE, C_NONE, C_ADDR, 11, 8, 0 },
{ ADWORD, C_NONE, C_NONE, C_LACON, 11, 8, 0 },

{ AWORD, C_NONE, C_NONE, C_LCON, 14, 4, 0 },
{ AWORD, C_NONE, C_NONE, C_LEXT, 14, 4, 0 },
Expand Down Expand Up @@ -807,9 +808,10 @@ addpool(Link *ctxt, Prog *p, Addr *a)
case C_NSOREG:
case C_NPOREG:
case C_LOREG:
case C_LACON:
case C_AACON:
t.to.type = D_CONST;
t.to.offset = ctxt->instoffset;
sz = 4;
break;
}
for(q = ctxt->blitrl; q != nil; q = q->link) /* could hash on t.t0.offset */
Expand Down

0 comments on commit 89ddd0f

Please sign in to comment.