diff options
| author | Quentin Carbonneaux <[email protected]> | 2024-06-19 10:50:54 +0200 |
|---|---|---|
| committer | Quentin Carbonneaux <[email protected]> | 2024-06-19 10:58:17 +0200 |
| commit | 7de34d3454e0a6a4e66b414f03441723d340dec5 (patch) | |
| tree | 5c2165a037c164b2f99b6acc4fb3cc8de5cb2afa /simpl.c | |
| parent | 6dab93b4b236a884d56c907d741148baa15dbbc5 (diff) | |
no mul->shl as it confuses address matching
Additionally, the strength-reduction
for small powers of two is handled
by amd64/emit.c now.
Diffstat (limited to 'simpl.c')
| -rw-r--r-- | simpl.c | 12 |
1 files changed, 1 insertions, 11 deletions
@@ -81,13 +81,6 @@ ins(Ins **pi, int *new, Blk *b, Fn *fn) blit((i-1)->arg, rsval(i->arg[0]), fn); *pi = i-1; return; - case Omul: - if (rtype(i->arg[0]) == RCon) { - r = i->arg[0]; - i->arg[0] = i->arg[1]; - i->arg[1] = r; - } - /* fall through */ case Oudiv: case Ourem: r = i->arg[1]; @@ -100,12 +93,9 @@ ins(Ins **pi, int *new, Blk *b, Fn *fn) if (i->op == Ourem) { i->op = Oand; i->arg[1] = getcon((1ull<<n) - 1, fn); - } else if (i->op == Oudiv) { + } else { i->op = Oshr; i->arg[1] = getcon(n, fn); - } else if (i->op == Omul) { - i->op = Oshl; - i->arg[1] = getcon(n, fn); } } } |
