aboutsummaryrefslogtreecommitdiff
path: root/gcc/recog.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-10-11 00:07:30 -0700
committerRichard Henderson <rth@gcc.gnu.org>2001-10-11 00:07:30 -0700
commit84b7230235972947f92045e6281d2a18099b415e (patch)
tree65279fa1cd98240f2ba4d2902ef69c88fa458bd8 /gcc/recog.c
parent592188a538c1993640b27f0788f382e282dddbb6 (diff)
downloadgcc-84b7230235972947f92045e6281d2a18099b415e.zip
gcc-84b7230235972947f92045e6281d2a18099b415e.tar.gz
gcc-84b7230235972947f92045e6281d2a18099b415e.tar.bz2
c-parse.in (asm_operand): Allow named operands.
* c-parse.in (asm_operand): Allow named operands. * genconfig.c (max_recog_operands): Set to 29. * local-alloc.c (requires_inout): Skip multiple digits. * recog.c (asm_operand_ok): Likewise. (preprocess_constraints): Use strtoul for matching constraints. (constrain_operands): Likewise. * regmove.c (find_matches): Likewise. * reload.c (find_reloads): Likewise. * stmt.c (parse_output_constraint): Don't reject in-out constraint on operands > 9. Reject '[' in constraint. (expand_asm_operands): Handle named operands. Use strtoul for matching constraints. (check_operand_nalternatives): Split out from expand_asm_operands. (check_unique_operand_names): New. (resolve_operand_names, resolve_operand_name_1): New. * doc/extend.texi (Extended Asm): Document named operands. * doc/md.texi (Simple Constraints): Document matching constraints on operands > 9. * parse.y (asm_operand): Allow named operands. * semantics.c (finish_asm_stmt): Tweek for changed location of the operand constrant. From-SVN: r46179
Diffstat (limited to 'gcc/recog.c')
-rw-r--r--gcc/recog.c83
1 files changed, 49 insertions, 34 deletions
diff --git a/gcc/recog.c b/gcc/recog.c
index e240ebb..1504870 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -1657,6 +1657,8 @@ asm_operand_ok (op, constraint)
proper matching constraint, but we can't actually fail
the check if they didn't. Indicate that results are
inconclusive. */
+ while (*constraint >= '0' && *constraint <= '9')
+ constraint++;
result = -1;
break;
@@ -2211,8 +2213,12 @@ preprocess_constraints ()
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
- op_alt[j].matches = c - '0';
- recog_op_alt[op_alt[j].matches][j].matched = i;
+ {
+ char *end;
+ op_alt[j].matches = strtoul (p - 1, &end, 10);
+ recog_op_alt[op_alt[j].matches][j].matched = i;
+ p = end;
+ }
break;
case 'm':
@@ -2364,45 +2370,54 @@ constrain_operands (strict)
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
+ {
+ /* This operand must be the same as a previous one.
+ This kind of constraint is used for instructions such
+ as add when they take only two operands.
- /* This operand must be the same as a previous one.
- This kind of constraint is used for instructions such
- as add when they take only two operands.
+ Note that the lower-numbered operand is passed first.
- Note that the lower-numbered operand is passed first.
+ If we are not testing strictly, assume that this
+ constraint will be satisfied. */
- If we are not testing strictly, assume that this constraint
- will be satisfied. */
- if (strict < 0)
- val = 1;
- else
- {
- rtx op1 = recog_data.operand[c - '0'];
- rtx op2 = recog_data.operand[opno];
+ char *end;
+ int match;
- /* A unary operator may be accepted by the predicate,
- but it is irrelevant for matching constraints. */
- if (GET_RTX_CLASS (GET_CODE (op1)) == '1')
- op1 = XEXP (op1, 0);
- if (GET_RTX_CLASS (GET_CODE (op2)) == '1')
- op2 = XEXP (op2, 0);
+ match = strtoul (p - 1, &end, 10);
+ p = end;
- val = operands_match_p (op1, op2);
- }
+ if (strict < 0)
+ val = 1;
+ else
+ {
+ rtx op1 = recog_data.operand[match];
+ rtx op2 = recog_data.operand[opno];
- matching_operands[opno] = c - '0';
- matching_operands[c - '0'] = opno;
+ /* A unary operator may be accepted by the predicate,
+ but it is irrelevant for matching constraints. */
+ if (GET_RTX_CLASS (GET_CODE (op1)) == '1')
+ op1 = XEXP (op1, 0);
+ if (GET_RTX_CLASS (GET_CODE (op2)) == '1')
+ op2 = XEXP (op2, 0);
- if (val != 0)
- win = 1;
- /* If output is *x and input is *--x,
- arrange later to change the output to *--x as well,
- since the output op is the one that will be printed. */
- if (val == 2 && strict > 0)
- {
- funny_match[funny_match_index].this = opno;
- funny_match[funny_match_index++].other = c - '0';
- }
+ val = operands_match_p (op1, op2);
+ }
+
+ matching_operands[opno] = match;
+ matching_operands[match] = opno;
+
+ if (val != 0)
+ win = 1;
+
+ /* If output is *x and input is *--x, arrange later
+ to change the output to *--x as well, since the
+ output op is the one that will be printed. */
+ if (val == 2 && strict > 0)
+ {
+ funny_match[funny_match_index].this = opno;
+ funny_match[funny_match_index++].other = match;
+ }
+ }
break;
case 'p':