Commit 1025ebdc authored by Christoph Mallon's avatar Christoph Mallon
Browse files

amd64: Set the input requirements in the xmm case of the sub-to-neg+add transformation, too.

parent c2ebba1f
......@@ -92,6 +92,7 @@ static void transform_sub_to_neg_add(ir_node *node,
ir_node *xor_in[] = { in2 };
ir_node *xor = new_bd_amd64_xorp(dbgi, block, ARRAY_SIZE(xor_in),
xor_in, &xor_attr);
arch_set_irn_register_reqs_in(xor, amd64_xmm_reqs);
ir_node *neg = new_r_Proj(xor, amd64_mode_xmm, pn_amd64_xorp_res);
sched_add_before(node, xor);
......@@ -111,9 +112,9 @@ static void transform_sub_to_neg_add(ir_node *node,
ir_node *in[] = { neg_res, in1 };
add = new_bd_amd64_add(dbgi, block, ARRAY_SIZE(in), in, attr);
arch_set_irn_register_reqs_in(add, arch_get_irn_register_reqs_in(node));
add_res = new_r_Proj(add, mode_Lu, pn_amd64_add_res);
}
arch_set_irn_register_reqs_in(add, arch_get_irn_register_reqs_in(node));
arch_set_irn_register(add_res, out_reg);
/* exchange the add and the sub */
......
......@@ -280,7 +280,7 @@ static const arch_register_req_t *reg_reqs[] = {
&amd64_requirement_gp,
};
static const arch_register_req_t *xmm_reqs[] = {
arch_register_req_t const *amd64_xmm_reqs[] = {
&amd64_requirement_xmm,
};
......@@ -2154,7 +2154,7 @@ static ir_node *match_mov(dbg_info *dbgi, ir_node *block, ir_node *value,
} else {
ir_node *new_value = be_transform_node(value);
in[arity++] = new_value;
reqs = get_irn_mode(new_value) == amd64_mode_xmm ? xmm_reqs
reqs = get_irn_mode(new_value) == amd64_mode_xmm ? amd64_xmm_reqs
: reg_reqs;
op_mode = AMD64_OP_REG;
}
......@@ -2270,7 +2270,7 @@ static ir_node *gen_Conv(ir_node *node)
pn_res = pn_amd64_cvtsd2ss_res;
}
res = new_r_Proj(conv, amd64_mode_xmm, pn_res);
reqs = xmm_reqs;
reqs = amd64_xmm_reqs;
} else if (src_float && !dst_float) {
/* float to int */
......@@ -2295,7 +2295,7 @@ static ir_node *gen_Conv(ir_node *node)
pn_res = pn_amd64_cvttsd2si_res;
}
res = new_r_Proj(conv, mode_gp, pn_res);
reqs = xmm_reqs;
reqs = amd64_xmm_reqs;
} else if (!src_float && dst_float) {
/* int to float */
......
......@@ -16,6 +16,8 @@
extern const x86_clobber_name_t amd64_additional_clobber_names[];
extern const x86_asm_constraint_list_t amd64_asm_constraints;
extern arch_register_req_t const *amd64_xmm_reqs[];
void amd64_init_transform(void);
ir_node *amd64_new_spill(ir_node *value, ir_node *after);
......
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