From: Christoph Mallon Date: Wed, 12 Nov 2008 21:09:33 +0000 (+0000) Subject: Remove match_8bit and match_16bit. They were only asserted and the asserts (and... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=1f45df63a922e09f06eb2f27b0727314fad7b8c1;p=libfirm Remove match_8bit and match_16bit. They were only asserted and the asserts (and their comments) were plain strange. [r23603] --- diff --git a/ir/be/ia32/ia32_nodes_attr.h b/ir/be/ia32/ia32_nodes_attr.h index 2353937fd..aab144137 100644 --- a/ir/be/ia32/ia32_nodes_attr.h +++ b/ir/be/ia32/ia32_nodes_attr.h @@ -49,20 +49,18 @@ typedef enum { } 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; diff --git a/ir/be/ia32/ia32_transform.c b/ir/be/ia32/ia32_transform.c index 6989766c7..30a218926 100644 --- a/ir/be/ia32/ia32_transform.c +++ b/ir/be/ia32/ia32_transform.c @@ -662,16 +662,9 @@ static void match_arguments(ia32_address_mode_t *am, ir_node *block, 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 @@ -2750,8 +2743,7 @@ static ir_node *gen_Cmp(ir_node *node) 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) && @@ -2772,7 +2764,7 @@ static ir_node *gen_Cmp(ir_node *node) 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)) { @@ -2808,7 +2800,6 @@ static ir_node *create_CMov(ir_node *node, ir_node *flags, ir_node *new_flags, 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; @@ -2817,10 +2808,8 @@ static ir_node *create_CMov(ir_node *node, ir_node *flags, ir_node *new_flags, 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, @@ -3104,8 +3093,7 @@ static ir_node *gen_x87_gp_to_fp(ir_node *node, ir_mode *src_mode) 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; @@ -3210,7 +3198,6 @@ static ir_node *create_I2I_Conv(ir_mode *src_mode, ir_mode *tgt_mode, #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)) {