Patchwork [i386,2/8,AVX512] Add mask registers.

login
register
mail settings
Submitter Kirill Yukhin
Date Sept. 10, 2013, 12:57 p.m.
Message ID <20130910125751.GB42257@msticlxl57.ims.intel.com>
Download mbox | patch
Permalink /patch/273856/
State New
Headers show

Comments

Kirill Yukhin - Sept. 10, 2013, 12:57 p.m.
Hello Richard,
Thanks for inputs.
On 09 Sep 10:39, Richard Henderson wrote:

> gen_andhi_1 is not used, nor is it likely to be in the future, therefore this
> should still have "*".
We're using it in patch 6/8 when introducing plugins:

+  { OPTION_MASK_ISA_AVX512F, CODE_FOR_andhi_1, "__builtin_ia32_kandhi", IX86_BUILTIN_KAND16, UNKNOWN, (int) HI_FTYPE_HI_HI },

And covered by tests in patch 8/8:

new file mode 100644
index 0000000..3d777c8

> 
> > +(define_insn "<code>hi_1"
> > +  [(set (match_operand:HI 0 "nonimmediate_operand" "=r,rm,!Yk")
> > +	(any_or:HI
> > +	 (match_operand:HI 1 "nonimmediate_operand" "%0,0,Yk")
> > +	 (match_operand:HI 2 "general_operand" "<g>,r<i>,Yk")))
> > +   (clobber (reg:CC FLAGS_REG))]
> 
> Likewise.
Same as above.

Do you still think we need "*"?

--
Thanks, K
Richard Henderson - Sept. 10, 2013, 4:17 p.m.
On 09/10/2013 05:57 AM, Kirill Yukhin wrote:
> Do you still think we need "*"?

No, I suppose that's fine.


r~
Richard Henderson - Sept. 10, 2013, 4:17 p.m.
On 09/10/2013 05:57 AM, Kirill Yukhin wrote:
> +  { OPTION_MASK_ISA_AVX512F, CODE_FOR_andhi_1, "__builtin_ia32_kandhi", IX86_BUILTIN_KAND16, UNKNOWN, (int) HI_FTYPE_HI_HI },

Alternately, why not use the standard CODE_FOR_andhi3 expander?


r~

Patch

--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512f-kandnw-1.c
@@ -0,0 +1,18 @@ 
+/* { dg-do compile } */
+/* { dg-options "-mavx512f -O2" } */
+/* { dg-final { scan-assembler-times "kandnw\[ \\t\]+\[^\n\]*%k\[1-7\]" 1 } } */
+
+#include <immintrin.h>
+
+void
+avx512f_test ()
+{
+  __mmask16 k1, k2, k3;
+  volatile __m512 x;
+
+  __asm__( "kmovw %1, %0" : "=k" (k1) : "r" (1) );
+  __asm__( "kmovw %1, %0" : "=k" (k2) : "r" (2) );
+
+  k3 = _mm512_kandn (k1, k2);
+  x = _mm512_mask_add_ps (x, k3, x, x);
+}