Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
9b260f5d
Commit
9b260f5d
authored
Jun 11, 2013
by
Matthias Braun
Browse files
use float_arithmetic mode when lowering fabs calls
parent
6fa4cdf1
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/lower/lower_intrinsics.c
View file @
9b260f5d
...
...
@@ -165,8 +165,17 @@ int i_mapper_abs(ir_node *call)
ir_node
*
block
=
get_nodes_block
(
call
);
ir_node
*
op
=
get_Call_param
(
call
,
0
);
ir_graph
*
irg
=
get_irn_irg
(
call
);
ir_mode
*
mode
=
get_irn_mode
(
op
);
ir_mode
*
o
mode
=
get_irn_mode
(
op
);
dbg_info
*
dbg
=
get_irn_dbg_info
(
call
);
ir_mode
*
mode
=
omode
;
if
(
mode_is_float
(
mode
))
{
ir_mode
*
float_arith
=
be_get_mode_float_arithmetic
();
if
(
float_arith
!=
NULL
&&
mode
!=
float_arith
)
{
mode
=
float_arith
;
op
=
new_rd_Conv
(
dbg
,
block
,
op
,
mode
);
}
}
ir_node
*
zero
=
new_r_Const
(
irg
,
get_mode_null
(
mode
));
ir_node
*
cmp
=
new_rd_Cmp
(
dbg
,
block
,
op
,
zero
,
ir_relation_less
);
ir_node
*
minus_op
=
new_rd_Minus
(
dbg
,
block
,
op
,
mode
);
...
...
@@ -179,6 +188,9 @@ int i_mapper_abs(ir_node *call)
/* construct Mux */
mux
=
new_rd_Mux
(
dbg
,
block
,
cmp
,
op
,
minus_op
,
mode
);
if
(
omode
!=
mode
)
{
mux
=
new_rd_Conv
(
dbg
,
block
,
mux
,
omode
);
}
DBG_OPT_ALGSIM0
(
call
,
mux
,
FS_OPT_RTS_ABS
);
replace_call
(
mux
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment