diff options
| author | 2025-11-12 17:59:29 +0100 | |
|---|---|---|
| committer | 2025-11-12 18:03:51 +0100 | |
| commit | 65244dba4adf96c0c0483b30f3a36089d41bcb67 (patch) | |
| tree | fb10644adf2c703bff8bb2dc8e44b8cc9f569d53 | |
| parent | 82a3c1cd8d00bc342752c31116c497c52f6d8933 (diff) | |
amd64/isel: fold Oext with immediates
| -rw-r--r-- | amd64/isel.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/amd64/isel.c b/amd64/isel.c index c0c6054..23645bb 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -446,6 +446,14 @@ sel(struct function *fn, struct instr *ins, struct block *blk, int *curi) case Ocvtf4f8: case Ocvtf8f4: case Ocvtf4s: case Ocvtf8s: case Ocvts4f: case Ocvts8f: case Ocvtu8f: case Oexts1: case Oextu1: case Oexts2: case Oextu2: case Oexts4: case Oextu4: + if (isnumcon(ins->l)) { + union ref it; + bool ok = foldunop(&it, ins->op, ins->cls, ins->l); + assert(ok); + ins->op = Ocopy; + ins->l = it; + break; + } case Ocopy: fixarg(&ins->l, ins, blk, curi); break; |