h8300.md (movqi_internal): Remove useless alternative(s).
authorJeff Law <law@gcc.gnu.org>
Wed, 3 Apr 1996 02:36:54 +0000 (19:36 -0700)
committerJeff Law <law@gcc.gnu.org>
Wed, 3 Apr 1996 02:36:54 +0000 (19:36 -0700)
        * h8300.md (movqi_internal): Remove useless alternative(s).  Fix
        lengths and simplify by reordering remaining alternatives.
        (movestrictqi, movhi_internal, movstricthi): Likewise.
        (movsi_h8300h, movsf_h8300h): Likewise.

From-SVN: r11655

gcc/config/h8300/h8300.md

index 509c9600d5be7462f6e4b80491deb8a6664fa1b3..6dd9f7d729636eeaed0a04f6c4a83b3d5a80dcd9 100644 (file)
@@ -32,6 +32,9 @@
 ;; ??? If we can remove the operand type on all the insns, do it.
 ;; ??? Otherwise, try to have the operand type on all the insns.
 
+;; Some move patterns have conditions which check that one operand
+;; is a register.  Shouldn't all of them have such a condition?
+
 (define_attr "type" "branch,return,call,arith,move,float,multi"
   (const_string "arith"))
 
    (set (attr "length") (if_then_else (eq_attr "cpu" "h8300") (const_int 2) (const_int 4)))
    (set_attr "cc" "set")])
 
