mirror of git://gcc.gnu.org/git/gcc.git
genpreds.c (const_int_start, [...]): New variables.
gcc/ * genpreds.c (const_int_start, const_int_end): New variables. (choose_enum_order): Output CONST_INT constraints before memory constraints. (write_tm_preds_h): Always define insn_const_int_ok_for_constraint. Add CT_CONST_INT. * ira-costs.c (record_reg_classes): Handle CT_CONST_INT. * ira.c (ira_setup_alts): Likewise. * lra-constraints.c (process_alt_operands): Likewise. * recog.c (asm_operand_ok, preprocess_constraints): Likewise. * reload.c (find_reloads): Likewise. From-SVN: r211473
This commit is contained in:
parent
3c4c42e826
commit
d9c35eee65
|
|
@ -1,3 +1,16 @@
|
||||||
|
2014-06-11 Richard Sandiford <rdsandiford@googlemail.com>
|
||||||
|
|
||||||
|
* genpreds.c (const_int_start, const_int_end): New variables.
|
||||||
|
(choose_enum_order): Output CONST_INT constraints before memory
|
||||||
|
constraints.
|
||||||
|
(write_tm_preds_h): Always define insn_const_int_ok_for_constraint.
|
||||||
|
Add CT_CONST_INT.
|
||||||
|
* ira-costs.c (record_reg_classes): Handle CT_CONST_INT.
|
||||||
|
* ira.c (ira_setup_alts): Likewise.
|
||||||
|
* lra-constraints.c (process_alt_operands): Likewise.
|
||||||
|
* recog.c (asm_operand_ok, preprocess_constraints): Likewise.
|
||||||
|
* reload.c (find_reloads): Likewise.
|
||||||
|
|
||||||
2014-06-11 Richard Sandiford <rdsandiford@googlemail.com>
|
2014-06-11 Richard Sandiford <rdsandiford@googlemail.com>
|
||||||
|
|
||||||
* recog.h (operand_alternative): Remove offmem_ok, nonffmem_ok,
|
* recog.h (operand_alternative): Remove offmem_ok, nonffmem_ok,
|
||||||
|
|
|
||||||
|
|
@ -690,6 +690,7 @@ static unsigned int num_constraints;
|
||||||
static const constraint_data **enum_order;
|
static const constraint_data **enum_order;
|
||||||
static unsigned int register_start, register_end;
|
static unsigned int register_start, register_end;
|
||||||
static unsigned int satisfied_start;
|
static unsigned int satisfied_start;
|
||||||
|
static unsigned int const_int_start, const_int_end;
|
||||||
static unsigned int memory_start, memory_end;
|
static unsigned int memory_start, memory_end;
|
||||||
static unsigned int address_start, address_end;
|
static unsigned int address_start, address_end;
|
||||||
|
|
||||||
|
|
@ -931,6 +932,12 @@ choose_enum_order (void)
|
||||||
|
|
||||||
satisfied_start = next;
|
satisfied_start = next;
|
||||||
|
|
||||||
|
const_int_start = next;
|
||||||
|
FOR_ALL_CONSTRAINTS (c)
|
||||||
|
if (c->is_const_int)
|
||||||
|
enum_order[next++] = c;
|
||||||
|
const_int_end = next;
|
||||||
|
|
||||||
memory_start = next;
|
memory_start = next;
|
||||||
FOR_ALL_CONSTRAINTS (c)
|
FOR_ALL_CONSTRAINTS (c)
|
||||||
if (c->is_memory)
|
if (c->is_memory)
|
||||||
|
|
@ -944,7 +951,7 @@ choose_enum_order (void)
|
||||||
address_end = next;
|
address_end = next;
|
||||||
|
|
||||||
FOR_ALL_CONSTRAINTS (c)
|
FOR_ALL_CONSTRAINTS (c)
|
||||||
if (!c->is_register && !c->is_memory && !c->is_address)
|
if (!c->is_register && !c->is_const_int && !c->is_memory && !c->is_address)
|
||||||
enum_order[next++] = c;
|
enum_order[next++] = c;
|
||||||
gcc_assert (next == num_constraints);
|
gcc_assert (next == num_constraints);
|
||||||
}
|
}
|
||||||
|
|
@ -1361,6 +1368,13 @@ write_tm_preds_h (void)
|
||||||
"#define CONST_OK_FOR_CONSTRAINT_P(v_,c_,s_) \\\n"
|
"#define CONST_OK_FOR_CONSTRAINT_P(v_,c_,s_) \\\n"
|
||||||
" insn_const_int_ok_for_constraint (v_, "
|
" insn_const_int_ok_for_constraint (v_, "
|
||||||
"lookup_constraint (s_))\n");
|
"lookup_constraint (s_))\n");
|
||||||
|
else
|
||||||
|
puts ("static inline bool\n"
|
||||||
|
"insn_const_int_ok_for_constraint (HOST_WIDE_INT,"
|
||||||
|
" enum constraint_num)\n"
|
||||||
|
"{\n"
|
||||||
|
" return false;\n"
|
||||||
|
"}\n");
|
||||||
if (have_const_dbl_constraints)
|
if (have_const_dbl_constraints)
|
||||||
puts ("#define CONST_DOUBLE_OK_FOR_CONSTRAINT_P(v_,c_,s_) \\\n"
|
puts ("#define CONST_DOUBLE_OK_FOR_CONSTRAINT_P(v_,c_,s_) \\\n"
|
||||||
" constraint_satisfied_p (v_, lookup_constraint (s_))\n");
|
" constraint_satisfied_p (v_, lookup_constraint (s_))\n");
|
||||||
|
|
@ -1370,6 +1384,7 @@ write_tm_preds_h (void)
|
||||||
puts ("enum constraint_type\n"
|
puts ("enum constraint_type\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" CT_REGISTER,\n"
|
" CT_REGISTER,\n"
|
||||||
|
" CT_CONST_INT,\n"
|
||||||
" CT_MEMORY,\n"
|
" CT_MEMORY,\n"
|
||||||
" CT_ADDRESS,\n"
|
" CT_ADDRESS,\n"
|
||||||
" CT_FIXED_FORM\n"
|
" CT_FIXED_FORM\n"
|
||||||
|
|
@ -1378,7 +1393,9 @@ write_tm_preds_h (void)
|
||||||
"static inline enum constraint_type\n"
|
"static inline enum constraint_type\n"
|
||||||
"get_constraint_type (enum constraint_num c)\n"
|
"get_constraint_type (enum constraint_num c)\n"
|
||||||
"{");
|
"{");
|
||||||
auto_vec <std::pair <unsigned int, const char *>, 3> values;
|
auto_vec <std::pair <unsigned int, const char *>, 4> values;
|
||||||
|
if (const_int_start != const_int_end)
|
||||||
|
values.safe_push (std::make_pair (const_int_start, "CT_CONST_INT"));
|
||||||
if (memory_start != memory_end)
|
if (memory_start != memory_end)
|
||||||
values.safe_push (std::make_pair (memory_start, "CT_MEMORY"));
|
values.safe_push (std::make_pair (memory_start, "CT_MEMORY"));
|
||||||
if (address_start != address_end)
|
if (address_start != address_end)
|
||||||
|
|
|
||||||
|
|
@ -763,6 +763,12 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops,
|
||||||
classes[i] = ira_reg_class_subunion[classes[i]][cl];
|
classes[i] = ira_reg_class_subunion[classes[i]][cl];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CT_CONST_INT:
|
||||||
|
if (CONST_INT_P (op)
|
||||||
|
&& insn_const_int_ok_for_constraint (INTVAL (op), cn))
|
||||||
|
win = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
case CT_MEMORY:
|
case CT_MEMORY:
|
||||||
/* Every MEM can be reloaded to fit. */
|
/* Every MEM can be reloaded to fit. */
|
||||||
insn_allows_mem[i] = allows_mem[i] = 1;
|
insn_allows_mem[i] = allows_mem[i] = 1;
|
||||||
|
|
|
||||||
|
|
@ -1936,6 +1936,13 @@ ira_setup_alts (rtx insn, HARD_REG_SET &alts)
|
||||||
goto op_success;
|
goto op_success;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CT_CONST_INT:
|
||||||
|
if (CONST_INT_P (op)
|
||||||
|
&& (insn_const_int_ok_for_constraint
|
||||||
|
(INTVAL (op), cn)))
|
||||||
|
goto op_success;
|
||||||
|
break;
|
||||||
|
|
||||||
case CT_ADDRESS:
|
case CT_ADDRESS:
|
||||||
case CT_MEMORY:
|
case CT_MEMORY:
|
||||||
goto op_success;
|
goto op_success;
|
||||||
|
|
|
||||||
|
|
@ -2041,6 +2041,12 @@ process_alt_operands (int only_alternative)
|
||||||
goto reg;
|
goto reg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CT_CONST_INT:
|
||||||
|
if (CONST_INT_P (op)
|
||||||
|
&& insn_const_int_ok_for_constraint (INTVAL (op), cn))
|
||||||
|
win = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case CT_MEMORY:
|
case CT_MEMORY:
|
||||||
if (MEM_P (op)
|
if (MEM_P (op)
|
||||||
&& satisfies_memory_constraint_p (op, cn))
|
&& satisfies_memory_constraint_p (op, cn))
|
||||||
|
|
|
||||||
10
gcc/recog.c
10
gcc/recog.c
|
|
@ -1920,6 +1920,13 @@ asm_operand_ok (rtx op, const char *constraint, const char **constraints)
|
||||||
goto reg;
|
goto reg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CT_CONST_INT:
|
||||||
|
if (!result
|
||||||
|
&& CONST_INT_P (op)
|
||||||
|
&& insn_const_int_ok_for_constraint (INTVAL (op), cn))
|
||||||
|
result = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
case CT_MEMORY:
|
case CT_MEMORY:
|
||||||
/* Every memory operand can be reloaded to fit. */
|
/* Every memory operand can be reloaded to fit. */
|
||||||
result = result || memory_operand (op, VOIDmode);
|
result = result || memory_operand (op, VOIDmode);
|
||||||
|
|
@ -2443,6 +2450,9 @@ preprocess_constraints (int n_operands, int n_alternatives,
|
||||||
op_alt[i].cl = reg_class_subunion[op_alt[i].cl][cl];
|
op_alt[i].cl = reg_class_subunion[op_alt[i].cl][cl];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CT_CONST_INT:
|
||||||
|
break;
|
||||||
|
|
||||||
case CT_MEMORY:
|
case CT_MEMORY:
|
||||||
op_alt[i].memory_ok = 1;
|
op_alt[i].memory_ok = 1;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -3504,6 +3504,13 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
|
||||||
goto reg;
|
goto reg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CT_CONST_INT:
|
||||||
|
if (CONST_INT_P (operand)
|
||||||
|
&& (insn_const_int_ok_for_constraint
|
||||||
|
(INTVAL (operand), cn)))
|
||||||
|
win = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case CT_MEMORY:
|
case CT_MEMORY:
|
||||||
if (force_reload)
|
if (force_reload)
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue