Commit 674ba2d6 by Richard Kenner

(have_cmove_flag): New variable.

(walk_insn_part): Add new parm NON_PC_SET_SRC; all callers changed.
Look for IF_THEN_ELSE in a SET_SRC that isn't setting PC and set
have_cmove_flag if so.
(main): Define HAVE_conditional_move if have_cmove_flag is non-zero.

From-SVN: r1902
parent cd1ceb3c
...@@ -40,6 +40,7 @@ static int max_dup_operands; /* Largest number of match_dup in any insn. */ ...@@ -40,6 +40,7 @@ static int max_dup_operands; /* Largest number of match_dup in any insn. */
static int max_clobbers_per_insn; static int max_clobbers_per_insn;
static int register_constraint_flag; static int register_constraint_flag;
static int have_cc0_flag; static int have_cc0_flag;
static int have_cmove_flag;
static int have_lo_sum_flag; static int have_lo_sum_flag;
/* Maximum number of insns seen in a split. */ /* Maximum number of insns seen in a split. */
...@@ -53,11 +54,16 @@ static void fatal (); ...@@ -53,11 +54,16 @@ static void fatal ();
void fancy_abort (); void fancy_abort ();
/* RECOG_P will be non-zero if this pattern was seen in a context where it will /* RECOG_P will be non-zero if this pattern was seen in a context where it will
be used to recognize, rather than just generate an insn. */ be used to recognize, rather than just generate an insn.
NON_PC_SET_SRC will be non-zero if this pattern was seen in a SET_SRC
of a SET whose destination is not (pc). */
static void static void
walk_insn_part (part, recog_p) walk_insn_part (part, recog_p, non_pc_set_src)
rtx part; rtx part;
int recog_p;
int non_pc_set_src;
{ {
register int i, j; register int i, j;
register RTX_CODE code; register RTX_CODE code;
...@@ -113,6 +119,17 @@ walk_insn_part (part, recog_p) ...@@ -113,6 +119,17 @@ walk_insn_part (part, recog_p)
have_lo_sum_flag = 1; have_lo_sum_flag = 1;
return; return;
case SET:
walk_insn_part (SET_DEST (part), 0, recog_p);
walk_insn_part (SET_SRC (part), recog_p,
GET_CODE (SET_DEST (part)) != PC);
return;
case IF_THEN_ELSE:
if (recog_p && non_pc_set_src)
have_cmove_flag = 1;
break;
case REG: case CONST_INT: case SYMBOL_REF: case REG: case CONST_INT: case SYMBOL_REF:
case PC: case PC:
return; return;
...@@ -125,12 +142,12 @@ walk_insn_part (part, recog_p) ...@@ -125,12 +142,12 @@ walk_insn_part (part, recog_p)
{ {
case 'e': case 'e':
case 'u': case 'u':
walk_insn_part (XEXP (part, i), recog_p); walk_insn_part (XEXP (part, i), recog_p, non_pc_set_src);
break; break;
case 'E': case 'E':
if (XVEC (part, i) != NULL) if (XVEC (part, i) != NULL)
for (j = 0; j < XVECLEN (part, i); j++) for (j = 0; j < XVECLEN (part, i); j++)
walk_insn_part (XVECEXP (part, i, j), recog_p); walk_insn_part (XVECEXP (part, i, j), recog_p, non_pc_set_src);
break; break;
} }
} }
...@@ -146,7 +163,7 @@ gen_insn (insn) ...@@ -146,7 +163,7 @@ gen_insn (insn)
dup_operands_seen_this_insn = 0; dup_operands_seen_this_insn = 0;
if (XVEC (insn, 1) != 0) if (XVEC (insn, 1) != 0)
for (i = 0; i < XVECLEN (insn, 1); i++) for (i = 0; i < XVECLEN (insn, 1); i++)
walk_insn_part (XVECEXP (insn, 1, i), 1); walk_insn_part (XVECEXP (insn, 1, i), 1, 0);
if (clobbers_seen_this_insn > max_clobbers_per_insn) if (clobbers_seen_this_insn > max_clobbers_per_insn)
max_clobbers_per_insn = clobbers_seen_this_insn; max_clobbers_per_insn = clobbers_seen_this_insn;
...@@ -174,7 +191,7 @@ gen_expand (insn) ...@@ -174,7 +191,7 @@ gen_expand (insn)
don't sum across all of them. */ don't sum across all of them. */
clobbers_seen_this_insn = 0; clobbers_seen_this_insn = 0;
walk_insn_part (XVECEXP (insn, 1, i), 0); walk_insn_part (XVECEXP (insn, 1, i), 0, 0);
if (clobbers_seen_this_insn > max_clobbers_per_insn) if (clobbers_seen_this_insn > max_clobbers_per_insn)
max_clobbers_per_insn = clobbers_seen_this_insn; max_clobbers_per_insn = clobbers_seen_this_insn;
...@@ -192,7 +209,7 @@ gen_split (split) ...@@ -192,7 +209,7 @@ gen_split (split)
/* Look through the patterns that are matched /* Look through the patterns that are matched
to compute the maximum operand number. */ to compute the maximum operand number. */
for (i = 0; i < XVECLEN (split, 0); i++) for (i = 0; i < XVECLEN (split, 0); i++)
walk_insn_part (XVECEXP (split, 0, i), 1); walk_insn_part (XVECEXP (split, 0, i), 1, 0);
/* Look at the number of insns this insn could split into. */ /* Look at the number of insns this insn could split into. */
if (XVECLEN (split, 2) > max_insns_per_split) if (XVECLEN (split, 2) > max_insns_per_split)
max_insns_per_split = XVECLEN (split, 2); max_insns_per_split = XVECLEN (split, 2);
...@@ -207,7 +224,7 @@ gen_peephole (peep) ...@@ -207,7 +224,7 @@ gen_peephole (peep)
/* Look through the patterns that are matched /* Look through the patterns that are matched
to compute the maximum operand number. */ to compute the maximum operand number. */
for (i = 0; i < XVECLEN (peep, 0); i++) for (i = 0; i < XVECLEN (peep, 0); i++)
walk_insn_part (XVECEXP (peep, 0, i), 1); walk_insn_part (XVECEXP (peep, 0, i), 1, 0);
} }
char * char *
...@@ -317,6 +334,9 @@ from the machine description file `md'. */\n\n"); ...@@ -317,6 +334,9 @@ from the machine description file `md'. */\n\n");
if (have_cc0_flag) if (have_cc0_flag)
printf ("#define HAVE_cc0\n"); printf ("#define HAVE_cc0\n");
if (have_cmove_flag)
printf ("#define HAVE_conditional_move\n");
if (have_lo_sum_flag) if (have_lo_sum_flag)
printf ("#define HAVE_lo_sum\n"); printf ("#define HAVE_lo_sum\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment