Commit fae7e834 by Jeff Law Committed by Jeff Law

h8300.md (movmd_internal_normal): Consolidated with (movmd_internal) into a…

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
parent f1ee5763
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.
......
......@@ -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_<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
#"
......@@ -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_<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:
#"
......@@ -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)]
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment