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
8e821c6d
Commit
8e821c6d
authored
Mar 22, 2006
by
Christian Würdig
Browse files
fixed SymConst address handling (stores and moves)
parent
095d9110
Changes
3
Hide whitespace changes
Inline
Side-by-side
ir/be/ia32/ia32_emitter.c
View file @
8e821c6d
...
...
@@ -297,7 +297,10 @@ char *ia32_emit_binop(const ir_node *n, ia32_emit_env_t *env) {
break
;
case
ia32_AddrModeD
:
if
(
get_ia32_cnst
(
n
))
{
lc_esnprintf
(
ia32_get_arg_env
(),
buf
,
SNPRINTF_BUF_LEN
,
"%s, %s"
,
ia32_emit_am
(
n
,
env
),
get_ia32_cnst
(
n
));
lc_esnprintf
(
ia32_get_arg_env
(),
buf
,
SNPRINTF_BUF_LEN
,
"%s,%s%s"
,
ia32_emit_am
(
n
,
env
),
get_ia32_sc
(
n
)
?
" OFFSET FLAT:"
:
" "
,
/* In case of a symconst we must add OFFSET to */
get_ia32_cnst
(
n
));
/* tell the assembler to store it's address. */
}
else
{
const
arch_register_t
*
in1
=
get_in_reg
(
n
,
2
);
...
...
ir/be/ia32/ia32_spec.pl
View file @
8e821c6d
...
...
@@ -371,7 +371,7 @@ $comment_string = "/*";
}
else {
if (get_ia32_sc(n)) {
6.
lea
%D1, %C /*
Load
address of SymConst into register */
6.
mov
%D1,
OFFSET FLAT:
%C /*
Move
address of SymConst into register */
}
else {
6. mov %D1, %C /* Mov Const into register */
...
...
@@ -553,7 +553,7 @@ $comment_string = "/*";
"
comment
"
=>
"
construct Store: Store(ptr, val, mem) = ST ptr,val
",
"
cmp_attr
"
=>
"
return ia32_compare_immop_attr(attr_a, attr_b);
\n
",
"
reg_req
"
=>
{
"
in
"
=>
[
"
gp
",
"
gp
",
"
fp
",
"
none
"
]
},
"
emit
"
=>
'
. movs%M %ia32_emit_
am, %S3
/* Store(%S3) -> (%A1) */
'
"
emit
"
=>
'
. movs%M %ia32_emit_
binop
/* Store(%S3) -> (%A1) */
'
},
# CopyB
...
...
ir/be/ia32/ia32_transform.c
View file @
8e821c6d
...
...
@@ -1204,7 +1204,7 @@ static ir_node *gen_Store(ia32_transform_env_t *env) {
ir_node
*
new_op
;
/* in case of storing a const (but not a symconst) -> make it an attribute */
if
(
is_ia32_Const
(
val
)
&&
get_ia32_op_type
(
val
)
==
ia32_Const
)
{
if
(
is_ia32_Const
(
val
))
{
sval
=
noreg
;
}
...
...
@@ -1219,7 +1219,7 @@ static ir_node *gen_Store(ia32_transform_env_t *env) {
}
/* stored const is an attribute (saves a register) */
if
(
is_ia32_Const
(
val
)
&&
get_ia32_op_type
(
val
)
==
ia32_Const
)
{
if
(
is_ia32_Const
(
val
))
{
set_ia32_Immop_attr
(
new_op
,
val
);
}
...
...
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