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);
}
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 */
"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_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;
}
}
/* 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);
}