summaryrefslogtreecommitdiff
path: root/gcc/genpreds.c
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-13 20:41:07 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-13 20:41:07 +0000
commite913b5cd5b6a9bd3a2ad58c65f9e3cd2bb55a28c (patch)
treef52a097017e3dcf89fad6525984e4591489f961e /gcc/genpreds.c
parent9a5942c1d4d9116ab74b0741cfe3894a89fd17fb (diff)
downloadgcc-e913b5cd5b6a9bd3a2ad58c65f9e3cd2bb55a28c.tar.gz
Add wide-int branch.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@201707 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genpreds.c')
-rw-r--r--gcc/genpreds.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/genpreds.c b/gcc/genpreds.c
index 98488e30b8b..29fafbe79ef 100644
--- a/gcc/genpreds.c
+++ b/gcc/genpreds.c
@@ -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);
@@ -809,8 +809,11 @@ add_constraint (const char *name, const char *regclass,
if (is_const_int || is_const_dbl)
{
enum rtx_code appropriate_code
+#if TARGET_SUPPORTS_WIDE_INT
+ = is_const_int ? CONST_INT : CONST_WIDE_INT;
+#else
= is_const_int ? CONST_INT : CONST_DOUBLE;
-
+#endif
/* Consider relaxing this requirement in the future. */
if (regclass
|| GET_CODE (exp) != AND
@@ -1075,12 +1078,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);");