diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-03 22:23:45 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-03 22:23:45 +0000 |
commit | 5459086b9a1888d69966dd4d5edc626f7b67338b (patch) | |
tree | d1fdd6bef838c8c122f4053f8e82a4d4807f3802 /gcc/recog.c | |
parent | 13afc42e14f846f72a21a113c14c536a06f597ba (diff) | |
download | gcc-5459086b9a1888d69966dd4d5edc626f7b67338b.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53132 138bc75d-0d04-0410-961f-82ee72b054a4
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 2720d8e07e3..2b85d4b0a25 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; +} |