@@ -204,6 +204,7 @@ gen_exp (rtx x, enum rtx_code subroutine_type, char *used)
case CONST_DOUBLE:
case CONST_FIXED:
+ case CONST_WIDE_INT:
/* These shouldn't be written in MD files. Instead, the appropriate
routines in varasm.c should be called. */
gcc_unreachable ();
@@ -142,6 +142,7 @@ static int
excluded_rtx (int idx)
{
return ((strcmp (defs[idx].enumname, "CONST_DOUBLE") == 0)
+ || (strcmp (defs[idx].enumname, "CONST_WIDE_INT") == 0)
|| (strcmp (defs[idx].enumname, "CONST_FIXED") == 0));
}
@@ -883,14 +883,14 @@ emit_max_int (void)
max = i->bytesize;
if (max > mmax)
mmax = max;
- printf ("#define MAX_BITSIZE_MODE_ANY_INT %d*BITS_PER_UNIT\n", mmax);
+ printf ("#define MAX_BITSIZE_MODE_ANY_INT %d\n", mmax * MAX_BITS_PER_UNIT);
mmax = 0;
for (j = 0; j < MAX_MODE_CLASS; j++)
for (i = modes[j]; i; i = i->next)
if (mmax < i->bytesize)
mmax = i->bytesize;
- printf ("#define MAX_BITSIZE_MODE_ANY_MODE %d*BITS_PER_UNIT\n", mmax);
+ printf ("#define MAX_BITSIZE_MODE_ANY_MODE %d\n", mmax * MAX_BITS_PER_UNIT);
}
static void
@@ -612,7 +612,7 @@ write_one_predicate_function (struct pred_data *p)
add_mode_tests (p);
/* A normal predicate can legitimately not look at enum machine_mode
- if it accepts only CONST_INTs and/or CONST_DOUBLEs. */
+ if it accepts only CONST_INTs and/or CONST_WIDE_INT and/or CONST_DOUBLEs. */
printf ("int\n%s (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)\n{\n",
p->name);
write_predicate_stmts (p->exp);
@@ -1075,12 +1075,17 @@ write_tm_constrs_h (void)
if (needs_ival)
puts (" if (CONST_INT_P (op))\n"
" ival = INTVAL (op);");
+#if TARGET_SUPPORTS_WIDE_INT
+ if (needs_lval || needs_hval)
+ error ("you can't use lval or hval");
+#else
if (needs_hval)
puts (" if (GET_CODE (op) == CONST_DOUBLE && mode == VOIDmode)"
" hval = CONST_DOUBLE_HIGH (op);");
if (needs_lval)
puts (" if (GET_CODE (op) == CONST_DOUBLE && mode == VOIDmode)"
" lval = CONST_DOUBLE_LOW (op);");
+#endif
if (needs_rval)
puts (" if (GET_CODE (op) == CONST_DOUBLE && mode != VOIDmode)"
" rval = CONST_DOUBLE_REAL_VALUE (op);");
@@ -588,6 +588,7 @@ validate_pattern (rtx pattern, rtx insn, rtx set, int set_code)
&& GET_CODE (src) != PC
&& GET_CODE (src) != CC0
&& !CONST_INT_P (src)
+ && !CONST_WIDE_INT_P (src)
&& GET_CODE (src) != CALL)
{
const char *which;
@@ -772,13 +773,14 @@ add_to_sequence (rtx pattern, struct decision_head *last,
We can optimize the generated code a little if either
(a) the predicate only accepts one code, or (b) the
- predicate does not allow CONST_INT, in which case it
- can match only if the modes match. */
+ predicate does not allow CONST_INT or CONST_WIDE_INT,
+ in which case it can match only if the modes match. */
pred = lookup_predicate (pred_name);
if (pred)
{
test->u.pred.data = pred;
- allows_const_int = pred->codes[CONST_INT];
+ allows_const_int = (pred->codes[CONST_INT]
+ || pred->codes[CONST_WIDE_INT]);
if (was_code == MATCH_PARALLEL
&& pred->singleton != PARALLEL)
message_with_line (pattern_lineno,
@@ -2806,7 +2806,12 @@ static const struct std_pred_table std_preds[] = {
{"scratch_operand", false, false, {SCRATCH, REG}},
{"immediate_operand", false, true, {UNKNOWN}},
{"const_int_operand", false, false, {CONST_INT}},
+#if TARGET_SUPPORTS_WIDE_INT
+ {"const_scalar_int_operand", false, false, {CONST_INT, CONST_WIDE_INT}},
+ {"const_double_operand", false, false, {CONST_DOUBLE}},
+#else
{"const_double_operand", false, false, {CONST_INT, CONST_DOUBLE}},
+#endif
{"nonimmediate_operand", false, false, {SUBREG, REG, MEM}},
{"nonmemory_operand", false, true, {SUBREG, REG}},
{"push_operand", false, false, {MEM}},