Commit 51e14b05 by Alexander Ivchenko Committed by Kirill Yukhin

AVX-512. 57/n. Extend blend/cmp/brodcast insn patterns.

gcc/
	* config/i386/sse.md
	(define_insn "avx512f_blendm<mode>"): Delete.
	(define_insn "<avx512>_blendm<VI48_AVX512VL:mode>"): New.
	(define_insn "<avx512>_blendm<VI12_AVX512VL:mode>"): Ditto..
	(define_mode_attr cmp_imm_predicate): Add V8SF, V4DF, V8SI, V4DI, V4SF,
	V2DF, V4SI, V2DI, V32HI, V64QI, V16HI, V32QI, V8HI, V16QI modes.
	(define_insn
	"avx512f_cmp<mode>3<mask_scalar_merge_name><round_saeonly_name>"):
	Remove.
	(define_insn
	"<avx512>_cmp<VI48_AVX512VL:mode>3<mask_scalar_merge_name><round_saeonly_name>"):
	New.
	(define_insn
	"<avx512>_cmp<VI12_AVX512VL:mode>3<mask_scalar_merge_name><round_saeonly_name>"):
	Ditto.
	(define_insn "<mask_codefor>avx512f_vec_dup<mode><mask_name>"): Delete.
	(define_insn "<avx512>_vec_dup<V48_AVX512VL:mode><mask_name>"): New.
	(define_insn "<avx512>_vec_dup<V12_AVX512VL:mode><mask_name>"): Ditto.
	(define_insn "<mask_codefor>avx512f_vec_dup_gpr<mode><mask_name>"):
	Delete.
	(define_insn
	"<mask_codefor><avx512>_vec_dup_gpr<VI48_AVX512VL:mode><mask_name>"):
	New.
	(define_insn
	"<mask_codefor><avx512>_vec_dup_gpr<VI12_AVX512VL:mode><mask_name>"):
	Ditto.
	(define_insn·"<mask_codefor>avx512f_vec_dup_mem<mode><mask_name>"):
	Delete.
	(define_insn
	"<mask_codefor><avx512>_vec_dup_mem<VI48_AVX512VL:mode><mask_name>"):
	New.
	(define_insn
	"<mask_codefor><avx512>_vec_dup_mem<VI12_AVX512VL:mode><mask_name>"):
	Ditto.

Co-Authored-By: Andrey Turetskiy <andrey.turetskiy@intel.com>
Co-Authored-By: Anna Tikhonova <anna.tikhonova@intel.com>
Co-Authored-By: Ilya Tocar <ilya.tocar@intel.com>
Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com>
Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com>
Co-Authored-By: Maxim Kuznetsov <maxim.kuznetsov@intel.com>
Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com>

