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
917d00ff
Commit
917d00ff
authored
May 29, 2009
by
Michael Beck
Browse files
- implemented i_mapper_bswap()
[r26062]
parent
7ba12a1f
Changes
2
Show whitespace changes
Inline
Side-by-side
include/libfirm/lowering.h
View file @
917d00ff
...
...
@@ -318,6 +318,14 @@ unsigned lower_intrinsics(i_record *list, int length, int part_block_used);
*/
int
i_mapper_abs
(
ir_node
*
call
,
void
*
ctx
);
/**
* A mapper for the integer byte swap value: type bswap(type v).
* Replaces the call by a builtin[ir_bk_bswap] node.
*
* @return always 1
*/
int
i_mapper_bswap
(
ir_node
*
call
,
void
*
ctx
);
/**
* A mapper for the floating point sqrt(v): floattype sqrt(floattype v);
*
...
...
ir/lower/lower_intrinsics.c
View file @
917d00ff
...
...
@@ -205,6 +205,24 @@ int i_mapper_abs(ir_node *call, void *ctx) {
return
1
;
}
/* i_mapper_abs */
/* A mapper for the integer bswap. */
int
i_mapper_bswap
(
ir_node
*
call
,
void
*
ctx
)
{
ir_node
*
mem
=
get_Call_mem
(
call
);
ir_node
*
block
=
get_nodes_block
(
call
);
ir_node
*
op
=
get_Call_param
(
call
,
0
);
ir_type
*
tp
=
get_Call_type
(
call
);
dbg_info
*
dbg
=
get_irn_dbg_info
(
call
);
ir_node
*
irn
;
(
void
)
ctx
;
irn
=
new_rd_Builtin
(
dbg
,
current_ir_graph
,
block
,
get_irg_no_mem
(
current_ir_graph
),
1
,
&
op
,
ir_bk_bswap
,
tp
);
set_irn_pinned
(
irn
,
op_pin_state_floats
);
DBG_OPT_ALGSIM0
(
call
,
irn
,
FS_OPT_RTS_ABS
);
irn
=
new_r_Proj
(
current_ir_graph
,
block
,
irn
,
get_irn_mode
(
op
),
pn_Builtin_1_result
);
replace_call
(
irn
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
}
/* i_mapper_bswap */
/* A mapper for the alloca() function. */
int
i_mapper_alloca
(
ir_node
*
call
,
void
*
ctx
)
{
ir_node
*
mem
=
get_Call_mem
(
call
);
...
...
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