Commit 3c5db734 by Uros Bizjak

i386.md (*ashl<mode>3_mask): Rewrite define_insn pattern as define_insn_and_split.

	* config/i386/i386.md (*ashl<mode>3_mask): Rewrite define_insn
	pattern as define_insn_and_split.  Split insn before reload to
	ashl<mode>3_1.
	(*<shift_insn><mode>3_mask): Ditto.  Split insn before reload to
	<shift_insn><mode>3_1.
	(*<rotate_insn><mode>3_mask): Ditto.  Split insn before reload to
	<rotate_insn><mode>3_1.

From-SVN: r239511
parent 65e736c0
2016-08-16 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (*ashl<mode>3_mask): Rewrite define_insn
pattern as define_insn_and_split. Split insn before reload to
ashl<mode>3_1.
(*<shift_insn><mode>3_mask): Ditto. Split insn before reload to
<shift_insn><mode>3_1.
(*<rotate_insn><mode>3_mask): Ditto. Split insn before reload to
<rotate_insn><mode>3_1.
2016-08-16 David Malcolm <dmalcolm@redhat.com> 2016-08-16 David Malcolm <dmalcolm@redhat.com>
PR c/72857 PR c/72857
...@@ -33,8 +43,8 @@ ...@@ -33,8 +43,8 @@
2016-08-16 Jakub Jelinek <jakub@redhat.com> 2016-08-16 Jakub Jelinek <jakub@redhat.com>
PR target/71910 PR target/71910
* tree-cfg.c (execute_fixup_cfg): Add node variable, use it. Before inlining, * tree-cfg.c (execute_fixup_cfg): Add node variable, use it. Before
add cgraph edge for the added __builtin_unreachable call. inlining, add cgraph edge for the added __builtin_unreachable call.
PR middle-end/67485 PR middle-end/67485
* expmed.c (expand_mult_const): Change val_so_far's type to UHWI, * expmed.c (expand_mult_const): Change val_so_far's type to UHWI,
......
...@@ -9794,23 +9794,27 @@ ...@@ -9794,23 +9794,27 @@
}) })
;; Avoid useless masking of count operand. ;; Avoid useless masking of count operand.
(define_insn "*ashl<mode>3_mask" (define_insn_and_split "*ashl<mode>3_mask"
[(set (match_operand:SWI48 0 "nonimmediate_operand" "=rm") [(set (match_operand:SWI48 0 "nonimmediate_operand")
(ashift:SWI48 (ashift:SWI48
(match_operand:SWI48 1 "nonimmediate_operand" "0") (match_operand:SWI48 1 "nonimmediate_operand")
(subreg:QI (subreg:QI
(and:SI (and:SI
(match_operand:SI 2 "register_operand" "c") (match_operand:SI 2 "register_operand")
(match_operand:SI 3 "const_int_operand" "n")) 0))) (match_operand:SI 3 "const_int_operand")) 0)))
(clobber (reg:CC FLAGS_REG))] (clobber (reg:CC FLAGS_REG))]
"ix86_binary_operator_ok (ASHIFT, <MODE>mode, operands) "ix86_binary_operator_ok (ASHIFT, <MODE>mode, operands)
&& (INTVAL (operands[3]) & (GET_MODE_BITSIZE (<MODE>mode)-1)) && (INTVAL (operands[3]) & (GET_MODE_BITSIZE (<MODE>mode)-1))
== GET_MODE_BITSIZE (<MODE>mode)-1" == GET_MODE_BITSIZE (<MODE>mode)-1
{ && can_create_pseudo_p ()"
return "sal{<imodesuffix>}\t{%b2, %0|%0, %b2}"; "#"
} "&& 1"
[(set_attr "type" "ishift") [(parallel
(set_attr "mode" "<MODE>")]) [(set (match_dup 0)
(ashift:SWI48 (match_dup 1)
(match_dup 2)))
(clobber (reg:CC FLAGS_REG))])]
"operands[2] = gen_lowpart (QImode, operands[2]);")
(define_insn "*bmi2_ashl<mode>3_1" (define_insn "*bmi2_ashl<mode>3_1"
[(set (match_operand:SWI48 0 "register_operand" "=r") [(set (match_operand:SWI48 0 "register_operand" "=r")
...@@ -10290,23 +10294,27 @@ ...@@ -10290,23 +10294,27 @@
"ix86_expand_binary_operator (<CODE>, <MODE>mode, operands); DONE;") "ix86_expand_binary_operator (<CODE>, <MODE>mode, operands); DONE;")
;; Avoid useless masking of count operand. ;; Avoid useless masking of count operand.
(define_insn "*<shift_insn><mode>3_mask" (define_insn_and_split "*<shift_insn><mode>3_mask"
[(set (match_operand:SWI48 0 "nonimmediate_operand" "=rm") [(set (match_operand:SWI48 0 "nonimmediate_operand")
(any_shiftrt:SWI48 (any_shiftrt:SWI48
(match_operand:SWI48 1 "nonimmediate_operand" "0") (match_operand:SWI48 1 "nonimmediate_operand")
(subreg:QI (subreg:QI
(and:SI (and:SI
(match_operand:SI 2 "register_operand" "c") (match_operand:SI 2 "register_operand")
(match_operand:SI 3 "const_int_operand" "n")) 0))) (match_operand:SI 3 "const_int_operand")) 0)))
(clobber (reg:CC FLAGS_REG))] (clobber (reg:CC FLAGS_REG))]
"ix86_binary_operator_ok (<CODE>, <MODE>mode, operands) "ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)
&& (INTVAL (operands[3]) & (GET_MODE_BITSIZE (<MODE>mode)-1)) && (INTVAL (operands[3]) & (GET_MODE_BITSIZE (<MODE>mode)-1))
== GET_MODE_BITSIZE (<MODE>mode)-1" == GET_MODE_BITSIZE (<MODE>mode)-1
{ && can_create_pseudo_p ()"
return "<shift>{<imodesuffix>}\t{%b2, %0|%0, %b2}"; "#"
} "&& 1"
[(set_attr "type" "ishift") [(parallel
(set_attr "mode" "<MODE>")]) [(set (match_dup 0)
(any_shiftrt:SWI48 (match_dup 1)
(match_dup 2)))
(clobber (reg:CC FLAGS_REG))])]
"operands[2] = gen_lowpart (QImode, operands[2]);")
(define_insn_and_split "*<shift_insn><mode>3_doubleword" (define_insn_and_split "*<shift_insn><mode>3_doubleword"
[(set (match_operand:DWI 0 "register_operand" "=r") [(set (match_operand:DWI 0 "register_operand" "=r")
...@@ -10745,23 +10753,27 @@ ...@@ -10745,23 +10753,27 @@
"ix86_expand_binary_operator (<CODE>, <MODE>mode, operands); DONE;") "ix86_expand_binary_operator (<CODE>, <MODE>mode, operands); DONE;")
;; Avoid useless masking of count operand. ;; Avoid useless masking of count operand.
(define_insn "*<rotate_insn><mode>3_mask" (define_insn_and_split "*<rotate_insn><mode>3_mask"
[(set (match_operand:SWI48 0 "nonimmediate_operand" "=rm") [(set (match_operand:SWI48 0 "nonimmediate_operand")
(any_rotate:SWI48 (any_rotate:SWI48
(match_operand:SWI48 1 "nonimmediate_operand" "0") (match_operand:SWI48 1 "nonimmediate_operand")
(subreg:QI (subreg:QI
(and:SI (and:SI
(match_operand:SI 2 "register_operand" "c") (match_operand:SI 2 "register_operand")
(match_operand:SI 3 "const_int_operand" "n")) 0))) (match_operand:SI 3 "const_int_operand")) 0)))
(clobber (reg:CC FLAGS_REG))] (clobber (reg:CC FLAGS_REG))]
"ix86_binary_operator_ok (<CODE>, <MODE>mode, operands) "ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)
&& (INTVAL (operands[3]) & (GET_MODE_BITSIZE (<MODE>mode)-1)) && (INTVAL (operands[3]) & (GET_MODE_BITSIZE (<MODE>mode)-1))
== GET_MODE_BITSIZE (<MODE>mode)-1" == GET_MODE_BITSIZE (<MODE>mode)-1
{ && can_create_pseudo_p ()"
return "<rotate>{<imodesuffix>}\t{%b2, %0|%0, %b2}"; "#"
} "&& 1"
[(set_attr "type" "rotate") [(parallel
(set_attr "mode" "<MODE>")]) [(set (match_dup 0)
(any_rotate:SWI48 (match_dup 1)
(match_dup 2)))
(clobber (reg:CC FLAGS_REG))])]
"operands[2] = gen_lowpart (QImode, operands[2]);")
;; Implement rotation using two double-precision ;; Implement rotation using two double-precision
;; shift instructions and a scratch register. ;; shift instructions and a scratch register.
......
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