Commit 9aea9ec9 authored by yb9976's avatar yb9976
Browse files

AMD64: Set register requirements when turning back address mode.

parent 72ea2c8b
...@@ -132,8 +132,8 @@ static ir_node *amd64_turn_back_am(ir_node *node) ...@@ -132,8 +132,8 @@ static ir_node *amd64_turn_back_am(ir_node *node)
amd64_addr_t new_addr = attr->addr; amd64_addr_t new_addr = attr->addr;
ir_node *load_in[3]; ir_node *load_in[3];
int load_arity = 0; int load_arity = 0;
if (attr->addr.base_input != NO_INPUT if (attr->addr.base_input != NO_INPUT &&
&& attr->addr.base_input != RIP_INPUT) { attr->addr.base_input != RIP_INPUT) {
new_addr.base_input = load_arity; new_addr.base_input = load_arity;
load_in[load_arity++] = get_irn_n(node, attr->addr.base_input); load_in[load_arity++] = get_irn_n(node, attr->addr.base_input);
} }
...@@ -148,6 +148,7 @@ static ir_node *amd64_turn_back_am(ir_node *node) ...@@ -148,6 +148,7 @@ static ir_node *amd64_turn_back_am(ir_node *node)
ir_node *load = new_bd_amd64_mov_gp(dbgi, block, load_arity, load_in, ir_node *load = new_bd_amd64_mov_gp(dbgi, block, load_arity, load_in,
attr->insn_mode, AMD64_OP_ADDR, attr->insn_mode, AMD64_OP_ADDR,
new_addr); new_addr);
arch_set_irn_register_reqs_in(load, gp_am_reqs[load_arity - 1]);
ir_node *load_res = new_r_Proj(load, mode_Lu, pn_amd64_mov_gp_res); ir_node *load_res = new_r_Proj(load, mode_Lu, pn_amd64_mov_gp_res);
/* change operation */ /* change operation */
......
...@@ -297,7 +297,7 @@ static const arch_register_req_t *xmm_xmm_reqs[] = { ...@@ -297,7 +297,7 @@ static const arch_register_req_t *xmm_xmm_reqs[] = {
&amd64_requirement_xmm, &amd64_requirement_xmm,
}; };
static arch_register_req_t const **const gp_am_reqs[] = { arch_register_req_t const **const gp_am_reqs[] = {
mem_reqs, mem_reqs,
reg_mem_reqs, reg_mem_reqs,
reg_reg_mem_reqs, reg_reg_mem_reqs,
......
...@@ -17,6 +17,7 @@ extern const x86_clobber_name_t amd64_additional_clobber_names[]; ...@@ -17,6 +17,7 @@ extern const x86_clobber_name_t amd64_additional_clobber_names[];
extern const x86_asm_constraint_list_t amd64_asm_constraints; extern const x86_asm_constraint_list_t amd64_asm_constraints;
extern arch_register_req_t const *amd64_xmm_reqs[]; extern arch_register_req_t const *amd64_xmm_reqs[];
extern arch_register_req_t const **const gp_am_reqs[];
void amd64_init_transform(void); void amd64_init_transform(void);
......
Supports Markdown
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