Skip to content
Snippets Groups Projects
Commit 67e87233 authored by Richard Biener's avatar Richard Biener
Browse files

Merge vec_addsub patterns

This merges the vec_addsub<mode>3 patterns using a mode attribute
for the vec_merge merge operand.

2021-06-18  Richard Biener  <rguenther@suse.de>

	* config/i386/sse.md (vec_addsubv4df3, vec_addsubv2df3,
	vec_addsubv8sf3, vec_addsubv4sf3): Merge into ...
	(vec_addsub<mode>3): ... using a new addsub_cst mode attribute.
parent 7a6c31f0
No related branches found
No related tags found
No related merge requests found
...@@ -2410,69 +2410,36 @@ ...@@ -2410,69 +2410,36 @@
(set_attr "prefix" "<round_saeonly_scalar_prefix>") (set_attr "prefix" "<round_saeonly_scalar_prefix>")
(set_attr "mode" "<ssescalarmode>")]) (set_attr "mode" "<ssescalarmode>")])
   
(define_insn "vec_addsubv4df3" (define_mode_attr addsub_cst [(V4DF "5") (V2DF "1")
[(set (match_operand:V4DF 0 "register_operand" "=x") (V4SF "5") (V8SF "85")])
(vec_merge:V4DF
(minus:V4DF
(match_operand:V4DF 1 "register_operand" "x")
(match_operand:V4DF 2 "nonimmediate_operand" "xm"))
(plus:V4DF (match_dup 1) (match_dup 2))
(const_int 5)))]
"TARGET_AVX"
"vaddsubpd\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "sseadd")
(set_attr "prefix" "vex")
(set_attr "mode" "V4DF")])
(define_insn "vec_addsubv2df3"
[(set (match_operand:V2DF 0 "register_operand" "=x,x")
(vec_merge:V2DF
(minus:V2DF
(match_operand:V2DF 1 "register_operand" "0,x")
(match_operand:V2DF 2 "vector_operand" "xBm,xm"))
(plus:V2DF (match_dup 1) (match_dup 2))
(const_int 1)))]
"TARGET_SSE3"
"@
addsubpd\t{%2, %0|%0, %2}
vaddsubpd\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "isa" "noavx,avx")
(set_attr "type" "sseadd")
(set_attr "atom_unit" "complex")
(set_attr "prefix" "orig,vex")
(set_attr "mode" "V2DF")])
(define_insn "vec_addsubv8sf3"
[(set (match_operand:V8SF 0 "register_operand" "=x")
(vec_merge:V8SF
(minus:V8SF
(match_operand:V8SF 1 "register_operand" "x")
(match_operand:V8SF 2 "nonimmediate_operand" "xm"))
(plus:V8SF (match_dup 1) (match_dup 2))
(const_int 85)))]
"TARGET_AVX"
"vaddsubps\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "sseadd")
(set_attr "prefix" "vex")
(set_attr "mode" "V8SF")])
   
(define_insn "vec_addsubv4sf3" (define_insn "vec_addsub<mode>3"
[(set (match_operand:V4SF 0 "register_operand" "=x,x") [(set (match_operand:VF_128_256 0 "register_operand" "=x,x")
(vec_merge:V4SF (vec_merge:VF_128_256
(minus:V4SF (minus:VF_128_256
(match_operand:V4SF 1 "register_operand" "0,x") (match_operand:VF_128_256 1 "register_operand" "0,x")
(match_operand:V4SF 2 "vector_operand" "xBm,xm")) (match_operand:VF_128_256 2 "vector_operand" "xBm, xm"))
(plus:V4SF (match_dup 1) (match_dup 2)) (plus:VF_128_256 (match_dup 1) (match_dup 2))
(const_int 5)))] (const_int <addsub_cst>)))]
"TARGET_SSE3" "TARGET_SSE3"
"@ "@
addsubps\t{%2, %0|%0, %2} addsub<ssemodesuffix>\t{%2, %0|%0, %2}
vaddsubps\t{%2, %1, %0|%0, %1, %2}" vaddsub<ssemodesuffix>\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "isa" "noavx,avx") [(set_attr "isa" "noavx,avx")
(set_attr "type" "sseadd") (set_attr "type" "sseadd")
(set (attr "atom_unit")
(if_then_else
(match_test "<MODE>mode == V2DFmode")
(const_string "complex")
(const_string "*")))
(set_attr "prefix" "orig,vex") (set_attr "prefix" "orig,vex")
(set_attr "prefix_rep" "1,*") (set (attr "prefix_rep")
(set_attr "mode" "V4SF")]) (if_then_else
(and (match_test "<MODE>mode == V4SFmode")
(eq_attr "alternative" "0"))
(const_string "1")
(const_string "*")))
(set_attr "mode" "<MODE>")])
   
(define_split (define_split
[(set (match_operand:VF_128_256 0 "register_operand") [(set (match_operand:VF_128_256 0 "register_operand")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment