mirror of
git://c9x.me/qbe.git
synced 2026-05-26 15:34:41 +00:00
Compare commits
2 Commits
f36c06c3ee
...
ac79f8fd02
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac79f8fd02 | ||
|
|
84516c7484 |
15
amd64/emit.c
15
amd64/emit.c
@ -199,7 +199,7 @@ emitcon(Con *con, E *e)
|
|||||||
assert(!T.apple);
|
assert(!T.apple);
|
||||||
fprintf(e->f, "%%fs:%s%s@tpoff", p, l);
|
fprintf(e->f, "%%fs:%s%s@tpoff", p, l);
|
||||||
} else {
|
} else {
|
||||||
assert(con->sym.type == SGlo);
|
assert((con->sym.type & ~SExt) == SGlo);
|
||||||
fprintf(e->f, "%s%s", p, l);
|
fprintf(e->f, "%s%s", p, l);
|
||||||
}
|
}
|
||||||
if (con->bits.i)
|
if (con->bits.i)
|
||||||
@ -544,7 +544,8 @@ emitins(Ins i, E *e)
|
|||||||
regtoa(i.to.val, SLong));
|
regtoa(i.to.val, SLong));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!T.apple && con->sym.type == SThr) {
|
switch (con->sym.type) {
|
||||||
|
case SThr:
|
||||||
/* derive the symbol address from the TCB
|
/* derive the symbol address from the TCB
|
||||||
* address at offset 0 of %fs */
|
* address at offset 0 of %fs */
|
||||||
emitf("movq %%fs:0, %L=", &i, e);
|
emitf("movq %%fs:0, %L=", &i, e);
|
||||||
@ -557,8 +558,7 @@ emitins(Ins i, E *e)
|
|||||||
regtoa(i.to.val, SLong),
|
regtoa(i.to.val, SLong),
|
||||||
regtoa(i.to.val, SLong));
|
regtoa(i.to.val, SLong));
|
||||||
break;
|
break;
|
||||||
}
|
case SExtThr:
|
||||||
if (!T.apple && con->sym.type == SExtThr) {
|
|
||||||
/* initial-exec TLS: load offset from
|
/* initial-exec TLS: load offset from
|
||||||
* GOT, add to thread-base register */
|
* GOT, add to thread-base register */
|
||||||
assert(!con->bits.i);
|
assert(!con->bits.i);
|
||||||
@ -568,8 +568,7 @@ emitins(Ins i, E *e)
|
|||||||
sym[0] == '"' ? "" : T.assym, sym,
|
sym[0] == '"' ? "" : T.assym, sym,
|
||||||
regtoa(i.to.val, SLong));
|
regtoa(i.to.val, SLong));
|
||||||
break;
|
break;
|
||||||
}
|
case SExt:
|
||||||
if (con->sym.type == SExt) {
|
|
||||||
/* load address from the GOT */
|
/* load address from the GOT */
|
||||||
assert(!con->bits.i);
|
assert(!con->bits.i);
|
||||||
fprintf(e->f,
|
fprintf(e->f,
|
||||||
@ -577,8 +576,10 @@ emitins(Ins i, E *e)
|
|||||||
sym[0] == '"' ? "" : T.assym, sym,
|
sym[0] == '"' ? "" : T.assym, sym,
|
||||||
regtoa(i.to.val, SLong));
|
regtoa(i.to.val, SLong));
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
goto Table;
|
||||||
}
|
}
|
||||||
goto Table;
|
break;
|
||||||
case Ocall:
|
case Ocall:
|
||||||
/* calls simply have a weird syntax in AT&T
|
/* calls simply have a weird syntax in AT&T
|
||||||
* assembly... */
|
* assembly... */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user