From 91953f5a2e107ebb5fd2d8a301bc67a3caebb5ef Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 22 Nov 2007 17:05:47 +0000 Subject: [PATCH] fixed log() mapper [r16829] --- ir/lower/lower_intrinsics.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/ir/lower/lower_intrinsics.c b/ir/lower/lower_intrinsics.c index fff83681f..4288bee8d 100644 --- a/ir/lower/lower_intrinsics.c +++ b/ir/lower/lower_intrinsics.c @@ -329,24 +329,6 @@ int i_mapper_exp(ir_node *call, void *ctx) { return 0; } /* i_mapper_exp */ -/* A mapper for the floating point log. */ -int i_mapper_log(ir_node *call, void *ctx) { - ir_node *val = get_Call_param(call, 0); - (void) ctx; - - if (is_Const(val) && is_Const_one(val)) { - /* log(1.0) = 0.0 */ - ir_node *block = get_nodes_block(call); - ir_mode *mode = get_irn_mode(val); - ir_node *irn = new_r_Const(current_ir_graph, block, mode, get_mode_null(mode)); - ir_node *mem = get_Call_mem(call); - DBG_OPT_ALGSIM0(call, val, FS_OPT_RTS_LOG); - replace_call(val, call, mem, NULL, NULL); - return 1; - } - return 0; -} /* i_mapper_log */ - /** * A mapper for mapping f(0.0) to 0.0. */ @@ -430,6 +412,12 @@ static int i_mapper_symmetric_zero_to_one(ir_node *call, void *ctx, int reason) return 0; } /* i_mapper_symmetric_zero_to_one */ +/* A mapper for the floating point log. */ +int i_mapper_log(ir_node *call, void *ctx) { + /* log(1.0) = 0.0 */ + return i_mapper_one_to_zero(call, ctx, FS_OPT_RTS_LOG); +} /* i_mapper_log */ + /* A mapper for the floating point sin. */ int i_mapper_sin(ir_node *call, void *ctx) { /* sin(0.0) = 0.0 */ -- 2.20.1