projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3320a27
)
Decompose Mul(x, 2**b + 2**a) into y = x + x << (b - a), y << a instead of y = x...
author
Christoph Mallon
<christoph.mallon@gmx.de>
Tue, 16 Oct 2007 20:57:43 +0000
(20:57 +0000)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Tue, 16 Oct 2007 20:57:43 +0000
(20:57 +0000)
[r16240]
ir/ir/irarch.c
patch
|
blob
|
history
diff --git
a/ir/ir/irarch.c
b/ir/ir/irarch.c
index
051512a
..
17c8f41
100644
(file)
--- a/
ir/ir/irarch.c
+++ b/
ir/ir/irarch.c
@@
-326,11
+326,16
@@
static instruction *decompose_simple_cases(mul_env *env, unsigned char *R, int r
assert(r == 2);
ins = env->root;
+ if (R[1] <= env->max_S) {
+ ins = emit_LEA(env, ins, ins, R[1]);
+ if (R[0] != 0) {
+ ins = emit_SHIFT(env, ins, R[0]);
+ }
+ return ins;
+ }
if (R[0] != 0) {
ins = emit_SHIFT(env, ins, R[0]);
}
- if (R[1] <= env->max_S)
- return emit_LEA(env, ins, ins, R[1]);
ins2 = emit_SHIFT(env, env->root, R[0] + R[1]);
return emit_LEA(env, ins, ins2, 0);