diff options
| author | 2025-09-13 19:06:36 +0200 | |
|---|---|---|
| committer | 2025-09-13 19:10:19 +0200 | |
| commit | 9fb8b66bb742ecdace257f2bdd10c4c5cd7f7310 (patch) | |
| tree | d0c279136f76b3a0debc1f327bd94c6aec1be281 /amd64 | |
| parent | f91e875faf492c73e10cfb9e3183f676ba7d8d6c (diff) | |
regalloc: basic spilling support
Diffstat (limited to 'amd64')
| -rw-r--r-- | amd64/emit.c | 6 | ||||
| -rw-r--r-- | amd64/sysv.c | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/amd64/emit.c b/amd64/emit.c index 6634c64..df4c4cd 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -952,6 +952,12 @@ emitinstr(uchar **pcode, struct function *fn, struct block *blk, int curi, struc Xxor(pcode, cls, l, r); } break; + case Oxsave: + Xpush(pcode, mkregoper(ins->l).reg); + break; + case Oxrestore: + Xpop(pcode, mkregoper(ins->l).reg); + break; case Ocall: if (calltab.p[ins->r.i].vararg >= 0) { struct call *call = &calltab.p[ins->r.i]; diff --git a/amd64/sysv.c b/amd64/sysv.c index 9ecc09f..43ecd3c 100644 --- a/amd64/sysv.c +++ b/amd64/sysv.c @@ -139,6 +139,7 @@ static const char amd64_rnames[][6] = { const struct mctarg t_amd64_sysv = { .gpr0 = RAX, .ngpr = R15 - RAX + 1, .bpr = RBP, + .gprscratch = R11, .fprscratch = XMM15, .fpr0 = XMM0, .nfpr = XMM15 - XMM0 + 1, .rcallee = 1<<RBX | 1<<R12 | 1<<R13 | 1<<R14 | 1<<R15, .rglob = 1<<RSP | 1<<RBP, |