diff options
author | Oleg Endo <olegendo@gcc.gnu.org> | 2016-05-02 05:25:46 +0000 |
---|---|---|
committer | Oleg Endo <olegendo@gcc.gnu.org> | 2016-05-02 05:25:46 +0000 |
commit | 40d848c7145f2dda3b8871362b1cd640adf158fe (patch) | |
tree | 478b791eadd3cc9b945434b9b5cebe57697c6e15 /gcc/config/sh/sh.md | |
parent | 126fa2bb01d775d8023d233c7a587fcfa6067c4f (diff) | |
download | gcc-40d848c7145f2dda3b8871362b1cd640adf158fe.zip gcc-40d848c7145f2dda3b8871362b1cd640adf158fe.tar.gz gcc-40d848c7145f2dda3b8871362b1cd640adf158fe.tar.bz2 |
re PR target/52898 (SH Target: Inefficient DImode comparisons)
gcc/
PR target/52898
* config/sh/sh.c (sh_option_override): Remove TARGET_CBRANCHDI4,
TARGET_CMPEQDI_T.
(prepare_cbranch_operands): Don't use scratch register. Assume that
function is used when pseudos can be created.
(expand_cbranchdi4): Likewise. Remove unused TARGET_CMPEQDI_T paths.
* config/sh/sh.md (cbranchsi4): Allow only when pseudos can be created.
(cbranchdi4, cbranchdi4_i): Simplify to single cbranchdi4
define_expand. Allow it only when pseudos can be created.
* config/sh/sh.opt (mcbranchdi, mcmpeqdi): Delete.
From-SVN: r235698
Diffstat (limited to 'gcc/config/sh/sh.md')
-rw-r--r-- | gcc/config/sh/sh.md | 49 |
1 files changed, 7 insertions, 42 deletions
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index bb97e2a..af46acc 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -1115,7 +1115,7 @@ (label_ref (match_operand 3 "" "")) (pc))) (clobber (reg:SI T_REG))] - "" + "can_create_pseudo_p ()" { expand_cbranchsi4 (operands, LAST_AND_UNUSED_RTX_CODE, -1); DONE; @@ -1161,7 +1161,8 @@ (label_ref (match_dup 2)) (pc)))]) -;; FIXME: These could probably use code iterators for the compare op. +;; FIXME: These don't seem to have any effect on the generated cbranch code +;; anymore, but only on some register allocation choices. (define_split [(set (pc) (if_then_else (le (match_operand:SI 0 "arith_reg_operand" "") @@ -1255,48 +1256,12 @@ (define_expand "cbranchdi4" [(set (pc) (if_then_else (match_operator 0 "comparison_operator" - [(match_operand:DI 1 "arith_operand" "") - (match_operand:DI 2 "arith_operand" "")]) - (label_ref (match_operand 3 "" "")) - (pc))) - (clobber (match_dup 4)) - (clobber (reg:SI T_REG))] - "TARGET_CBRANCHDI4 || TARGET_SH2" -{ - enum rtx_code comparison; - - if (!TARGET_CBRANCHDI4) - { - sh_emit_compare_and_branch (operands, DImode); - DONE; - } - else - { - if (expand_cbranchdi4 (operands, LAST_AND_UNUSED_RTX_CODE)) - DONE; - - comparison = prepare_cbranch_operands (operands, DImode, - LAST_AND_UNUSED_RTX_CODE); - if (comparison != GET_CODE (operands[0])) - operands[0] - = gen_rtx_fmt_ee (comparison, VOIDmode, operands[1], operands[2]); - operands[4] = gen_rtx_SCRATCH (SImode); - } -}) - -(define_insn_and_split "cbranchdi4_i" - [(set (pc) - (if_then_else (match_operator 0 "comparison_operator" - [(match_operand:DI 1 "arith_operand" "r,r") - (match_operand:DI 2 "arith_operand" "rN,I08")]) - (label_ref (match_operand 3 "" "")) + [(match_operand:DI 1 "arith_operand") + (match_operand:DI 2 "arith_operand")]) + (label_ref (match_operand 3)) (pc))) - (clobber (match_scratch:SI 4 "=X,&r")) (clobber (reg:SI T_REG))] - "TARGET_CBRANCHDI4" - "#" - "&& reload_completed" - [(pc)] + "TARGET_SH2 && can_create_pseudo_p ()" { if (!expand_cbranchdi4 (operands, GET_CODE (operands[0]))) FAIL; |