-;; ??? Use of the `c' constraint doesn't seem right.
 (define_insn "movqi_internal"
-  [(set (match_operand:QI 0 "general_operand_dst" "=r,r,r,o,<,r")
-       (match_operand:QI 1 "general_operand_src" "I,r>,io,r,r,c"))]
+  [(set (match_operand:QI 0 "general_operand_dst" "=r,r,<,r,o")
+       (match_operand:QI 1 "general_operand_src" "I,r>,r,io,r"))]
   "register_operand (operands[0],QImode)
    || register_operand (operands[1], QImode)"
   "@
    mov.b       %X1,%X0
    mov.b       %X1,%X0
    mov.b       %X1,%X0
-   mov.b       %X1,%X0
-   xor         %X0,%X0\;bst    #0,%X0"
+   mov.b       %X1,%X0"
   [(set_attr "type" "move")
    (set_attr_alternative "length"
-     [(const_int 2) (const_int 2)
-      (if_then_else (eq_attr "cpu" "h8300") (const_int 4) (const_int 8))
+     [(const_int 2) (const_int 2) (const_int 2)
       (if_then_else (eq_attr "cpu" "h8300") (const_int 4) (const_int 8))
-      (if_then_else (eq_attr "cpu" "h8300") (const_int 2) (const_int 4))
-      (const_int 4)])
-   (set_attr "cc" "set_zn_c0,set,set,set,set,clobber")])
+      (if_then_else (eq_attr "cpu" "h8300") (const_int 4) (const_int 8))])
+   (set_attr "cc" "set_zn_c0,set,set,set,set")])
 
 (define_expand "movqi"
   [(set (match_operand:QI 0 "general_operand_dst" "")
 }")
 
 (define_insn "movstrictqi"
-  [(set (strict_low_part (match_operand:QI 0 "general_operand_dst" "=r,r,r,o,<"))
-                        (match_operand:QI 1 "general_operand_src" "I,r,io,r,r"))]
+  [(set (strict_low_part (match_operand:QI 0 "general_operand_dst" "=r,r,r"))
+                        (match_operand:QI 1 "general_operand_src" "I,r,io"))]
   ""
   "@
    sub.b       %X0,%X0
    mov.b       %X1,%X0
-   mov.b       %X1,%X0
-   mov.b       %X1,%X0
    mov.b       %X1,%X0"
   [(set_attr "type" "move")
    (set_attr_alternative "length"
      [(const_int 2) (const_int 2)
-      (if_then_else (eq_attr "cpu" "h8300") (const_int 4) (const_int 8))
-      (if_then_else (eq_attr "cpu" "h8300") (const_int 4) (const_int 8))
-      (if_then_else (eq_attr "cpu" "h8300") (const_int 2) (const_int 4))])
-   (set_attr "cc" "set_zn_c0,set,set,set,set")])
+      (if_then_else (eq_attr "cpu" "h8300") (const_int 4) (const_int 8))])
+   (set_attr "cc" "set_zn_c0,set,set")])
    
 ;; movhi
 
    (set_attr "cc" "set")])
 
 (define_insn "movhi_internal"
-  [(set (match_operand:HI 0 "general_operand_dst" "=ra,ra,ra,o,<")
-       (match_operand:HI 1 "general_operand_src" "I,ra>,ion,ra,ra"))]
+  [(set (match_operand:HI 0 "general_operand_dst" "=ra,ra,<,ra,o")
+       (match_operand:HI 1 "general_operand_src" "I,ra>,ra,ion,ra"))]
   ""
   "@
    sub.w       %T0,%T0
    mov.w       %T1,%T0"
   [(set_attr "type" "move")
    (set_attr_alternative "length"
-     [(const_int 2) (const_int 2)
+     [(const_int 2) (const_int 2) (const_int 2)
       (if_then_else (eq_attr "cpu" "h8300") (const_int 4) (const_int 8))
-      (if_then_else (eq_attr "cpu" "h8300") (const_int 4) (const_int 8))
-      (if_then_else (eq_attr "cpu" "h8300") (const_int 2) (const_int 4))])
+      (if_then_else (eq_attr "cpu" "h8300") (const_int 4) (const_int 8))])
    (set_attr "cc" "set_zn_c0,set,set,set,set")])
 
 (define_expand "movhi"
 }")
 
 (define_insn "movstricthi"
-  [(set (strict_low_part (match_operand:HI 0 "general_operand_dst" "=r,r,r,o,<"))
-                        (match_operand:HI 1 "general_operand_src" "I,r,io,r,r"))]
+  [(set (strict_low_part (match_operand:HI 0 "general_operand_dst" "=r,r,r"))
+                        (match_operand:HI 1 "general_operand_src" "I,r,io"))]
   ""
   "@
    sub.w       %T0,%T0
    mov.w       %T1,%T0
-   mov.w       %T1,%T0
-   mov.w       %T1,%T0
    mov.w       %T1,%T0"
   [(set_attr "type" "move")
    (set_attr_alternative "length"
      [(const_int 2) (const_int 2)
-      (if_then_else (eq_attr "cpu" "h8300") (const_int 4) (const_int 8))
-      (if_then_else (eq_attr "cpu" "h8300") (const_int 4) (const_int 8))
-      (if_then_else (eq_attr "cpu" "h8300") (const_int 2) (const_int 4))])
-   (set_attr "cc" "set_zn_c0,set,set,set,set")])
+      (if_then_else (eq_attr "cpu" "h8300") (const_int 4) (const_int 8))])
+   (set_attr "cc" "set_zn_c0,set,set")])
 
 ;; movsi
 
    mov.l       %S1,%S0
    mov.l       %S1,%S0"
   [(set_attr "type" "move")
-   (set_attr "length" "2,2,8,8,4,4")
+   (set_attr "length" "2,2,10,10,4,4")
    (set_attr "cc" "set_zn_c0,set,set,set,set,set")])
 
 (define_insn "movsf_h8300h"
    mov.l       %S1,%S0
    mov.l       %S1,%S0"
   [(set_attr "type" "move")
-   (set_attr "length" "2,2,8,8,4,4")
+   (set_attr "length" "2,2,10,10,4,4")
    (set_attr "cc" "set_zn_c0,set,set,set,set,set")])
 \f
 ;; ----------------------------------------------------------------------