Commit 53c715b1 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

ia32: Factorise setting do_x87_sim into a helper function.

parent d95b353e
......@@ -105,6 +105,12 @@ static inline ia32_irg_data_t *ia32_get_irg_data(const ir_graph *irg)
return (ia32_irg_data_t*) be_birg_from_irg(irg)->isa_link;
}
static inline void ia32_request_x87_sim(ir_graph const *const irg)
{
ia32_irg_data_t *const d = ia32_get_irg_data(irg);
d->do_x87_sim = true;
}
/**
* Returns the unique per irg GP NoReg node.
*/
......
......@@ -796,15 +796,12 @@ static void init_ia32_attributes(ir_node *node, arch_irn_flags_t flags,
static void init_ia32_x87_attributes(ir_node *res)
{
ir_graph *irg = get_irn_irg(res);
ia32_irg_data_t *irg_data = ia32_get_irg_data(irg);
#ifndef NDEBUG
ia32_attr_t *attr = get_ia32_attr(res);
attr->attr_type |= IA32_ATTR_ia32_x87_attr_t;
#else
(void) res;
#endif
irg_data->do_x87_sim = 1;
ir_graph *const irg = get_irn_irg(res);
ia32_request_x87_sim(irg);
}
static void init_ia32_asm_attributes(ir_node *res)
......
......@@ -4718,9 +4718,8 @@ static ir_node *gen_be_Call(ir_node *node)
ir_mode *const res_mode = get_type_mode(res_type);
if (res_mode != NULL && mode_is_float(res_mode)) {
ir_graph *irg = get_Block_irg(block);
ia32_irg_data_t *irg_data = ia32_get_irg_data(irg);
irg_data->do_x87_sim = 1;
ir_graph *const irg = get_Block_irg(block);
ia32_request_x87_sim(irg);
}
}
......
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