h8300.md (movmd_internal_normal): Consolidated with (movmd_internal) into a single...
authorJeff Law <law@redhat.com>
Wed, 4 Jul 2018 00:27:38 +0000 (18:27 -0600)
committerJeff Law <law@gcc.gnu.org>
Wed, 4 Jul 2018 00:27:38 +0000 (18:27 -0600)
* config/h8300/h8300.md (movmd_internal_normal): Consolidated with
(movmd_internal) into a single pattern using the P mode iterator.
(movmd splitters): Similarly.
(stpcpy_internal_normal, stpcpy_internal): Similarly for thes patterns.
(movsd splitters): Similarly.

From-SVN: r262365

gcc/ChangeLog
gcc/config/h8300/h8300.md

index 760ad5993153010e7620247e71234e9420d83281..9e27699088cfde24c9277865770b85fb15859751 100644 (file)
@@ -1,5 +1,10 @@
 2018-07-03  Jeff Law  <law@redhat.com>
-
+       * config/h8300/h8300.md (movmd_internal_normal): Consolidated with
+       (movmd_internal) into a single pattern using the P mode iterator.
+       (movmd splitters): Similarly.
+       (stpcpy_internal_normal, stpcpy_internal): Similarly for thes patterns.
+       (movsd splitters): Similarly.
+       
        * config/h8300/h8300.c (h8300_insn_length_from_table): Consolidate
        ADDB, ADDW and ADDL into a single ADD attribute which selects the
        right table based on the size of the operand.
index 5014fd596ad4ea48f2c47be83c0c322564766b64..e6547843bd305ced347b93f7bd8f4ba0c59fe098 100644 (file)
 ;; This is a difficult instruction to reload since operand 0 must be the
 ;; frame pointer.  See h8300_reg_class_from_letter for an explanation.
 
