}
am->op_type = ia32_AddrModeS;
} else {
+ am->op_type = ia32_Normal;
+
if (flags & match_try_am) {
am->new_op1 = NULL;
am->new_op2 = NULL;
- am->op_type = ia32_Normal;
return;
}
new_op1 = (op1 == NULL ? NULL : be_transform_node(op1));
if (new_op2 == NULL)
new_op2 = be_transform_node(op2);
- am->op_type = ia32_Normal;
- am->ls_mode = get_irn_mode(op2);
- if (flags & match_mode_neutral)
- am->ls_mode = mode_Iu;
+ am->ls_mode =
+ (flags & match_mode_neutral ? mode_Iu : get_irn_mode(op2));
}
if (addr->base == NULL)
addr->base = noreg_gp;
if (get_mode_size_bits(mode) >= 32)
return true;
+ if (is_Proj(transformed_node))
+ return upper_bits_clean(get_Proj_pred(transformed_node), mode);
+
if (is_ia32_Conv_I2I(transformed_node)
|| is_ia32_Conv_I2I8Bit(transformed_node)) {
ir_mode *smaller_mode = get_ia32_ls_mode(transformed_node);
return true;
}
}
+ return upper_bits_clean(get_irn_n(transformed_node, n_ia32_Shr_val), mode);
}
if (is_ia32_And(transformed_node) && !mode_is_signed(mode)) {
return true;
}
}
+ /* TODO recurse? */
}
+ /* TODO recurse on Or, Xor, ... if appropriate? */
+
if (is_ia32_Immediate(transformed_node)
|| is_ia32_Const(transformed_node)) {
const ia32_immediate_attr_t *attr
match_8bit | match_16bit);
/* use 32bit compare mode if possible since the opcode is smaller */
- if (upper_bits_clean(am.new_op1, cmp_mode)
- && upper_bits_clean(am.new_op2, cmp_mode)) {
+ if (upper_bits_clean(am.new_op1, cmp_mode) &&
+ upper_bits_clean(am.new_op2, cmp_mode)) {
cmp_mode = mode_is_signed(cmp_mode) ? mode_Is : mode_Iu;
}
match_16bit_am | match_am_and_immediates |
match_immediate | match_8bit | match_16bit);
/* use 32bit compare mode if possible since the opcode is smaller */
- if (upper_bits_clean(am.new_op1, cmp_mode)
- && upper_bits_clean(am.new_op2, cmp_mode)) {
+ if (upper_bits_clean(am.new_op1, cmp_mode) &&
+ upper_bits_clean(am.new_op2, cmp_mode)) {
cmp_mode = mode_is_signed(cmp_mode) ? mode_Is : mode_Iu;
}