} ia32_am_type_t;
typedef enum {
- match_commutative = 1 << 0, /**< inputs are commutative */
- match_am_and_immediates = 1 << 1, /**< node supports AM and immediate at
- the same time */
- match_am = 1 << 2, /**< node supports (32bit) source AM */
- match_8bit_am = 1 << 3, /**< node supports 8bit source AM */
- match_16bit_am = 1 << 4, /**< node supports 16bit source AM */
- match_immediate = 1 << 5, /**< node supports immediates */
- match_8bit = 1 << 6, /**< supports 8 bit modes natively */
- match_16bit = 1 << 7, /**< supports 16bit modes natively */
- match_mode_neutral = 1 << 8, /**< 16 and 8 bit modes can be emulated
- by 32 bit operations */
- match_try_am = 1 << 9, /**< only try to produce AM node, don't
- do anything if AM isn't possible */
- match_two_users = 1 << 10 /**< the instruction uses a load two times ... */
+ match_commutative = 1 << 0, /**< inputs are commutative */
+ match_am_and_immediates = 1 << 1, /**< node supports AM and immediate at
+ the same time */
+ match_am = 1 << 2, /**< node supports (32bit) source AM */
+ match_8bit_am = 1 << 3, /**< node supports 8bit source AM */
+ match_16bit_am = 1 << 4, /**< node supports 16bit source AM */
+ match_immediate = 1 << 5, /**< node supports immediates */
+ match_mode_neutral = 1 << 6, /**< 16 and 8 bit modes can be emulated
+ by 32 bit operations */
+ match_try_am = 1 << 7, /**< only try to produce AM node, don't
+ do anything if AM isn't possible */
+ match_two_users = 1 << 8 /**< the instruction uses a load two times ... */
} match_flags_t;
typedef struct ia32_op_attr_t ia32_op_attr_t;
assert(use_am || !(flags & match_8bit_am));
assert(use_am || !(flags & match_16bit_am));
- if (mode_bits == 8) {
- if (!(flags & match_8bit_am))
- use_am = 0;
- /* we don't automatically add upconvs yet */
- assert((flags & match_mode_neutral) || (flags & match_8bit));
- } else if (mode_bits == 16) {
- if (!(flags & match_16bit_am))
- use_am = 0;
- /* we don't automatically add upconvs yet */
- assert((flags & match_mode_neutral) || (flags & match_16bit));
+ if ((mode_bits == 8 && !(flags & match_8bit_am)) ||
+ (mode_bits == 16 && !(flags & match_8bit_am))) {
+ use_am = 0;
}
/* we can simply skip downconvs for mode neutral nodes: the upper bits
match_arguments(&am, block, and_left, and_right, NULL,
match_commutative |
match_am | match_8bit_am | match_16bit_am |
- match_am_and_immediates | match_immediate |
- match_8bit | match_16bit);
+ match_am_and_immediates | match_immediate);
/* use 32bit compare mode if possible since the opcode is smaller */
if (upper_bits_clean(am.new_op1, cmp_mode) &&
match_arguments(&am, block, left, right, NULL,
match_commutative | match_am | match_8bit_am |
match_16bit_am | match_am_and_immediates |
- match_immediate | match_8bit | match_16bit);
+ match_immediate);
/* 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)) {
ir_node *val_true = get_Mux_true(node);
ir_node *val_false = get_Mux_false(node);
ir_node *new_node;
- match_flags_t match_flags;
ia32_address_mode_t am;
ia32_address_t *addr;
addr = &am.addr;
- match_flags = match_commutative | match_am | match_16bit_am |
- match_mode_neutral;
-
- match_arguments(&am, block, val_false, val_true, flags, match_flags);
+ match_arguments(&am, block, val_false, val_true, flags,
+ match_commutative | match_am | match_16bit_am | match_mode_neutral);
new_node = new_bd_ia32_CMov(dbgi, new_block, addr->base, addr->index,
addr->mem, am.new_op1, am.new_op2, new_flags,
if (src_mode == mode_Is || src_mode == mode_Hs) {
ia32_address_mode_t am;
- match_arguments(&am, src_block, NULL, op, NULL,
- match_am | match_try_am | match_16bit | match_16bit_am);
+ match_arguments(&am, src_block, NULL, op, NULL, match_am | match_try_am);
if (am.op_type == ia32_AddrModeS) {
ia32_address_t *addr = &am.addr;
#endif
match_arguments(&am, block, NULL, op, NULL,
- match_8bit | match_16bit |
match_am | match_8bit_am | match_16bit_am);
if (upper_bits_clean(am.new_op2, smaller_mode)) {