Commit f9e2c357 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

ia32: When emitting an asm memory operand, ignore the size of the referenced...

ia32: When emitting an asm memory operand, ignore the size of the referenced value and asm operand size modifier.

The register, which is emitted, contains the address of the value, so it always is the size of a pointer, not whatever the register points to.
parent f8ead9ac
......@@ -1054,31 +1054,19 @@ static const char* emit_asm_operand(const ir_node *node, const char *s)
return s;
}
/* Emit the register. */
if (asm_reg->memory) {
be_emit_char('(');
}
/* emit it */
if (modifier != 0) {
emit_register(reg, NULL);
be_emit_char(')');
} else {
switch (modifier) {
case 'b':
emit_8bit_register(reg);
break;
case 'h':
emit_8bit_register_high(reg);
break;
case 'w':
emit_16bit_register(reg);
break;
default:
panic("Invalid asm op modifier");
case '\0': emit_register(reg, asm_reg->mode); break;
case 'b': emit_8bit_register(reg); break;
case 'h': emit_8bit_register_high(reg); break;
case 'w': emit_16bit_register(reg); break;
default: panic("Invalid asm op modifier");
}
} else {
emit_register(reg, asm_reg->memory ? mode_Iu : asm_reg->mode);
}
if (asm_reg->memory) {
be_emit_char(')');
}
return s;
......
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