-(define_insn "movmd_internal_normal"
-  [(set (mem:BLK (match_operand:HI 3 "register_operand" "0,r"))
-       (mem:BLK (match_operand:HI 4 "register_operand" "1,1")))
+(define_insn "movmd_internal_<mode>"
+  [(set (mem:BLK (match_operand:P 3 "register_operand" "0,r"))
+       (mem:BLK (match_operand:P 4 "register_operand" "1,1")))
    (unspec [(match_operand:HI 5 "register_operand" "2,2")
            (match_operand:HI 6 "const_int_operand" "n,n")] UNSPEC_MOVMD)
-   (clobber (match_operand:HI 0 "register_operand" "=d,??D"))
-   (clobber (match_operand:HI 1 "register_operand" "=f,f"))
+   (clobber (match_operand:P 0 "register_operand" "=d,??D"))
+   (clobber (match_operand:P 1 "register_operand" "=f,f"))
    (set (match_operand:HI 2 "register_operand" "=c,c")
        (const_int 0))]
-  "TARGET_H8300SX && TARGET_NORMAL_MODE"
-  "@
-    movmd%m6
-    #"
-  [(set_attr "length" "2,14")
-   (set_attr "can_delay" "no")
-   (set_attr "cc" "none,clobber")])
-
-(define_insn "movmd_internal"
-  [(set (mem:BLK (match_operand:SI 3 "register_operand" "0,r"))
-       (mem:BLK (match_operand:SI 4 "register_operand" "1,1")))
-   (unspec [(match_operand:HI 5 "register_operand" "2,2")
-           (match_operand:HI 6 "const_int_operand" "n,n")] UNSPEC_MOVMD)
-   (clobber (match_operand:SI 0 "register_operand" "=d,??D"))
-   (clobber (match_operand:SI 1 "register_operand" "=f,f"))
-   (set (match_operand:HI 2 "register_operand" "=c,c")
-       (const_int 0))]
-  "TARGET_H8300SX && !TARGET_NORMAL_MODE"
+  "TARGET_H8300SX"
   "@
     movmd%m6
     #"
        (match_operand:BLK 1 "memory_operand" ""))
    (unspec [(match_operand:HI 2 "register_operand" "")
            (match_operand:HI 3 "const_int_operand" "")] UNSPEC_MOVMD)
-   (clobber (match_operand:HI 4 "register_operand" ""))
-   (clobber (match_operand:HI 5 "register_operand" ""))
-   (set (match_dup 2)
-       (const_int 0))]
-  "TARGET_H8300SX && TARGET_NORMAL_MODE && reload_completed
-   && REGNO (operands[4]) != DESTINATION_REG"
-  [(const_int 0)]
-  {
-    rtx dest;
-
-    h8300_swap_into_er6 (XEXP (operands[0], 0));
-    dest = replace_equiv_address (operands[0], hard_frame_pointer_rtx);
-    emit_insn (gen_movmd (dest, operands[1], operands[2], operands[3]));
-    h8300_swap_out_of_er6 (operands[4]);
-    DONE;
-  })
-
-(define_split
-  [(set (match_operand:BLK 0 "memory_operand" "")
-       (match_operand:BLK 1 "memory_operand" ""))
-   (unspec [(match_operand:HI 2 "register_operand" "")
-           (match_operand:HI 3 "const_int_operand" "")] UNSPEC_MOVMD)
-   (clobber (match_operand:SI 4 "register_operand" ""))
-   (clobber (match_operand:SI 5 "register_operand" ""))
+   (clobber (match_operand:P 4 "register_operand" ""))
+   (clobber (match_operand:P 5 "register_operand" ""))
    (set (match_dup 2)
        (const_int 0))]
-  "TARGET_H8300SX && !TARGET_NORMAL_MODE && reload_completed
+  "TARGET_H8300SX && reload_completed
    && REGNO (operands[4]) != DESTINATION_REG"
   [(const_int 0)]
   {
 
 ;; See comments above memcpy_internal().
 
-(define_insn "stpcpy_internal_normal"
-  [(set (mem:BLK (match_operand:HI 3 "register_operand" "0,r"))
-       (unspec:BLK [(mem:BLK (match_operand:HI 4 "register_operand" "1,1"))]
-       UNSPEC_STPCPY))
-   (clobber (match_operand:HI 0 "register_operand" "=d,??D"))
-   (clobber (match_operand:HI 1 "register_operand" "=f,f"))
-   (clobber (match_operand:HI 2 "register_operand" "=c,c"))]
-  "TARGET_H8300SX && TARGET_NORMAL_MODE"
-  "@
-    \n1:\tmovsd\t2f\;bra\t1b\n2:
-    #"
-  [(set_attr "length" "6,18")
-   (set_attr "cc" "none,clobber")])
-
-(define_insn "stpcpy_internal"
-  [(set (mem:BLK (match_operand:SI 3 "register_operand" "0,r"))
-       (unspec:BLK [(mem:BLK (match_operand:SI 4 "register_operand" "1,1"))]
+(define_insn "stpcpy_internal_<mode>"
+  [(set (mem:BLK (match_operand:P 3 "register_operand" "0,r"))
+       (unspec:BLK [(mem:BLK (match_operand:P 4 "register_operand" "1,1"))]
        UNSPEC_STPCPY))
-   (clobber (match_operand:SI 0 "register_operand" "=d,??D"))
-   (clobber (match_operand:SI 1 "register_operand" "=f,f"))
-   (clobber (match_operand:SI 2 "register_operand" "=c,c"))]
-  "TARGET_H8300SX && !TARGET_NORMAL_MODE"
+   (clobber (match_operand:P 0 "register_operand" "=d,??D"))
+   (clobber (match_operand:P 1 "register_operand" "=f,f"))
+   (clobber (match_operand:P 2 "register_operand" "=c,c"))]
+  "TARGET_H8300SX"
   "@
     \n1:\tmovsd\t2f\;bra\t1b\n2:
     #"
 (define_split
   [(set (match_operand:BLK 0 "memory_operand" "")
        (unspec:BLK [(match_operand:BLK 1 "memory_operand" "")] UNSPEC_STPCPY))
-   (clobber (match_operand:HI 2 "register_operand" ""))
-   (clobber (match_operand:HI 3 "register_operand" ""))
-   (clobber (match_operand:HI 4 "register_operand" ""))]
-  "TARGET_H8300SX && TARGET_NORMAL_MODE && reload_completed
-   && REGNO (operands[2]) != DESTINATION_REG"
-  [(const_int 0)]
-  {
-    rtx dest;
-
-    h8300_swap_into_er6 (XEXP (operands[0], 0));
-    dest = replace_equiv_address (operands[0], hard_frame_pointer_rtx);
-    emit_insn (gen_movsd (dest, operands[1], operands[4]));
-    h8300_swap_out_of_er6 (operands[2]);
-    DONE;
-  })
-
-(define_split
-  [(set (match_operand:BLK 0 "memory_operand" "")
-       (unspec:BLK [(match_operand:BLK 1 "memory_operand" "")] UNSPEC_STPCPY))
-   (clobber (match_operand:SI 2 "register_operand" ""))
-   (clobber (match_operand:SI 3 "register_operand" ""))
-   (clobber (match_operand:SI 4 "register_operand" ""))]
-  "TARGET_H8300SX && !TARGET_NORMAL_MODE && reload_completed
+   (clobber (match_operand:P 2 "register_operand" ""))
+   (clobber (match_operand:P 3 "register_operand" ""))
+   (clobber (match_operand:P 4 "register_operand" ""))]
+  "TARGET_H8300SX &&  reload_completed
    && REGNO (operands[2]) != DESTINATION_REG"
   [(const_int 0)]
   {