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
d1619989
Commit
d1619989
authored
Mar 18, 2006
by
Michael Beck
Browse files
Implemented emitter for the basic case of TestJmp (reg, reg)
parent
98c0acdf
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/ia32/ia32_emitter.c
View file @
d1619989
...
...
@@ -587,7 +587,35 @@ void emit_ia32_CondJmp_i(const ir_node *irn, ia32_emit_env_t *env) {
CondJmp_emitter
(
irn
,
env
);
}
/**
* Emits code for conditional test and jump.
*/
static
void
TestJmp_emitter
(
const
ir_node
*
irn
,
ia32_emit_env_t
*
env
)
{
FILE
*
F
=
env
->
out
;
char
cmd_buf
[
SNPRINTF_BUF_LEN
];
char
cmnt_buf
[
SNPRINTF_BUF_LEN
];
const
arch_register_t
*
in1
=
get_in_reg
(
irn
,
0
);
const
arch_register_t
*
in2
=
get_in_reg
(
irn
,
1
);
snprintf
(
cmd_buf
,
SNPRINTF_BUF_LEN
,
"test %s, %s "
,
arch_register_get_name
(
in1
),
arch_register_get_name
(
in2
));
lc_esnprintf
(
ia32_get_arg_env
(),
cmnt_buf
,
SNPRINTF_BUF_LEN
,
"; %+F"
,
irn
);
IA32_DO_EMIT
;
finish_CondJmp
(
F
,
irn
);
}
/**
* Emits code for conditional test and jump with two variables.
*/
static
void
emit_ia32_TestJmp
(
const
ir_node
*
irn
,
ia32_emit_env_t
*
env
)
{
TestJmp_emitter
(
irn
,
env
);
}
/**
* Emits code for conditional test and jump with immediate.
*/
static
void
emit_ia32_TestJmp_i
(
const
ir_node
*
irn
,
ia32_emit_env_t
*
env
)
{
TestJmp_emitter
(
irn
,
env
);
}
/*********************************************************
* _ _ _
...
...
@@ -1066,6 +1094,7 @@ static void ia32_register_emitters(void) {
/* other ia32 emitter functions */
IA32_EMIT
(
CondJmp
);
IA32_EMIT
(
TestJmp
);
IA32_EMIT
(
SwitchJmp
);
IA32_EMIT
(
CopyB
);
IA32_EMIT
(
CopyB_i
);
...
...
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