fix my sloppy understanding of x86 assembly!
This commit is contained in:
parent
03785fbc9a
commit
ec5042148e
2 changed files with 30 additions and 38 deletions
21
lisc/isel.c
21
lisc/isel.c
|
@ -115,34 +115,15 @@ sel(Ins i, Fn *fn)
|
|||
case OAdd:
|
||||
case OSub:
|
||||
case OCopy:
|
||||
emit(i.op, i.to, i.arg[0], i.arg[1]);
|
||||
break;
|
||||
case OStore:
|
||||
case OStoreb:
|
||||
case OStores:
|
||||
r0 = i.arg[0];
|
||||
goto Load;
|
||||
case OLoad:
|
||||
case OLoadss:
|
||||
case OLoadus:
|
||||
case OLoadsb:
|
||||
case OLoadub:
|
||||
r0 = i.arg[0];
|
||||
if (rtype(r0) == RCon) {
|
||||
t = newtmp(TLong, fn);
|
||||
r0 = TMP(t);
|
||||
}
|
||||
Load:
|
||||
r1 = i.arg[1];
|
||||
if (rtype(r1) == RCon) {
|
||||
t = newtmp(TLong, fn);
|
||||
r1 = TMP(t);
|
||||
}
|
||||
emit(i.op, i.to, r0, r1);
|
||||
if (!req(r0, i.arg[0]))
|
||||
emit(OCopy, r0, i.arg[0], R);
|
||||
if (!req(r1, i.arg[1]))
|
||||
emit(OCopy, r1, i.arg[1], R);
|
||||
emit(i.op, i.to, i.arg[0], i.arg[1]);
|
||||
break;
|
||||
case ONop:
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue