diff options
author | Alexander Ivchenko <alexander.ivchenko@intel.com> | 2014-09-25 08:18:14 +0000 |
---|---|---|
committer | Kirill Yukhin <kyukhin@gcc.gnu.org> | 2014-09-25 08:18:14 +0000 |
commit | 1bdf255a6b52e5927c40732a6776acc78efb0a57 (patch) | |
tree | 32844e763b861179b757f661eefa64a44d089da4 /gcc | |
parent | 42815c486a2ba14e1c71b387a75bb2fc0121a0ce (diff) | |
download | gcc-1bdf255a6b52e5927c40732a6776acc78efb0a57.zip gcc-1bdf255a6b52e5927c40732a6776acc78efb0a57.tar.gz gcc-1bdf255a6b52e5927c40732a6776acc78efb0a57.tar.bz2 |
AVX-512. Add convert ps2pd and ps2dq.
gcc/
* config/i386/sse.md
(define_insn
"<fixsuffix>fix_trunc<mode><sselongvecmodelower>2<mask_name><round_saeonly_name>"):
New.
(define_insn "<fixsuffix>fix_truncv2sfv2di2<mask_name>"): Ditto.
(define_insn "ufix_trunc<mode><sseintvecmodelower>2<mask_name>"): Ditto.
(define_insn "sse2_cvtss2sd<round_saeonly_name>"): Change
"nonimmediate_operand" to "<round_saeonly_nimm_predicate>".
(define_insn "avx_cvtpd2ps256<mask_name>"): Add masking.
(define_expand "sse2_cvtpd2ps_mask): New.
(define_insn "*sse2_cvtpd2ps<mask_name>"): Add masking.
(define_insn "sse2_cvtps2pd<mask_name>"): Add masking.
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: r215586
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 22 | ||||
-rw-r--r-- | gcc/config/i386/sse.md | 78 |
2 files changed, 83 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e7a932f..68090de 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -7,6 +7,28 @@ Kirill Yukhin <kirill.yukhin@intel.com> Michael Zolotukhin <michael.v.zolotukhin@intel.com> + * config/i386/sse.md + (define_insn + "<fixsuffix>fix_trunc<mode><sselongvecmodelower>2<mask_name><round_saeonly_name>"): + New. + (define_insn "<fixsuffix>fix_truncv2sfv2di2<mask_name>"): Ditto. + (define_insn "ufix_trunc<mode><sseintvecmodelower>2<mask_name>"): Ditto. + (define_insn "sse2_cvtss2sd<round_saeonly_name>"): Change + "nonimmediate_operand" to "<round_saeonly_nimm_predicate>". + (define_insn "avx_cvtpd2ps256<mask_name>"): Add masking. + (define_expand "sse2_cvtpd2ps_mask): New. + (define_insn "*sse2_cvtpd2ps<mask_name>"): Add masking. + (define_insn "sse2_cvtps2pd<mask_name>"): Add masking. + +2014-09-25 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/i386.c (avx512f_ufix_notruncv8dfv8si_mask_round): Rename to ... (ufix_notruncv8dfv8si2_mask_round): ... this. diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index b2e1d4f..ac7b51b 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -4659,6 +4659,38 @@ (set_attr "prefix" "evex") (set_attr "mode" "<sseintvecmode2>")]) +(define_insn "<fixsuffix>fix_trunc<mode><sselongvecmodelower>2<mask_name><round_saeonly_name>" + [(set (match_operand:<sselongvecmode> 0 "register_operand" "=v") + (any_fix:<sselongvecmode> + (match_operand:VF1_128_256VL 1 "<round_saeonly_nimm_predicate>" "<round_saeonly_constraint>")))] + "TARGET_AVX512DQ && <round_saeonly_modev8sf_condition>" + "vcvttps2<fixsuffix>qq\t{<round_saeonly_mask_op2>%1, %0<mask_operand2>|%0<mask_operand2>, %1<round_saeonly_mask_op2>}" + [(set_attr "type" "ssecvt") + (set_attr "prefix" "evex") + (set_attr "mode" "<sseintvecmode3>")]) + +(define_insn "<fixsuffix>fix_truncv2sfv2di2<mask_name>" + [(set (match_operand:V2DI 0 "register_operand" "=v") + (any_fix:V2DI + (vec_select:V2SF + (match_operand:V4SF 1 "nonimmediate_operand" "vm") + (parallel [(const_int 0) (const_int 1)]))))] + "TARGET_AVX512DQ && TARGET_AVX512VL" + "vcvttps2<fixsuffix>qq\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}" + [(set_attr "type" "ssecvt") + (set_attr "prefix" "evex") + (set_attr "mode" "TI")]) + +(define_insn "ufix_trunc<mode><sseintvecmodelower>2<mask_name>" + [(set (match_operand:<sseintvecmode> 0 "register_operand" "=v") + (unsigned_fix:<sseintvecmode> + (match_operand:VF1_128_256VL 1 "nonimmediate_operand" "vm")))] + "TARGET_AVX512VL" + "vcvttps2udq\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}" + [(set_attr "type" "ssecvt") + (set_attr "prefix" "evex") + (set_attr "mode" "<sseintvecmode2>")]) + (define_expand "avx_cvttpd2dq256_2" [(set (match_operand:V8SI 0 "register_operand") (vec_concat:V8SI @@ -4713,7 +4745,7 @@ (vec_merge:V2DF (float_extend:V2DF (vec_select:V2SF - (match_operand:V4SF 2 "nonimmediate_operand" "x,m,<round_saeonly_constraint>") + (match_operand:V4SF 2 "<round_saeonly_nimm_predicate>" "x,m,<round_saeonly_constraint>") (parallel [(const_int 0) (const_int 1)]))) (match_operand:V2DF 1 "register_operand" "0,0,v") (const_int 1)))] @@ -4741,14 +4773,14 @@ (set_attr "prefix" "evex") (set_attr "mode" "V8SF")]) -(define_insn "avx_cvtpd2ps256" - [(set (match_operand:V4SF 0 "register_operand" "=x") +(define_insn "avx_cvtpd2ps256<mask_name>" + [(set (match_operand:V4SF 0 "register_operand" "=v") (float_truncate:V4SF - (match_operand:V4DF 1 "nonimmediate_operand" "xm")))] - "TARGET_AVX" - "vcvtpd2ps{y}\t{%1, %0|%0, %1}" + (match_operand:V4DF 1 "nonimmediate_operand" "vm")))] + "TARGET_AVX && <mask_avx512vl_condition>" + "vcvtpd2ps{y}\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}" [(set_attr "type" "ssecvt") - (set_attr "prefix" "vex") + (set_attr "prefix" "maybe_evex") (set_attr "btver2_decode" "vector") (set_attr "mode" "V4SF")]) @@ -4761,16 +4793,28 @@ "TARGET_SSE2" "operands[2] = CONST0_RTX (V2SFmode);") -(define_insn "*sse2_cvtpd2ps" - [(set (match_operand:V4SF 0 "register_operand" "=x") +(define_expand "sse2_cvtpd2ps_mask" + [(set (match_operand:V4SF 0 "register_operand") + (vec_merge:V4SF + (vec_concat:V4SF + (float_truncate:V2SF + (match_operand:V2DF 1 "nonimmediate_operand")) + (match_dup 4)) + (match_operand:V4SF 2 "register_operand") + (match_operand:QI 3 "register_operand")))] + "TARGET_SSE2" + "operands[4] = CONST0_RTX (V2SFmode);") + +(define_insn "*sse2_cvtpd2ps<mask_name>" + [(set (match_operand:V4SF 0 "register_operand" "=v") (vec_concat:V4SF (float_truncate:V2SF - (match_operand:V2DF 1 "nonimmediate_operand" "xm")) + (match_operand:V2DF 1 "nonimmediate_operand" "vm")) (match_operand:V2SF 2 "const0_operand")))] - "TARGET_SSE2" + "TARGET_SSE2 && <mask_avx512vl_condition>" { if (TARGET_AVX) - return "vcvtpd2ps{x}\t{%1, %0|%0, %1}"; + return "vcvtpd2ps{x}\t{%1, %0<mask_operand3>|%0<mask_operand3>, %1}"; else return "cvtpd2ps\t{%1, %0|%0, %1}"; } @@ -4824,14 +4868,14 @@ (set_attr "prefix" "evex") (set_attr "mode" "V8DF")]) -(define_insn "sse2_cvtps2pd" - [(set (match_operand:V2DF 0 "register_operand" "=x") +(define_insn "sse2_cvtps2pd<mask_name>" + [(set (match_operand:V2DF 0 "register_operand" "=v") (float_extend:V2DF (vec_select:V2SF - (match_operand:V4SF 1 "nonimmediate_operand" "xm") + (match_operand:V4SF 1 "nonimmediate_operand" "vm") (parallel [(const_int 0) (const_int 1)]))))] - "TARGET_SSE2" - "%vcvtps2pd\t{%1, %0|%0, %q1}" + "TARGET_SSE2 && <mask_avx512vl_condition>" + "%vcvtps2pd\t{%1, %0<mask_operand2>|%0<mask_operand2>, %q1}" [(set_attr "type" "ssecvt") (set_attr "amdfam10_decode" "direct") (set_attr "athlon_decode" "double") |