From: Jeff Law Date: Wed, 4 Jul 2018 00:27:38 +0000 (-0600) Subject: h8300.md (movmd_internal_normal): Consolidated with (movmd_internal) into a single... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fae7e83445b4547f98b83e101b4e74fbfbb4d915;p=gcc.git h8300.md (movmd_internal_normal): Consolidated with (movmd_internal) into a single pattern using the P mode iterator. * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 760ad599315..9e27699088c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2018-07-03 Jeff Law - + * 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. diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index 5014fd596ad..e6547843bd3 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -512,33 +512,16 @@ ;; 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_" + [(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 #" @@ -563,33 +546,11 @@ (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)] { @@ -641,28 +602,14 @@ ;; 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_" + [(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: #" @@ -675,29 +622,10 @@ (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)] {