Commit 2c726f94 by Uros Bizjak Committed by Uros Bizjak

mmx.md (vec_extractv2si_0): Add (r,x) alternative.

	* config/i386/mmx.md (vec_extractv2si_0): Add (r,x) alternative.
	(*vec_extractv2si_0_zext_sse4): New insn pattern.
	(*vec_extractv2si_0_zext): Ditto.
	(*vec_extractv2si_1): Add (rm,x) alternative.
	(*vec_extractv2si_1_zext): New insn pattern.
	(*vec_extractv2si_zext_mem): Add "TARGET_MMX || TARGET_MMX_WITH_SSE"
	insn constraint.

From-SVN: r273979
parent 51007dc1
2019-08-01 Uroš Bizjak <ubizjak@gmail.com>
* config/i386/mmx.md (vec_extractv2si_0): Add (r,x) alternative.
(*vec_extractv2si_0_zext_sse4): New insn pattern.
(*vec_extractv2si_0_zext): Ditto.
(*vec_extractv2si_1): Add (rm,x) alternative.
(*vec_extractv2si_1_zext): New insn pattern.
(*vec_extractv2si_zext_mem): Add "TARGET_MMX || TARGET_MMX_WITH_SSE"
insn constraint.
2019-08-01 Richard Biener <rguenther@suse.de> 2019-08-01 Richard Biener <rguenther@suse.de>
* domwalk.c (bb_postorder): Remove static variable. * domwalk.c (bb_postorder): Remove static variable.
......
...@@ -1620,9 +1620,9 @@ ...@@ -1620,9 +1620,9 @@
;; Avoid combining registers from different units in a single alternative, ;; Avoid combining registers from different units in a single alternative,
;; see comment above inline_secondary_memory_needed function in i386.c ;; see comment above inline_secondary_memory_needed function in i386.c
(define_insn_and_split "*vec_extractv2si_0" (define_insn_and_split "*vec_extractv2si_0"
[(set (match_operand:SI 0 "nonimmediate_operand" "=x,m,y, m,r") [(set (match_operand:SI 0 "nonimmediate_operand" "=x,m,y, m,r,r")
(vec_select:SI (vec_select:SI
(match_operand:V2SI 1 "nonimmediate_operand" "xm,x,ym,y,m") (match_operand:V2SI 1 "nonimmediate_operand" "xm,x,ym,y,m,x")
(parallel [(const_int 0)])))] (parallel [(const_int 0)])))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE) "(TARGET_MMX || TARGET_MMX_WITH_SSE)
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))" && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
...@@ -1630,33 +1630,76 @@ ...@@ -1630,33 +1630,76 @@
"&& reload_completed" "&& reload_completed"
[(set (match_dup 0) (match_dup 1))] [(set (match_dup 0) (match_dup 1))]
"operands[1] = gen_lowpart (SImode, operands[1]);" "operands[1] = gen_lowpart (SImode, operands[1]);"
[(set_attr "mmx_isa" "*,*,native,native,*")]) [(set_attr "isa" "*,*,*,*,*,sse2")
(set_attr "mmx_isa" "*,*,native,native,*,*")
(set (attr "preferred_for_speed")
(cond [(eq_attr "alternative" "5")
(symbol_ref "TARGET_INTER_UNIT_MOVES_FROM_VEC")
]
(symbol_ref "true")))])
(define_insn "*vec_extractv2si_0_zext_sse4"
[(set (match_operand:DI 0 "register_operand" "=r,x")
(zero_extend:DI
(vec_select:SI
(match_operand:V2SI 1 "register_operand" "x,x")
(parallel [(const_int 0)]))))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE) && TARGET_SSE4_1"
"#"
[(set_attr "isa" "x64,*")
(set (attr "preferred_for_speed")
(cond [(eq_attr "alternative" "0")
(symbol_ref "TARGET_INTER_UNIT_MOVES_FROM_VEC")
]
(symbol_ref "true")))])
(define_insn "*vec_extractv2si_0_zext"
[(set (match_operand:DI 0 "register_operand" "=r")
(zero_extend:DI
(vec_select:SI
(match_operand:V2SI 1 "register_operand" "x")
(parallel [(const_int 0)]))))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE)
&& TARGET_64BIT && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES_FROM_VEC"
"#")
(define_split
[(set (match_operand:DI 0 "register_operand")
(zero_extend:DI
(vec_select:SI
(match_operand:V2SI 1 "register_operand")
(parallel [(const_int 0)]))))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE)
&& TARGET_SSE2 && reload_completed"
[(set (match_dup 0) (zero_extend:DI (match_dup 1)))]
"operands[1] = gen_lowpart (SImode, operands[1]);")
;; Avoid combining registers from different units in a single alternative, ;; Avoid combining registers from different units in a single alternative,
;; see comment above inline_secondary_memory_needed function in i386.c ;; see comment above inline_secondary_memory_needed function in i386.c
(define_insn "*vec_extractv2si_1" (define_insn "*vec_extractv2si_1"
[(set (match_operand:SI 0 "nonimmediate_operand" "=y,x,x,y,x,r") [(set (match_operand:SI 0 "nonimmediate_operand" "=y,rm,x,x,y,x,r")
(vec_select:SI (vec_select:SI
(match_operand:V2SI 1 "nonimmediate_operand" " 0,x,x,o,o,o") (match_operand:V2SI 1 "nonimmediate_operand" " 0,x ,x,x,o,o,o")
(parallel [(const_int 1)])))] (parallel [(const_int 1)])))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE) "(TARGET_MMX || TARGET_MMX_WITH_SSE)
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))" && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"@ "@
punpckhdq\t%0, %0 punpckhdq\t%0, %0
%vpextrd\t{$1, %1, %0|%0, %1, 1}
%vpshufd\t{$0xe5, %1, %0|%0, %1, 0xe5} %vpshufd\t{$0xe5, %1, %0|%0, %1, 0xe5}
shufps\t{$0xe5, %1, %0|%0, %1, 0xe5} shufps\t{$0xe5, %1, %0|%0, %1, 0xe5}
# #
# #
#" #"
[(set_attr "isa" "*,sse2,noavx,*,*,*") [(set_attr "isa" "*,sse4,sse2,noavx,*,*,*")
(set_attr "mmx_isa" "native,*,*,native,*,*") (set_attr "mmx_isa" "native,*,*,*,native,*,*")
(set_attr "type" "mmxcvt,sseshuf1,sseshuf1,mmxmov,ssemov,imov") (set_attr "type" "mmxcvt,ssemov,sseshuf1,sseshuf1,mmxmov,ssemov,imov")
(set (attr "length_immediate") (set (attr "length_immediate")
(if_then_else (eq_attr "alternative" "1,2") (if_then_else (eq_attr "alternative" "1,2,3")
(const_string "1") (const_string "1")
(const_string "*"))) (const_string "*")))
(set_attr "prefix" "orig,maybe_vex,orig,orig,orig,orig") (set_attr "prefix" "orig,maybe_vex,maybe_vex,orig,orig,orig,orig")
(set_attr "mode" "DI,TI,V4SF,SI,SI,SI")]) (set_attr "mode" "DI,TI,TI,V4SF,SI,SI,SI")])
(define_split (define_split
[(set (match_operand:SI 0 "register_operand") [(set (match_operand:SI 0 "register_operand")
...@@ -1667,13 +1710,28 @@ ...@@ -1667,13 +1710,28 @@
[(set (match_dup 0) (match_dup 1))] [(set (match_dup 0) (match_dup 1))]
"operands[1] = adjust_address (operands[1], SImode, 4);") "operands[1] = adjust_address (operands[1], SImode, 4);")
(define_insn "*vec_extractv2si_1_zext"
[(set (match_operand:DI 0 "register_operand" "=r")
(zero_extend:DI
(vec_select:SI
(match_operand:V2SI 1 "register_operand" "x")
(parallel [(const_int 1)]))))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE)
&& TARGET_64BIT && TARGET_SSE4_1"
"%vpextrd\t{$1, %1, %k0|%k0, %1, 1}"
[(set_attr "type" "sselog1")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "1")
(set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn_and_split "*vec_extractv2si_zext_mem" (define_insn_and_split "*vec_extractv2si_zext_mem"
[(set (match_operand:DI 0 "register_operand" "=y,x,r") [(set (match_operand:DI 0 "register_operand" "=y,x,r")
(zero_extend:DI (zero_extend:DI
(vec_select:SI (vec_select:SI
(match_operand:V2SI 1 "memory_operand" "o,o,o") (match_operand:V2SI 1 "memory_operand" "o,o,o")
(parallel [(match_operand:SI 2 "const_0_to_1_operand")]))))] (parallel [(match_operand:SI 2 "const_0_to_1_operand")]))))]
"TARGET_64BIT" "(TARGET_MMX || TARGET_MMX_WITH_SSE) && TARGET_64BIT"
"#" "#"
"&& reload_completed" "&& reload_completed"
[(set (match_dup 0) (zero_extend:DI (match_dup 1)))] [(set (match_dup 0) (zero_extend:DI (match_dup 1)))]
......
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