From 3a31291fb7f0fd4626c816404ccdf98a6ebf57d4 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Fri, 22 Aug 2008 14:22:33 +0000 Subject: [PATCH] Run the x87 simulator when a graph contains Calls, which return floats. [r21352] --- ir/be/ia32/ia32_transform.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ir/be/ia32/ia32_transform.c b/ir/be/ia32/ia32_transform.c index bf8b48d47..682868cd5 100644 --- a/ir/be/ia32/ia32_transform.c +++ b/ir/be/ia32/ia32_transform.c @@ -4318,8 +4318,21 @@ static ir_node *gen_Proj_Quot(ir_node *node) { static ir_node *gen_be_Call(ir_node *node) { ir_node *res = be_duplicate_node(node); + ir_type *call_tp; + be_node_add_flags(res, -1, arch_irn_flags_modify_flags); + /* Run the x87 simulator if the call returns a float value */ + call_tp = be_Call_get_type(node); + if (get_method_n_ress(call_tp) > 0) { + ir_type *const res_type = get_method_res_type(call_tp, 0); + ir_mode *const res_mode = get_type_mode(res_type); + + if (res_mode != NULL && mode_is_float(res_mode)) { + env_cg->do_x87_sim = 1; + } + } + return res; } -- 2.20.1