diff options
author | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-04 20:10:29 +0000 |
---|---|---|
committer | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-04 20:10:29 +0000 |
commit | 0c3578e65fbce4c43142577301fb809106be1877 (patch) | |
tree | 35d881277dbd8c7c9a0b309b60cc803e360617e6 /gcc/config/sh/sh.md | |
parent | 776e3912b948998bde37c36091437b248a8b955e (diff) | |
download | gcc-0c3578e65fbce4c43142577301fb809106be1877.tar.gz |
PR optimization/13260
* sh-protos.h (sh_expand_t_scc): Declare.
* sh.h (PREDICATE_CODES): Add cmpsi_operand.
* sh.c (cmpsi_operand, sh_expand_t_scc): New functions.
* sh.md (cmpsi): Use cmpsi_operand. If T_REG is compared to
something that is not a CONST_INT, copy it into a pseudo register.
(subc): Fix description of new T value.
(slt, sgt, sge, sgtu): Don't clobber T after rtl generation is over.
(sltu, sleu, sgeu): Likewise.
(seq, sne): Likewise. Use sh_expand_t_scc.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74294 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/sh/sh.md')
-rw-r--r-- | gcc/config/sh/sh.md | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index 228d4e5336f..aa63209dbf6 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -705,11 +705,14 @@ (define_expand "cmpsi" [(set (reg:SI T_REG) - (compare (match_operand:SI 0 "arith_operand" "") + (compare (match_operand:SI 0 "cmpsi_operand" "") (match_operand:SI 1 "arith_operand" "")))] "TARGET_SH1" " { + if (GET_CODE (operands[0]) == REG && REGNO (operands[0]) == T_REG + && GET_CODE (operands[1]) != CONST_INT) + operands[0] = copy_to_mode_reg (SImode, operands[0]); sh_compare_op0 = operands[0]; sh_compare_op1 = operands[1]; DONE; @@ -1167,7 +1170,9 @@ (match_operand:SI 2 "arith_reg_operand" "r")) (reg:SI T_REG))) (set (reg:SI T_REG) - (gtu:SI (minus:SI (match_dup 1) (match_dup 2)) (match_dup 1)))] + (gtu:SI (minus:SI (minus:SI (match_dup 1) (match_dup 2)) + (reg:SI T_REG)) + (match_dup 1)))] "TARGET_SH1" "subc %2,%0" [(set_attr "type" "arith")]) @@ -7446,6 +7451,10 @@ mov.l\\t1f,r0\\n\\ } DONE; } + if (sh_expand_t_scc (EQ, operands[0])) + DONE; + if (! rtx_equal_function_value_matters) + FAIL; operands[1] = prepare_scc_operands (EQ); }") @@ -7492,6 +7501,8 @@ mov.l\\t1f,r0\\n\\ } DONE; } + if (! rtx_equal_function_value_matters) + FAIL; operands[1] = prepare_scc_operands (LT); }") @@ -7594,6 +7605,8 @@ mov.l\\t1f,r0\\n\\ } DONE; } + if (! rtx_equal_function_value_matters) + FAIL; operands[1] = prepare_scc_operands (GT); }") @@ -7646,6 +7659,8 @@ mov.l\\t1f,r0\\n\\ DONE; } + if (! rtx_equal_function_value_matters) + FAIL; if (GET_MODE_CLASS (GET_MODE (sh_compare_op0)) == MODE_FLOAT) { if (TARGET_IEEE) @@ -7685,6 +7700,8 @@ mov.l\\t1f,r0\\n\\ sh_compare_op0, sh_compare_op1)); DONE; } + if (! rtx_equal_function_value_matters) + FAIL; operands[1] = prepare_scc_operands (GTU); }") @@ -7709,6 +7726,8 @@ mov.l\\t1f,r0\\n\\ sh_compare_op1, sh_compare_op0)); DONE; } + if (! rtx_equal_function_value_matters) + FAIL; operands[1] = prepare_scc_operands (LTU); }") @@ -7738,6 +7757,8 @@ mov.l\\t1f,r0\\n\\ DONE; } + if (! rtx_equal_function_value_matters) + FAIL; operands[1] = prepare_scc_operands (LEU); }") @@ -7768,6 +7789,8 @@ mov.l\\t1f,r0\\n\\ DONE; } + if (! rtx_equal_function_value_matters) + FAIL; operands[1] = prepare_scc_operands (GEU); }") @@ -7815,8 +7838,12 @@ mov.l\\t1f,r0\\n\\ DONE; } - operands[1] = prepare_scc_operands (EQ); - operands[2] = gen_reg_rtx (SImode); + if (sh_expand_t_scc (NE, operands[0])) + DONE; + if (! rtx_equal_function_value_matters) + FAIL; + operands[1] = prepare_scc_operands (EQ); + operands[2] = gen_reg_rtx (SImode); }") (define_expand "sunordered" |