re PR target/51244 ([SH] Inefficient conditional branch and code around T bit)
authorOleg Endo <olegendo@gcc.gnu.org>
Fri, 12 Oct 2012 00:41:23 +0000 (00:41 +0000)
committerOleg Endo <olegendo@gcc.gnu.org>
Fri, 12 Oct 2012 00:41:23 +0000 (00:41 +0000)
commitb4eca9c8df76d36dc7bb909424e0cc5a0d52d095
tree962653c07a00c814ead771a9568becdae982ddb7
parent76a2a3f738f94ff070c2e4179951f8579f70555e
re PR target/51244 ([SH] Inefficient conditional branch and code around T bit)

PR target/51244
* config/sh/sh.md (negsi_cond, negdi_cond, stack_protect_test): Remove
get_t_reg_rtx when invoking gen_branch_true or gen_branch_false.
(*zero_extend<mode>si2_compact): Convert to insn_and_split.  Convert
zero extensions of T bit stores to reg moves in splitter.  Remove
obsolete unnamed peephole2 that caught zero extensions after negc T bit
stores.
(*branch_true_eq, *branch_false_ne): Delete.
(branch_true, branch_false): Convert insn to expander.  Move actual
insn logic to...
(*cbranch_t): ...this new insn_and_split.  Try to find preceding
redundant T bit stores and tests and combine them with the conditional
branch if possible in the splitter.
(movrt_xor, *movt_movrt): New insn_and_split.
* config/sh/predicates.md (cbranch_treg_value): New predicate.
* config/sh/sh-protos.h (sh_eval_treg_value): Forward declare...
* config/sh/sh.c (sh_eval_treg_value): ...this new function.
(expand_cbranchsi4, expand_cbranchdi4): Remove get_t_reg_rtx
when invoking gen_branch_true or gen_branch_false.

PR target/51244
* gcc.target/sh/pr51244-13.c: New.
* gcc.target/sh/pr51244-14.c: New.
* gcc.target/sh/pr51244-15.c: New.
* gcc.target/sh/pr51244-16.c: New.

From-SVN: r192387
gcc/ChangeLog
gcc/config/sh/predicates.md
gcc/config/sh/sh-protos.h
gcc/config/sh/sh.c
gcc/config/sh/sh.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/sh/pr51244-13.c [new file with mode: 0644]
gcc/testsuite/gcc.target/sh/pr51244-14.c [new file with mode: 0644]
gcc/testsuite/gcc.target/sh/pr51244-15.c [new file with mode: 0644]
gcc/testsuite/gcc.target/sh/pr51244-16.c [new file with mode: 0644]