Commit 174ba974 authored by yb9976's avatar yb9976
Browse files

AMD64: Support x87 floating point spills.

This fixes backend/long_double_arith.c.
parent 14ca74b1
...@@ -449,6 +449,16 @@ static void amd64_set_frame_entity(ir_node *node, ir_entity *entity, ...@@ -449,6 +449,16 @@ static void amd64_set_frame_entity(ir_node *node, ir_entity *entity,
attr->addr.immediate.entity = entity; attr->addr.immediate.entity = entity;
} }
static ir_type *get_type_for_insn_mode(amd64_insn_mode_t const insn_mode)
{
/* TODO: do not hardcode node names here */
switch (insn_mode) {
case INSN_MODE_128: return get_type_for_mode(amd64_mode_xmm);
case INSN_MODE_80: return x86_type_E;
default: return get_type_for_mode(mode_Lu);
}
}
/** /**
* Collects nodes that need frame entities assigned. * Collects nodes that need frame entities assigned.
*/ */
...@@ -477,10 +487,7 @@ static void amd64_collect_frame_entity_nodes(ir_node *node, void *data) ...@@ -477,10 +487,7 @@ static void amd64_collect_frame_entity_nodes(ir_node *node, void *data)
const amd64_addr_attr_t *attr = get_amd64_addr_attr_const(node); const amd64_addr_attr_t *attr = get_amd64_addr_attr_const(node);
x86_imm32_t const *imm = &attr->addr.immediate; x86_imm32_t const *imm = &attr->addr.immediate;
if (imm->kind == X86_IMM_FRAMEOFFSET && imm->entity == NULL) { if (imm->kind == X86_IMM_FRAMEOFFSET && imm->entity == NULL) {
/* TODO: do not hardcode node names here */ const ir_type *type = get_type_for_insn_mode(attr->insn_mode);
const ir_mode *mode = is_amd64_movdqu(node) ? amd64_mode_xmm
: mode_Lu;
const ir_type *type = get_type_for_mode(mode);
be_load_needs_frame_entity(env, node, type); be_load_needs_frame_entity(env, node, type);
} }
} }
......
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