+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>
* recog.h (operand_alternative): Remove offmem_ok, nonffmem_ok,
static const constraint_data **enum_order;
static unsigned int register_start, register_end;
static unsigned int satisfied_start;
+static unsigned int const_int_start, const_int_end;
static unsigned int memory_start, memory_end;
static unsigned int address_start, address_end;
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;
FOR_ALL_CONSTRAINTS (c)
if (c->is_memory)
address_end = next;
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;
gcc_assert (next == num_constraints);
}
"#define CONST_OK_FOR_CONSTRAINT_P(v_,c_,s_) \\\n"
" insn_const_int_ok_for_constraint (v_, "
"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)
puts ("#define CONST_DOUBLE_OK_FOR_CONSTRAINT_P(v_,c_,s_) \\\n"
" constraint_satisfied_p (v_, lookup_constraint (s_))\n");
puts ("enum constraint_type\n"
"{\n"
" CT_REGISTER,\n"
+ " CT_CONST_INT,\n"
" CT_MEMORY,\n"
" CT_ADDRESS,\n"
" CT_FIXED_FORM\n"
"static inline enum constraint_type\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)
values.safe_push (std::make_pair (memory_start, "CT_MEMORY"));
if (address_start != address_end)