aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--amd64/isel.c8
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;