diff mbox

[i386,AVX512,78/n] Use blend for inserting.

Message ID 20141016062436.GA3755@msticlxl57.ims.intel.com
State New
Headers show

Commit Message

Kirill Yukhin Oct. 16, 2014, 6:24 a.m. UTC
Hello,
This patch extends insertion hook.

AVX-512* tests on top of patch-set all pass
under simulator.


gcc/
	* config/i386/i386.c
	(ix86_expand_vector_set): Handle V8DF, V8DI, V16SF, V16SI, V32HI, V64QI
	modes.

--
Thanks, K

Comments

Jakub Jelinek Oct. 16, 2014, 7:28 a.m. UTC | #1
On Thu, Oct 16, 2014 at 10:24:45AM +0400, Kirill Yukhin wrote:
> Hello,
> This patch extends insertion hook.
> 
> AVX-512* tests on top of patch-set all pass
> under simulator.
> 
> 
> gcc/
> 	* config/i386/i386.c
> 	(ix86_expand_vector_set): Handle V8DF, V8DI, V16SF, V16SI, V32HI, V64QI
> 	modes.

Just a ChangeLog comment style (seen in several entries you've committed
and several posted patches).  Please don't put a line break right after
the filename if the (functionname): part fits nicely on the same line, the
description can be wrapped anywhere as appropriate.
In this case,
	* config/i386/i386.c (ix86_expand_vector_set): Handle V8DF, V8DI,
	V16SF, V16SI, V32HI, V64QI modes.
is shorter and more readable.

Other than that, this particular patch LGTM (unless we'd want for the 4
mostly repetitious cases add a common handling spot, which would need the
gen fnpointer and kmode vars set before goto), but I'll leave it to Uros to
ack it.

	Jakub
Uros Bizjak Oct. 16, 2014, 11:20 a.m. UTC | #2
On Thu, Oct 16, 2014 at 9:28 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Thu, Oct 16, 2014 at 10:24:45AM +0400, Kirill Yukhin wrote:
>> Hello,
>> This patch extends insertion hook.
>>
>> AVX-512* tests on top of patch-set all pass
>> under simulator.
>>
>>
>> gcc/
>>       * config/i386/i386.c
>>       (ix86_expand_vector_set): Handle V8DF, V8DI, V16SF, V16SI, V32HI, V64QI
>>       modes.
>
> Just a ChangeLog comment style (seen in several entries you've committed
> and several posted patches).  Please don't put a line break right after
> the filename if the (functionname): part fits nicely on the same line, the
> description can be wrapped anywhere as appropriate.
> In this case,
>         * config/i386/i386.c (ix86_expand_vector_set): Handle V8DF, V8DI,
>         V16SF, V16SI, V32HI, V64QI modes.
> is shorter and more readable.
>
> Other than that, this particular patch LGTM (unless we'd want for the 4
> mostly repetitious cases add a common handling spot, which would need the
> gen fnpointer and kmode vars set before goto), but I'll leave it to Uros to
> ack it.

Let's leave this as it is for now.

OK.

Thanks,
Uros.
diff mbox

Patch

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index fcccdc3..b20eabf 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -40902,6 +40902,79 @@  half:
       emit_insn (gen_insert[j][i] (target, target, tmp));
       return;
 
+    case V8DFmode:
+      if (TARGET_AVX512F)
+	{
+	  tmp = gen_reg_rtx (mode);
+	  emit_insn (gen_rtx_SET (VOIDmode, tmp,
+				  gen_rtx_VEC_DUPLICATE (mode, val)));
+	  emit_insn (gen_avx512f_blendmv8df (target, tmp, target,
+					     force_reg (QImode, GEN_INT (1 << elt))));
+	  return;
+	}
+      else
+	break;
+    case V8DImode:
+      if (TARGET_AVX512F)
+	{
+	  tmp = gen_reg_rtx (mode);
+	  emit_insn (gen_rtx_SET (VOIDmode, tmp,
+				  gen_rtx_VEC_DUPLICATE (mode, val)));
+	  emit_insn (gen_avx512f_blendmv8di (target, tmp, target,
+					     force_reg (QImode, GEN_INT (1 << elt))));
+	  return;
+	}
+      else
+	break;
+    case V16SFmode:
+      if (TARGET_AVX512F)
+	{
+	  tmp = gen_reg_rtx (mode);
+	  emit_insn (gen_rtx_SET (VOIDmode, tmp,
+				  gen_rtx_VEC_DUPLICATE (mode, val)));
+	  emit_insn (gen_avx512f_blendmv16sf (target, tmp, target,
+					      force_reg (HImode, GEN_INT (1 << elt))));
+	  return;
+	}
+      else
+	break;
+    case V16SImode:
+      if (TARGET_AVX512F)
+	{
+	  tmp = gen_reg_rtx (mode);
+	  emit_insn (gen_rtx_SET (VOIDmode, tmp,
+				  gen_rtx_VEC_DUPLICATE (mode, val)));
+	  emit_insn (gen_avx512f_blendmv16si (target, tmp, target,
+					      force_reg (HImode, GEN_INT (1 << elt))));
+	  return;
+	}
+      else
+	break;
+    case V32HImode:
+      if (TARGET_AVX512F && TARGET_AVX512BW)
+	{
+	  tmp = gen_reg_rtx (mode);
+	  emit_insn (gen_rtx_SET (VOIDmode, tmp,
+				  gen_rtx_VEC_DUPLICATE (mode, val)));
+	  emit_insn (gen_avx512bw_blendmv32hi (target, tmp, target,
+					       force_reg (SImode, GEN_INT (1 << elt))));
+	  return;
+	}
+      else
+	break;
+    case V64QImode:
+      if (TARGET_AVX512F && TARGET_AVX512BW)
+	{
+	  tmp = gen_reg_rtx (mode);
+	  emit_insn (gen_rtx_SET (VOIDmode, tmp,
+				  gen_rtx_VEC_DUPLICATE (mode, val)));
+	  emit_insn (gen_avx512bw_blendmv64qi (target, tmp, target,
+					       force_reg (DImode, GEN_INT (1 << elt))));
+	  return;
+	}
+      else
+	break;
+
     default:
       break;
     }