diff options
author | Alexander Ivchenko <alexander.ivchenko@intel.com> | 2014-10-14 08:10:42 +0000 |
---|---|---|
committer | Kirill Yukhin <kyukhin@gcc.gnu.org> | 2014-10-14 08:10:42 +0000 |
commit | 51e14b05727883f9416be01a46962082328c8309 (patch) | |
tree | b6b023f5e8acbbc4a1bf849da9c29fc4f95d59f2 | |
parent | b6fed550a33a4ea5005b52c0361f6386d9d70a65 (diff) | |
download | gcc-51e14b05727883f9416be01a46962082328c8309.zip gcc-51e14b05727883f9416be01a46962082328c8309.tar.gz gcc-51e14b05727883f9416be01a46962082328c8309.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 44 | ||||
-rw-r--r-- | gcc/config/i386/sse.md | 115 |
2 files changed, 135 insertions, 24 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c7aa8f6..0a4673c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,47 @@ +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> PR tree-optimization/63512 diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index e7646d77..d544ed0 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -959,14 +959,26 @@ (set_attr "memory" "none,load") (set_attr "mode" "<sseinsnmode>")]) -(define_insn "avx512f_blendm<mode>" - [(set (match_operand:VI48F_512 0 "register_operand" "=v") - (vec_merge:VI48F_512 - (match_operand:VI48F_512 2 "nonimmediate_operand" "vm") - (match_operand:VI48F_512 1 "register_operand" "v") +(define_insn "<avx512>_blendm<mode>" + [(set (match_operand:V48_AVX512VL 0 "register_operand" "=v") + (vec_merge:V48_AVX512VL + (match_operand:V48_AVX512VL 2 "nonimmediate_operand" "vm") + (match_operand:V48_AVX512VL 1 "register_operand" "v") (match_operand:<avx512fmaskmode> 3 "register_operand" "Yk")))] "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 "prefix" "evex") (set_attr "mode" "<sseinsnmode>")]) @@ -2472,14 +2484,21 @@ (set_attr "mode" "<ssescalarmode>")]) (define_mode_attr cmp_imm_predicate - [(V16SF "const_0_to_31_operand") (V8DF "const_0_to_31_operand") - (V16SI "const_0_to_7_operand") (V8DI "const_0_to_7_operand")]) - -(define_insn "avx512f_cmp<mode>3<mask_scalar_merge_name><round_saeonly_name>" + [(V16SF "const_0_to_31_operand") (V8DF "const_0_to_31_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") + (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") (unspec:<avx512fmaskmode> - [(match_operand:VI48F_512 1 "register_operand" "v") - (match_operand:VI48F_512 2 "<round_saeonly_nimm_predicate>" "<round_saeonly_constraint>") + [(match_operand:V48_AVX512VL 1 "register_operand" "v") + (match_operand:V48_AVX512VL 2 "nonimmediate_operand" "<round_saeonly_constraint>") (match_operand:SI 3 "<cmp_imm_predicate>" "n")] UNSPEC_PCMP))] "TARGET_AVX512F && <round_saeonly_mode512bit_condition>" @@ -2489,6 +2508,20 @@ (set_attr "prefix" "evex") (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>" [(set (match_operand:<avx512fmaskmode> 0 "register_operand" "=Yk") (unspec:<avx512fmaskmode> @@ -16016,13 +16049,13 @@ #" [(set_attr "type" "ssemov") (set_attr "prefix_extra" "1") - (set_attr "prefix" "vex") + (set_attr "prefix" "maybe_evex") (set_attr "isa" "*,avx2,noavx2") (set_attr "mode" "V8SF")]) -(define_insn "<mask_codefor>avx512f_vec_dup<mode><mask_name>" - [(set (match_operand:VI48F_512 0 "register_operand" "=v") - (vec_duplicate:VI48F_512 +(define_insn "<avx512>_vec_dup<mode><mask_name>" + [(set (match_operand:V48_AVX512VL 0 "register_operand" "=v") + (vec_duplicate:V48_AVX512VL (vec_select:<ssescalarmode> (match_operand:<ssexmmmode> 1 "nonimmediate_operand" "vm") (parallel [(const_int 0)]))))] @@ -16032,6 +16065,18 @@ (set_attr "prefix" "evex") (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>" [(set (match_operand:V16FI 0 "register_operand" "=v,v") (vec_duplicate:V16FI @@ -16056,19 +16101,31 @@ (set_attr "prefix" "evex") (set_attr "mode" "<sseinsnmode>")]) -(define_insn "<mask_codefor>avx512f_vec_dup_gpr<mode><mask_name>" - [(set (match_operand:VI48_512 0 "register_operand" "=v") - (vec_duplicate:VI48_512 +(define_insn "<mask_codefor><avx512>_vec_dup_gpr<mode><mask_name>" + [(set (match_operand:VI12_AVX512VL 0 "register_operand" "=v") + (vec_duplicate:VI12_AVX512VL (match_operand:<ssescalarmode> 1 "register_operand" "r")))] - "TARGET_AVX512F && (<MODE>mode != V8DImode || TARGET_64BIT)" - "vpbroadcast<bcstscalarsuff>\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}" + "TARGET_AVX512BW" + "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 "prefix" "evex") (set_attr "mode" "<sseinsnmode>")]) -(define_insn "<mask_codefor>avx512f_vec_dup_mem<mode><mask_name>" - [(set (match_operand:VI48F_512 0 "register_operand" "=v") - (vec_duplicate:VI48F_512 +(define_insn "<mask_codefor><avx512>_vec_dup_mem<mode><mask_name>" + [(set (match_operand:V48_AVX512VL 0 "register_operand" "=v") + (vec_duplicate:V48_AVX512VL (match_operand:<ssescalarmode> 1 "nonimmediate_operand" "vm")))] "TARGET_AVX512F" "v<sseintprefix>broadcast<bcstscalarsuff>\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}" @@ -16076,6 +16133,16 @@ (set_attr "prefix" "evex") (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>" [(set (match_operand:VI_256 0 "register_operand" "=x") (vec_concat:VI_256 |