Commit 8e821c6d authored by Christian Würdig's avatar Christian Würdig
Browse files

fixed SymConst address handling (stores and moves)

parent 095d9110
......@@ -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);
......
......@@ -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
......
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment