Commit 445d6c9b authored by Matthias Braun's avatar Matthias Braun
Browse files

slightly simplify lea(x>>2,x>>2,4) matcher

parent 2aba2bc9
......@@ -375,18 +375,18 @@ void x86_create_address_mode(x86_address_t *addr, ir_node *node,
/* (x & 0xFFFFFFFC) + (x >> 2) -> lea(x >> 2, x >> 2, 4) */
if (left != NULL && right != NULL) {
ir_node *and = NULL;
ir_node *shr = NULL;
ir_node *and;
ir_node *shr;
if (is_And(left) && (is_Shr(right) || is_Shrs(right))) {
and = left;
shr = right;
} else if (is_And(right) && (is_Shr(left) || is_Shrs(left))) {
goto tryit;
}
if (is_And(right) && (is_Shr(left) || is_Shrs(left))) {
and = right;
shr = left;
}
if (and != NULL && get_And_left(and) == get_binop_left(shr)) {
tryit:
if (get_And_left(and) == get_binop_left(shr)) {
ir_node *and_right = get_And_right(and);
ir_node *shr_right = get_binop_right(shr);
......@@ -408,6 +408,7 @@ void x86_create_address_mode(x86_address_t *addr, ir_node *node,
}
}
}
}
if (left != NULL) {
if (addr->base != NULL) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment