diff options
author | Jeff Law <law@redhat.com> | 2018-07-02 23:14:10 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2018-07-02 23:14:10 -0600 |
commit | cbdb1229e3a822bf84d93586d18540d0650d54da (patch) | |
tree | 92fa4cd698aa26e26e2f90ddbec54f244bea5987 | |
parent | fabd753f9e7f96c9c99e680431f0857b774a8aec (diff) | |
download | gcc-cbdb1229e3a822bf84d93586d18540d0650d54da.zip gcc-cbdb1229e3a822bf84d93586d18540d0650d54da.tar.gz gcc-cbdb1229e3a822bf84d93586d18540d0650d54da.tar.bz2 |
h8300.md (movqi_h8300, [...]): Consolidate the H8/300, H8/300H and H8/S variants into a single pattern.
* config/h8300/h8300.md (movqi_h8300, movqi_h8300hs): Consolidate
the H8/300, H8/300H and H8/S variants into a single pattern.
(movhi_h8300, movqi_h8300hs): Similarly.
(pushqi_h8300hs, pushhi_h8300hs): Consolidate into a single pattern.
(QHI mode iterator): New.
From-SVN: r262329
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/h8300/h8300.md | 57 |
2 files changed, 15 insertions, 48 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 15becdc..a1f2d35 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2018-07-02 Jeff Law <law@redhat.com> + * config/h8300/h8300.md (movqi_h8300, movqi_h8300hs): Consolidate + the H8/300, H8/300H and H8/S variants into a single pattern. + (movhi_h8300, movqi_h8300hs): Similarly. + (pushqi_h8300hs, pushhi_h8300hs): Consolidate into a single pattern. + (QHI mode iterator): New. + * config/h8300/h8300.md: Remove trailing whitespace. 2018-07-02 Jim Wilson <jimw@sifive.com> diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index 846fd73..74b2233 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -184,6 +184,7 @@ (define_mode_iterator P [(HI "Pmode == HImode") (SI "Pmode == SImode")]) +(define_mode_iterator QHI [QI HI]) ;; ---------------------------------------------------------------------- ;; MOVE INSTRUCTIONS @@ -191,25 +192,10 @@ ;; movqi -(define_insn "*movqi_h8300" +(define_insn "*movqi_h8nosx" [(set (match_operand:QI 0 "general_operand_dst" "=r,r ,<,r,r,m") (match_operand:QI 1 "general_operand_src" " I,r>,r,n,m,r"))] - "TARGET_H8300 - && h8300_move_ok (operands[0], operands[1])" - "@ - sub.b %X0,%X0 - mov.b %R1,%X0 - mov.b %X1,%R0 - mov.b %R1,%X0 - mov.b %R1,%X0 - mov.b %X1,%R0" - [(set_attr "length" "2,2,2,2,4,4") - (set_attr "cc" "set_zn,set_znv,set_znv,set_znv,set_znv,set_znv")]) - -(define_insn "*movqi_h8300hs" - [(set (match_operand:QI 0 "general_operand_dst" "=r,r ,<,r,r,m") - (match_operand:QI 1 "general_operand_src" " I,r>,r,n,m,r"))] - "(TARGET_H8300H || TARGET_H8300S) && !TARGET_H8300SX + "(TARGET_H8300 || TARGET_H8300H || TARGET_H8300S) && !TARGET_H8300SX && h8300_move_ok (operands[0], operands[1])" "@ sub.b %X0,%X0 @@ -220,7 +206,7 @@ mov.b %X1,%R0" [(set (attr "length") (symbol_ref "compute_mov_length (operands)")) - (set_attr "cc" "set_zn,set_znv,set_znv,clobber,set_znv,set_znv")]) + (set_attr "cc" "set_zn,set_znv,set_znv,set_znv,set_znv,set_znv")]) (define_insn "*movqi_h8sx" [(set (match_operand:QI 0 "general_operand_dst" "=Z,rQ") @@ -255,26 +241,10 @@ ;; movhi -(define_insn "*movhi_h8300" +(define_insn "*movhi_h8nosx" [(set (match_operand:HI 0 "general_operand_dst" "=r,r,<,r,r,m") (match_operand:HI 1 "general_operand_src" "I,r>,r,i,m,r"))] - "TARGET_H8300 - && h8300_move_ok (operands[0], operands[1])" - "@ - sub.w %T0,%T0 - mov.w %T1,%T0 - mov.w %T1,%T0 - mov.w %T1,%T0 - mov.w %T1,%T0 - mov.w %T1,%T0" - [(set (attr "length") - (symbol_ref "compute_mov_length (operands)")) - (set_attr "cc" "set_zn,set_znv,set_znv,set_znv,set_znv,set_znv")]) - -(define_insn "*movhi_h8300hs" - [(set (match_operand:HI 0 "general_operand_dst" "=r,r,<,r,r,m") - (match_operand:HI 1 "general_operand_src" "I,r>,r,i,m,r"))] - "(TARGET_H8300H || TARGET_H8300S) && !TARGET_H8300SX + "(TARGET_H8300 || TARGET_H8300H || TARGET_H8300S) && !TARGET_H8300SX && h8300_move_ok (operands[0], operands[1])" "@ sub.w %T0,%T0 @@ -855,25 +825,16 @@ "mov.w\\t%T0,@-r7" [(set_attr "length" "2")]) -(define_insn "*pushqi1_h8300hs_<mode>" - [(set (mem:QI +(define_insn "*push1_h8300hs_<mode>" + [(set (mem:QHI (pre_modify:P (reg:P SP_REG) (plus:P (reg:P SP_REG) (const_int -4)))) - (match_operand:QI 0 "register_no_sp_elim_operand" "r"))] + (match_operand:QHI 0 "register_no_sp_elim_operand" "r"))] "TARGET_H8300H || TARGET_H8300S" "mov.l\\t%S0,@-er7" [(set_attr "length" "4")]) -(define_insn "*pushhi1_h8300hs_<mode>" - [(set (mem:HI - (pre_modify:P - (reg:P SP_REG) - (plus:P (reg:P SP_REG) (const_int -4)))) - (match_operand:HI 0 "register_no_sp_elim_operand" "r"))] - "TARGET_H8300H || TARGET_H8300S" - "mov.l\\t%S0,@-er7" - [(set_attr "length" "4")]) ;; ---------------------------------------------------------------------- ;; TEST INSTRUCTIONS |