Commit 203ba1fe authored by Christoph Mallon's avatar Christoph Mallon
Browse files

ia32: Replace 'match_upconv' by explicit 'match_sign_ext' and 'match_zero_ext'.

parent 143836e6
...@@ -49,13 +49,9 @@ typedef enum match_flags_t { ...@@ -49,13 +49,9 @@ typedef enum match_flags_t {
/** for 8/16 bit modes, zero_ext operations can be emulated by their /** for 8/16 bit modes, zero_ext operations can be emulated by their
* 32bit equivalents, however the upper bits must be zero extended. */ * 32bit equivalents, however the upper bits must be zero extended. */
match_zero_ext = 1 << 8, match_zero_ext = 1 << 8,
/** for 8/16 bit modes, upconv operations can be emulated by their match_try_am = 1 << 9, /**< only try to produce AM node, don't
* 32bit equivalents, however the upper bits have to sign/zero extended
* based on the operations mode. */
match_upconv = 1 << 9,
match_try_am = 1 << 10, /**< only try to produce AM node, don't
do anything if AM isn't possible */ do anything if AM isn't possible */
match_two_users = 1 << 11,/**< the instruction uses a load two times ... */ match_two_users = 1 << 10,/**< the instruction uses a load two times ... */
} match_flags_t; } match_flags_t;
ENUM_BITSET(match_flags_t) ENUM_BITSET(match_flags_t)
......
...@@ -1075,8 +1075,8 @@ static void match_arguments(ia32_address_mode_t *am, ir_node *block, ...@@ -1075,8 +1075,8 @@ static void match_arguments(ia32_address_mode_t *am, ir_node *block,
if (size == X86_SIZE_32 || flags & match_mode_neutral) { if (size == X86_SIZE_32 || flags & match_mode_neutral) {
transform = &be_transform_node; transform = &be_transform_node;
size = X86_SIZE_32; size = X86_SIZE_32;
} else if (flags & match_upconv) { } else if (flags & match_sign_ext) {
transform = &transform_upconv; transform = &transform_sext;
size = X86_SIZE_32; size = X86_SIZE_32;
} else if (flags & match_zero_ext) { } else if (flags & match_zero_ext) {
transform = &transform_zext; transform = &transform_zext;
...@@ -1841,7 +1841,9 @@ static ir_node *create_Div(ir_node *const node, ir_node *const op1, ir_node *con ...@@ -1841,7 +1841,9 @@ static ir_node *create_Div(ir_node *const node, ir_node *const op1, ir_node *con
ia32_address_mode_t am; ia32_address_mode_t am;
ir_node *const mem_pin_skip = skip_Pin(mem); ir_node *const mem_pin_skip = skip_Pin(mem);
ir_node *const old_block = get_nodes_block(node); ir_node *const old_block = get_nodes_block(node);
match_arguments(&am, old_block, op1, op2, mem_pin_skip, match_am | match_upconv); bool const is_signed = mode_is_signed(mode);
match_flags_t const flags = match_am | (is_signed ? match_sign_ext : match_zero_ext);
match_arguments(&am, old_block, op1, op2, mem_pin_skip, flags);
/* Beware: We don't need a Sync, if the memory predecessor of the Div node /* Beware: We don't need a Sync, if the memory predecessor of the Div node
* is the memory of the consumed address. We can have only the second op as * is the memory of the consumed address. We can have only the second op as
...@@ -1853,7 +1855,7 @@ static ir_node *create_Div(ir_node *const node, ir_node *const op1, ir_node *con ...@@ -1853,7 +1855,7 @@ static ir_node *create_Div(ir_node *const node, ir_node *const op1, ir_node *con
dbg_info *const dbgi = get_irn_dbg_info(node); dbg_info *const dbgi = get_irn_dbg_info(node);
ir_node *ext; ir_node *ext;
ir_node *(*cons)(dbg_info *db, ir_node *block, ir_node *base, ir_node *index, ir_node *mem, ir_node *op1, ir_node *op2, ir_node *ext, x86_insn_size_t size); ir_node *(*cons)(dbg_info *db, ir_node *block, ir_node *base, ir_node *index, ir_node *mem, ir_node *op1, ir_node *op2, ir_node *ext, x86_insn_size_t size);
if (mode_is_signed(mode)) { if (is_signed) {
ext = create_sex_32_64(dbgi, block, am.new_op1); ext = create_sex_32_64(dbgi, block, am.new_op1);
cons = new_bd_ia32_IDiv; cons = new_bd_ia32_IDiv;
} else { } else {
...@@ -3817,7 +3819,7 @@ static void store_gp(dbg_info *dbgi, ia32_address_mode_t *am, ir_node *block, ...@@ -3817,7 +3819,7 @@ static void store_gp(dbg_info *dbgi, ia32_address_mode_t *am, ir_node *block,
return; return;
} else if (possible_int_mode_for_fp(mode)) { } else if (possible_int_mode_for_fp(mode)) {
match_arguments(am, block, NULL, value, NULL, match_arguments(am, block, NULL, value, NULL,
match_am | match_try_am | match_upconv | match_16bit_am); match_am | match_try_am | match_sign_ext | match_16bit_am);
if (am->op_type == ia32_AddrModeS) if (am->op_type == ia32_AddrModeS)
return; return;
} }
......
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