summaryrefslogtreecommitdiffhomepage
path: root/ir/be/ia32
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2019-03-31 08:48:38 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2019-03-31 08:48:38 +0200
commit8205e777c7540c0e653fa343e7ff355a77ebd400 (patch)
tree209f334fb0f42f2e4fa7c1a5e3bfdc7384d2c562 /ir/be/ia32
parent567c45596e1b75f3295070f5f525f8be46be45d3 (diff)
ia32: Set {base,index,mem}_input directly in init_ia32_attributes().
It was only done temporarily in ia32_emit_am(). Now prepare for other users.
Diffstat (limited to 'ir/be/ia32')
-rw-r--r--ir/be/ia32/ia32_emitter.c8
-rw-r--r--ir/be/ia32/ia32_new_nodes.c5
2 files changed, 5 insertions, 8 deletions
diff --git a/ir/be/ia32/ia32_emitter.c b/ir/be/ia32/ia32_emitter.c
index 121f0a4..8cc6acc 100644
--- a/ir/be/ia32/ia32_emitter.c
+++ b/ir/be/ia32/ia32_emitter.c
@@ -288,13 +288,7 @@ ENUM_BITSET(ia32_emit_mod_t)
static void ia32_emit_am(ir_node const *const node)
{
ia32_attr_t const *const attr = get_ia32_attr_const(node);
- /* Prepare a temporary x86_addr_t with input numbers set until the ia32
- * backend sets them properly earlier. */
- x86_addr_t addr = attr->addr;
- addr.base_input = n_ia32_base;
- addr.index_input = n_ia32_index;
- addr.mem_input = n_ia32_mem;
- x86_emit_addr(node, &addr);
+ x86_emit_addr(node, &attr->addr);
}
void ia32_emitf(ir_node const *const node, char const *fmt, ...)
diff --git a/ir/be/ia32/ia32_new_nodes.c b/ir/be/ia32/ia32_new_nodes.c
index 471e8a8..a4fd845 100644
--- a/ir/be/ia32/ia32_new_nodes.c
+++ b/ir/be/ia32/ia32_new_nodes.c
@@ -509,7 +509,10 @@ void ia32_swap_left_right(ir_node *node)
void init_ia32_attributes(ir_node *node, x86_insn_size_t const size)
{
ia32_attr_t *attr = get_ia32_attr(node);
- attr->size = size;
+ attr->size = size;
+ attr->addr.base_input = n_ia32_base;
+ attr->addr.index_input = n_ia32_index;
+ attr->addr.mem_input = n_ia32_mem;
#ifndef NDEBUG
attr->attr_type |= IA32_ATTR_ia32_attr_t;