From-SVN: r216175
parent b6fed550
2014-10-14 Alexander Ivchenko <alexander.ivchenko@intel.com>
Maxim Kuznetsov <maxim.kuznetsov@intel.com>
Anna Tikhonova <anna.tikhonova@intel.com>
Ilya Tocar <ilya.tocar@intel.com>
Andrey Turetskiy <andrey.turetskiy@intel.com>
Ilya Verbin <ilya.verbin@intel.com>
Kirill Yukhin <kirill.yukhin@intel.com>
Michael Zolotukhin <michael.v.zolotukhin@intel.com>
* config/i386/sse.md
(define_insn "avx512f_blendm<mode>"): Delete.
(define_insn "<avx512>_blendm<VI48_AVX512VL:mode>"): New.
(define_insn "<avx512>_blendm<VI12_AVX512VL:mode>"): Ditto..
(define_mode_attr cmp_imm_predicate): Add V8SF, V4DF, V8SI, V4DI, V4SF,
V2DF, V4SI, V2DI, V32HI, V64QI, V16HI, V32QI, V8HI, V16QI modes.
(define_insn
"avx512f_cmp<mode>3<mask_scalar_merge_name><round_saeonly_name>"):
Remove.
(define_insn
"<avx512>_cmp<VI48_AVX512VL:mode>3<mask_scalar_merge_name><round_saeonly_name>"):
New.
(define_insn
"<avx512>_cmp<VI12_AVX512VL:mode>3<mask_scalar_merge_name><round_saeonly_name>"):
Ditto.
(define_insn "<mask_codefor>avx512f_vec_dup<mode><mask_name>"): Delete.
(define_insn "<avx512>_vec_dup<V48_AVX512VL:mode><mask_name>"): New.
(define_insn "<avx512>_vec_dup<V12_AVX512VL:mode><mask_name>"): Ditto.
(define_insn "<mask_codefor>avx512f_vec_dup_gpr<mode><mask_name>"):
Delete.
(define_insn
"<mask_codefor><avx512>_vec_dup_gpr<VI48_AVX512VL:mode><mask_name>"):
New.
(define_insn
"<mask_codefor><avx512>_vec_dup_gpr<VI12_AVX512VL:mode><mask_name>"):
Ditto.
(define_insn·"<mask_codefor>avx512f_vec_dup_mem<mode><mask_name>"):
Delete.
(define_insn
"<mask_codefor><avx512>_vec_dup_mem<VI48_AVX512VL:mode><mask_name>"):
New.
(define_insn
"<mask_codefor><avx512>_vec_dup_mem<VI12_AVX512VL:mode><mask_name>"):
Ditto.
2014-10-14 Richard Biener <rguenther@suse.de> 2014-10-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/63512 PR tree-optimization/63512
...@@ -959,14 +959,26 @@ ...@@ -959,14 +959,26 @@
(set_attr "memory" "none,load") (set_attr "memory" "none,load")
(set_attr "mode" "<sseinsnmode>")]) (set_attr "mode" "<sseinsnmode>")])
(define_insn "avx512f_blendm<mode>" (define_insn "<avx512>_blendm<mode>"
[(set (match_operand:VI48F_512 0 "register_operand" "=v") [(set (match_operand:V48_AVX512VL 0 "register_operand" "=v")
(vec_merge:VI48F_512 (vec_merge:V48_AVX512VL
(match_operand:VI48F_512 2 "nonimmediate_operand" "vm") (match_operand:V48_AVX512VL 2 "nonimmediate_operand" "vm")
(match_operand:VI48F_512 1 "register_operand" "v") (match_operand:V48_AVX512VL 1 "register_operand" "v")
(match_operand:<avx512fmaskmode> 3 "register_operand" "Yk")))] (match_operand:<avx512fmaskmode> 3 "register_operand" "Yk")))]
"TARGET_AVX512F" "TARGET_AVX512F"
"v<sseintprefix>blendm<ssemodesuffix>\t{%2, %1, %0%{%3%}|%0%{%3%}, %1, %2}" "vblendm<ssemodesuffix>\t{%2, %1, %0%{%3%}|%0%{%3%}, %1, %2}"
[(set_attr "type" "ssemov")
(set_attr "prefix" "evex")
(set_attr "mode" "<sseinsnmode>")])
(define_insn "<avx512>_blendm<mode>"
[(set (match_operand:VI12_AVX512VL 0 "register_operand" "=v")
(vec_merge:VI12_AVX512VL
(match_operand:VI12_AVX512VL 2 "nonimmediate_operand" "vm")
(match_operand:VI12_AVX512VL 1 "register_operand" "v")
(match_operand:<avx512fmaskmode> 3 "register_operand" "Yk")))]
"TARGET_AVX512BW"
"vpblendm<ssemodesuffix>\t{%2, %1, %0%{%3%}|%0%{%3%}, %1, %2}"
[(set_attr "type" "ssemov") [(set_attr "type" "ssemov")
(set_attr "prefix" "evex") (set_attr "prefix" "evex")
(set_attr "mode" "<sseinsnmode>")]) (set_attr "mode" "<sseinsnmode>")])
...@@ -2472,14 +2484,21 @@ ...@@ -2472,14 +2484,21 @@
(set_attr "mode" "<ssescalarmode>")]) (set_attr "mode" "<ssescalarmode>")])
(define_mode_attr cmp_imm_predicate (define_mode_attr cmp_imm_predicate
[(V16SF "const_0_to_31_operand") (V8DF "const_0_to_31_operand") [(V16SF "const_0_to_31_operand") (V8DF "const_0_to_31_operand")
(V16SI "const_0_to_7_operand") (V8DI "const_0_to_7_operand")]) (V16SI "const_0_to_7_operand") (V8DI "const_0_to_7_operand")
(V8SF "const_0_to_31_operand") (V4DF "const_0_to_31_operand")
(define_insn "avx512f_cmp<mode>3<mask_scalar_merge_name><round_saeonly_name>" (V8SI "const_0_to_7_operand") (V4DI "const_0_to_7_operand")
(V4SF "const_0_to_31_operand") (V2DF "const_0_to_31_operand")
(V4SI "const_0_to_7_operand") (V2DI "const_0_to_7_operand")
(V32HI "const_0_to_7_operand") (V64QI "const_0_to_7_operand")
(V16HI "const_0_to_7_operand") (V32QI "const_0_to_7_operand")
(V8HI "const_0_to_7_operand") (V16QI "const_0_to_7_operand")])
(define_insn "<avx512>_cmp<mode>3<mask_scalar_merge_name><round_saeonly_name>"
[(set (match_operand:<avx512fmaskmode> 0 "register_operand" "=Yk") [(set (match_operand:<avx512fmaskmode> 0 "register_operand" "=Yk")
(unspec:<avx512fmaskmode> (unspec:<avx512fmaskmode>
[(match_operand:VI48F_512 1 "register_operand" "v") [(match_operand:V48_AVX512VL 1 "register_operand" "v")
(match_operand:VI48F_512 2 "<round_saeonly_nimm_predicate>" "<round_saeonly_constraint>") (match_operand:V48_AVX512VL 2 "nonimmediate_operand" "<round_saeonly_constraint>")
(match_operand:SI 3 "<cmp_imm_predicate>" "n")] (match_operand:SI 3 "<cmp_imm_predicate>" "n")]
UNSPEC_PCMP))] UNSPEC_PCMP))]
"TARGET_AVX512F && <round_saeonly_mode512bit_condition>" "TARGET_AVX512F && <round_saeonly_mode512bit_condition>"
...@@ -2489,6 +2508,20 @@ ...@@ -2489,6 +2508,20 @@
(set_attr "prefix" "evex") (set_attr "prefix" "evex")
(set_attr "mode" "<sseinsnmode>")]) (set_attr "mode" "<sseinsnmode>")])
(define_insn "<avx512>_cmp<mode>3<mask_scalar_merge_name>"
[(set (match_operand:<avx512fmaskmode> 0 "register_operand" "=Yk")
(unspec:<avx512fmaskmode>
[(match_operand:VI12_AVX512VL 1 "register_operand" "v")
(match_operand:VI12_AVX512VL 2 "nonimmediate_operand" "vm")
(match_operand:SI 3 "<cmp_imm_predicate>" "n")]
UNSPEC_PCMP))]
"TARGET_AVX512BW"
"vpcmp<ssemodesuffix>\t{%3, %2, %1, %0<mask_scalar_merge_operand4>|%0<mask_scalar_merge_operand4>, %1, %2, %3}"
[(set_attr "type" "ssecmp")
(set_attr "length_immediate" "1")
(set_attr "prefix" "evex")
(set_attr "mode" "<sseinsnmode>")])
(define_insn "avx512f_ucmp<mode>3<mask_scalar_merge_name>" (define_insn "avx512f_ucmp<mode>3<mask_scalar_merge_name>"
[(set (match_operand:<avx512fmaskmode> 0 "register_operand" "=Yk") [(set (match_operand:<avx512fmaskmode> 0 "register_operand" "=Yk")
(unspec:<avx512fmaskmode> (unspec:<avx512fmaskmode>
...@@ -16016,13 +16049,13 @@ ...@@ -16016,13 +16049,13 @@
#" #"
[(set_attr "type" "ssemov") [(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1") (set_attr "prefix_extra" "1")
(set_attr "prefix" "vex") (set_attr "prefix" "maybe_evex")
(set_attr "isa" "*,avx2,noavx2") (set_attr "isa" "*,avx2,noavx2")
(set_attr "mode" "V8SF")]) (set_attr "mode" "V8SF")])
(define_insn "<mask_codefor>avx512f_vec_dup<mode><mask_name>" (define_insn "<avx512>_vec_dup<mode><mask_name>"
[(set (match_operand:VI48F_512 0 "register_operand" "=v") [(set (match_operand:V48_AVX512VL 0 "register_operand" "=v")
(vec_duplicate:VI48F_512 (vec_duplicate:V48_AVX512VL
(vec_select:<ssescalarmode> (vec_select:<ssescalarmode>
(match_operand:<ssexmmmode> 1 "nonimmediate_operand" "vm") (match_operand:<ssexmmmode> 1 "nonimmediate_operand" "vm")
(parallel [(const_int 0)]))))] (parallel [(const_int 0)]))))]
...@@ -16032,6 +16065,18 @@ ...@@ -16032,6 +16065,18 @@
(set_attr "prefix" "evex") (set_attr "prefix" "evex")
(set_attr "mode" "<sseinsnmode>")]) (set_attr "mode" "<sseinsnmode>")])
(define_insn "<avx512>_vec_dup<mode><mask_name>"
[(set (match_operand:VI12_AVX512VL 0 "register_operand" "=v")
(vec_duplicate:VI12_AVX512VL
(vec_select:<ssescalarmode>
(match_operand:<ssexmmmode> 1 "nonimmediate_operand" "vm")
(parallel [(const_int 0)]))))]
"TARGET_AVX512BW"
"vpbroadcast<bcstscalarsuff>\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix" "evex")
(set_attr "mode" "<sseinsnmode>")])
(define_insn "<mask_codefor>avx512f_broadcast<mode><mask_name>" (define_insn "<mask_codefor>avx512f_broadcast<mode><mask_name>"
[(set (match_operand:V16FI 0 "register_operand" "=v,v") [(set (match_operand:V16FI 0 "register_operand" "=v,v")
(vec_duplicate:V16FI (vec_duplicate:V16FI
...@@ -16056,19 +16101,31 @@ ...@@ -16056,19 +16101,31 @@
(set_attr "prefix" "evex") (set_attr "prefix" "evex")
(set_attr "mode" "<sseinsnmode>")]) (set_attr "mode" "<sseinsnmode>")])
(define_insn "<mask_codefor>avx512f_vec_dup_gpr<mode><mask_name>" (define_insn "<mask_codefor><avx512>_vec_dup_gpr<mode><mask_name>"
[(set (match_operand:VI48_512 0 "register_operand" "=v") [(set (match_operand:VI12_AVX512VL 0 "register_operand" "=v")
(vec_duplicate:VI48_512 (vec_duplicate:VI12_AVX512VL
(match_operand:<ssescalarmode> 1 "register_operand" "r")))] (match_operand:<ssescalarmode> 1 "register_operand" "r")))]
"TARGET_AVX512F && (<MODE>mode != V8DImode || TARGET_64BIT)" "TARGET_AVX512BW"
"vpbroadcast<bcstscalarsuff>\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}" "vpbroadcast<bcstscalarsuff>\t{%k1, %0<mask_operand2>|%0<mask_operand2>, %k1}"
[(set_attr "type" "ssemov")
(set_attr "prefix" "evex")
(set_attr "mode" "<sseinsnmode>")])
(define_insn "<mask_codefor><avx512>_vec_dup_gpr<mode><mask_name>"
[(set (match_operand:VI48_AVX512VL 0 "register_operand" "=v")
(vec_duplicate:VI48_AVX512VL
(match_operand:<ssescalarmode> 1 "register_operand" "r")))]
"TARGET_AVX512F && (<ssescalarmode>mode != DImode || TARGET_64BIT)"
{
return "vpbroadcast<bcstscalarsuff>\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}";
}
[(set_attr "type" "ssemov") [(set_attr "type" "ssemov")
(set_attr "prefix" "evex") (set_attr "prefix" "evex")
(set_attr "mode" "<sseinsnmode>")]) (set_attr "mode" "<sseinsnmode>")])
(define_insn "<mask_codefor>avx512f_vec_dup_mem<mode><mask_name>" (define_insn "<mask_codefor><avx512>_vec_dup_mem<mode><mask_name>"
[(set (match_operand:VI48F_512 0 "register_operand" "=v") [(set (match_operand:V48_AVX512VL 0 "register_operand" "=v")
(vec_duplicate:VI48F_512 (vec_duplicate:V48_AVX512VL
(match_operand:<ssescalarmode> 1 "nonimmediate_operand" "vm")))] (match_operand:<ssescalarmode> 1 "nonimmediate_operand" "vm")))]
"TARGET_AVX512F" "TARGET_AVX512F"
"v<sseintprefix>broadcast<bcstscalarsuff>\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}" "v<sseintprefix>broadcast<bcstscalarsuff>\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}"
...@@ -16076,6 +16133,16 @@ ...@@ -16076,6 +16133,16 @@
(set_attr "prefix" "evex") (set_attr "prefix" "evex")
(set_attr "mode" "<sseinsnmode>")]) (set_attr "mode" "<sseinsnmode>")])
(define_insn "<mask_codefor><avx512>_vec_dup_mem<mode><mask_name>"
[(set (match_operand:VI12_AVX512VL 0 "register_operand" "=v")
(vec_duplicate:VI12_AVX512VL
(match_operand:<ssescalarmode> 1 "nonimmediate_operand" "vm")))]
"TARGET_AVX512BW"
"vpbroadcast<bcstscalarsuff>\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix" "evex")
(set_attr "mode" "<sseinsnmode>")])
(define_insn "avx2_vbroadcasti128_<mode>" (define_insn "avx2_vbroadcasti128_<mode>"
[(set (match_operand:VI_256 0 "register_operand" "=x") [(set (match_operand:VI_256 0 "register_operand" "=x")
(vec_concat:VI_256 (vec_concat:VI_256
......
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