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
dc2bc290
Commit
dc2bc290
authored
Mar 10, 2006
by
Christian Würdig
Browse files
fixed some bugs
parent
76c0c4f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/ia32/ia32_emitter.c
View file @
dc2bc290
...
...
@@ -116,6 +116,10 @@ char *ia32_emit_am(const ir_node *n) {
char
*
s
;
int
size
;
static
struct
obstack
*
obst
=
NULL
;
ir_mode
*
mode
=
get_ia32_ls_mode
(
n
);
if
(
!
is_ia32_Lea
(
n
))
assert
(
mode
&&
"AM node must have ls_mode attribute set."
);
if
(
!
obst
)
{
obst
=
xcalloc
(
1
,
sizeof
(
*
obst
));
...
...
@@ -127,6 +131,22 @@ char *ia32_emit_am(const ir_node *n) {
/* obstack_free with NULL results in an uninitialized obstack */
obstack_init
(
obst
);
if
(
mode
)
{
switch
(
get_mode_size_bits
(
mode
))
{
case
8
:
obstack_printf
(
obst
,
"BYTE PTR "
);
break
;
case
16
:
obstack_printf
(
obst
,
"WORD PTR "
);
break
;
case
32
:
obstack_printf
(
obst
,
"DWORD PTR "
);
break
;
default:
assert
(
0
&&
"unsupported mode size"
);
}
}
obstack_printf
(
obst
,
"["
);
if
(
am_flav
&
ia32_B
)
{
...
...
@@ -204,8 +224,6 @@ static const arch_register_t *get_out_reg(const ir_node *irn, int pos) {
ir_node
*
proj
;
const
arch_register_t
*
reg
=
NULL
;
assert
(
get_irn_n_edges
(
irn
)
>
pos
&&
"Invalid OUT position"
);
/* 1st case: irn is not of mode_T, so it has only */
/* one OUT register -> good */
/* 2nd case: irn is of mode_T -> collect all Projs and ask the */
...
...
@@ -752,8 +770,18 @@ void emit_ia32_CopyB_i(const ir_node *irn, emit_env_t *emit_env) {
void
emit_be_Call
(
const
ir_node
*
irn
,
emit_env_t
*
emit_env
)
{
FILE
*
F
=
emit_env
->
out
;
entity
*
ent
=
be_Call_get_entity
(
irn
);
fprintf
(
F
,
"
\t
call "
);
if
(
ent
)
{
fprintf
(
F
,
"%s"
,
get_entity_name
(
ent
));
}
else
{
lc_efprintf
(
ia32_get_arg_env
(),
F
,
"%1D"
,
get_irn_n
(
irn
,
be_pos_Call_ptr
));
}
lc_e
fprintf
(
ia32_get_arg_env
(),
F
,
"
\t
call %3S
\t\t\t
/* %+F
(%+F)
(be_Call) */
\n
"
,
irn
,
irn
,
get_irn_n
(
irn
,
2
)
);
ir_
fprintf
(
F
,
"
\t\t\t
/* %+F (be_Call) */
\n
"
,
irn
);
}
void
emit_be_IncSP
(
const
ir_node
*
irn
,
emit_env_t
*
emit_env
)
{
...
...
Write
Preview
Markdown
is supported
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