diff options
| author | 2023-08-07 23:10:55 +0200 | |
|---|---|---|
| committer | 2023-08-07 23:10:55 +0200 | |
| commit | 1e3093b6208d33c6cdbb355078fc7b6d66f7f9d1 (patch) | |
| tree | ea21d95f3d46836d386157ab3be835d446565ac0 | |
| parent | e17d87d38b7e9f0df87ee6986f86e9c6712d017a (diff) | |
amd64: fix isel for numeric conversion ops
| -rw-r--r-- | amd64/isel.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/amd64/isel.c b/amd64/isel.c index df972fd..fcd4ab3 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -357,14 +357,12 @@ sel(struct function *fn, struct instr *ins, struct block *blk, int *curi) if (iscon(ins->l)) rswap(ins->l, ins->r); case Oneg: case Onot: - case Ocvtf4f8: case Ocvtf8f4: case Ocvtf4s: case Ocvtf8s: - case Oexts1: case Oextu1: case Oexts2: case Oextu2: case Oexts4: case Oextu4: ALU: if (!(op == Oadd && kisint(ins->cls))) /* 3-address add is lea */ if (!(in_range(op, Omul, Oumul) && kisint(ins->cls) && isimm32(ins->r))) /* for (I)MUL r,r/m,imm */ ins->inplace = 1; - if (ins->l.t != RTMP && ins->l.t != RREG) - ins->l = insertinstr(blk, (*curi)++, mkinstr(Ocopy, ins->cls, ins->l)); + if (iscon(ins->l)) + ins->l = insertinstr(blk, (*curi)++, mkinstr(Ocopy, concls(ins->l), ins->l)); if (ins->r.bits) case Omove: fixarg(&ins->r, ins, blk, curi); @@ -379,6 +377,8 @@ sel(struct function *fn, struct instr *ins, struct block *blk, int *curi) ins->l = insertinstr(blk, (*curi)++, mkinstr(Ocopy, KPTR, ins->l)); fixarg(&ins->r, ins, blk, curi); break; + case Ocvtf4f8: case Ocvtf8f4: case Ocvtf4s: case Ocvtf8s: + case Oexts1: case Oextu1: case Oexts2: case Oextu2: case Oexts4: case Oextu4: case Ocopy: fixarg(&ins->l, ins, blk, curi); break; |