diff options
author | uweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-25 11:52:13 +0000 |
---|---|---|
committer | uweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-25 11:52:13 +0000 |
commit | 7dfa5ce3ae065424b0d7c3ac734303d0ab9b772b (patch) | |
tree | f896023adb7eb858c67b994bbe4eac93db8874ba /gcc/targhooks.c | |
parent | cef1af71cbf274c343b4945baad16a8bb545891c (diff) | |
download | gcc-7dfa5ce3ae065424b0d7c3ac734303d0ab9b772b.tar.gz |
2005-05-25 Adrian Straetling <straetling@de.ibm.com>
* loop-doloop.c: Include "target.h".
(doloop_valid_p): Move tests to function in targhooks.c.
* target.h (struct gcc_target): New target hook
"insn_valid_within_doloop".
* target-def.h: Define default value for "insn_valid_within_doloop".
(TARGET_INITIALIZER): Insert new target hook into initializer.
* targhooks.c (default_insn_valid_within_doloop): New function.
* targhooks.h (default_insn_valid_within_doloop): Declare.
* hooks.c (hook_bool_rtx_true): New function.
* hooks.h (hook_bool_rtx_true): Declare.
* doc/tm.texi: Add documentation for new target hook.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100143 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/targhooks.c')
-rw-r--r-- | gcc/targhooks.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 2bf11a431eb..1f8b5b76ee7 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -262,6 +262,36 @@ default_scalar_mode_supported_p (enum machine_mode mode) } } +/* TRUE if INSN insn is valid within a low-overhead loop. + + This function checks wheter a given INSN is valid within a low-overhead + loop. A called function may clobber any special registers required for + low-overhead looping. Additionally, some targets (eg, PPC) use the count + register for branch on table instructions. We reject the doloop pattern in + these cases. */ + +bool +default_insn_valid_within_doloop (rtx insn) +{ + if (CALL_P (insn)) + { + if (dump_file) + fprintf (dump_file, "Doloop: Function call in loop.\n"); + return false; + } + + if (JUMP_P (insn) + && (GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC + || GET_CODE (PATTERN (insn)) == ADDR_VEC)) + { + if (dump_file) + fprintf (dump_file, "Doloop: Computed branch in the loop.\n"); + return false; + } + + return true; +} + bool hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false ( CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED, |