From 674ba2d6bfd0710a72b397571afab1378c8e347a Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Wed, 19 Aug 1992 21:32:51 -0400 Subject: [PATCH] (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 --- gcc/genconfig.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/gcc/genconfig.c b/gcc/genconfig.c index 3104d482578..820e1d850bf 100644 --- a/gcc/genconfig.c +++ b/gcc/genconfig.c @@ -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 register_constraint_flag; static int have_cc0_flag; +static int have_cmove_flag; static int have_lo_sum_flag; /* Maximum number of insns seen in a split. */ @@ -53,11 +54,16 @@ static void fatal (); void fancy_abort (); /* 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 -walk_insn_part (part, recog_p) +walk_insn_part (part, recog_p, non_pc_set_src) rtx part; + int recog_p; + int non_pc_set_src; { register int i, j; register RTX_CODE code; @@ -113,6 +119,17 @@ walk_insn_part (part, recog_p) have_lo_sum_flag = 1; 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 PC: return; @@ -125,12 +142,12 @@ walk_insn_part (part, recog_p) { case 'e': case 'u': - walk_insn_part (XEXP (part, i), recog_p); + walk_insn_part (XEXP (part, i), recog_p, non_pc_set_src); break; case 'E': if (XVEC (part, i) != NULL) 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; } } @@ -146,7 +163,7 @@ gen_insn (insn) dup_operands_seen_this_insn = 0; if (XVEC (insn, 1) != 0) 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) max_clobbers_per_insn = clobbers_seen_this_insn; @@ -174,7 +191,7 @@ gen_expand (insn) don't sum across all of them. */ 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) max_clobbers_per_insn = clobbers_seen_this_insn; @@ -192,7 +209,7 @@ gen_split (split) /* Look through the patterns that are matched to compute the maximum operand number. */ 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. */ if (XVECLEN (split, 2) > max_insns_per_split) max_insns_per_split = XVECLEN (split, 2); @@ -207,7 +224,7 @@ gen_peephole (peep) /* Look through the patterns that are matched to compute the maximum operand number. */ 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 * @@ -317,6 +334,9 @@ from the machine description file `md'. */\n\n"); if (have_cc0_flag) printf ("#define HAVE_cc0\n"); + if (have_cmove_flag) + printf ("#define HAVE_conditional_move\n"); + if (have_lo_sum_flag) printf ("#define HAVE_lo_sum\n");