diff options
author | Richard Henderson <rth@redhat.com> | 2002-05-03 15:23:45 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-05-03 15:23:45 -0700 |
commit | b37c26149f78529a896c054c879f880d7a80b6ef (patch) | |
tree | d1fdd6bef838c8c122f4053f8e82a4d4807f3802 /gcc/recog.c | |
parent | e1c1132e0b08e1eccc4b361ae9725e5e12a1a2c9 (diff) | |
download | gcc-b37c26149f78529a896c054c879f880d7a80b6ef.zip gcc-b37c26149f78529a896c054c879f880d7a80b6ef.tar.gz gcc-b37c26149f78529a896c054c879f880d7a80b6ef.tar.bz2 |
recog.c (store_data_bypass_p, [...]): New.
* recog.c (store_data_bypass_p, if_test_bypass_p): New.
* recog.h: Declare them.
* config/sparc/sparc.c (ultrasparc_store_bypass_p): Remove.
* config/sparc/sparc.md: Use store_data_bypass_p instead.
* config/sparc/sparc-protos.h: Update.
From-SVN: r53132
Diffstat (limited to 'gcc/recog.c')
-rw-r--r-- | gcc/recog.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/gcc/recog.c b/gcc/recog.c index 2720d8e..2b85d4b 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -3275,3 +3275,60 @@ peephole2_optimize (dump_file) #endif } #endif /* HAVE_peephole2 */ + +/* Common predicates for use with define_bypass. */ + +/* True if the dependency between OUT_INSN and IN_INSN is on the store + data not the address operand(s) of the store. Both OUT_INSN and IN_INSN + must be single_set. */ + +int +store_data_bypass_p (out_insn, in_insn) + rtx out_insn, in_insn; +{ + rtx out_set, in_set; + + out_set = single_set (out_insn); + if (! out_set) + abort (); + + in_set = single_set (in_insn); + if (! in_set) + abort (); + + if (GET_CODE (SET_DEST (in_set)) != MEM) + return false; + + if (reg_mentioned_p (SET_DEST (out_set), SET_DEST (in_set))) + return false; + + return true; +} + +/* True if the dependency between OUT_INSN and IN_INSN is in the + IF_THEN_ELSE condition, and not the THEN or ELSE branch. + Both OUT_INSN and IN_INSN must be single_set. */ + +int +if_test_bypass_p (out_insn, in_insn) + rtx out_insn, in_insn; +{ + rtx out_set, in_set; + + out_set = single_set (out_insn); + if (! out_set) + abort (); + + in_set = single_set (in_insn); + if (! in_set) + abort (); + + if (GET_CODE (SET_SRC (in_set)) != IF_THEN_ELSE) + return false; + + if (reg_mentioned_p (SET_DEST (out_set), XEXP (in_set, 1)) + || reg_mentioned_p (SET_DEST (out_set), XEXP (in_set, 2))) + return false; + + return true; +} |