r219319 - [AVX512] Added VPCMPEQ intrinisics to headers.

Robert Khasanov rob.khasanov at gmail.com
Wed Oct 8 10:18:14 PDT 2014


Author: rkhasanov
Date: Wed Oct  8 12:18:13 2014
New Revision: 219319

URL: http://llvm.org/viewvc/llvm-project?rev=219319&view=rev
Log:
[AVX512] Added VPCMPEQ intrinisics to headers.
Added tests.

Patch by Maxim Blumenthal <maxim.blumenthal at intel.com>

Added:
    cfe/trunk/lib/Headers/avx512bwintrin.h
    cfe/trunk/lib/Headers/avx512vlbwintrin.h
    cfe/trunk/lib/Headers/avx512vlintrin.h
    cfe/trunk/test/CodeGen/avx512bw-builtins.c
    cfe/trunk/test/CodeGen/avx512vl-builtins.c
    cfe/trunk/test/CodeGen/avx512vlbw-builtins.c
Modified:
    cfe/trunk/include/clang/Basic/BuiltinsX86.def
    cfe/trunk/lib/Headers/avx512fintrin.h
    cfe/trunk/lib/Headers/immintrin.h
    cfe/trunk/test/CodeGen/avx512f-builtins.c
    cfe/trunk/test/Headers/x86intrin.c

Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=219319&r1=219318&r2=219319&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Wed Oct  8 12:18:13 2014
@@ -801,6 +801,18 @@ BUILTIN(__builtin_ia32_cvttps2udq512_mas
 BUILTIN(__builtin_ia32_cvttpd2dq512_mask, "V8iV8dV8iUcCi", "")
 BUILTIN(__builtin_ia32_cvttpd2udq512_mask, "V8iV8dV8iUcCi", "")
 BUILTIN(__builtin_ia32_cmpps512_mask, "UsV16fV16fCiUsi", "")
+BUILTIN(__builtin_ia32_pcmpeqb512_mask, "LLiV64cV64cLLi", "")
+BUILTIN(__builtin_ia32_pcmpeqd512_mask, "sV16iV16is", "")
+BUILTIN(__builtin_ia32_pcmpeqq512_mask, "cV8LLiV8LLic", "")
+BUILTIN(__builtin_ia32_pcmpeqw512_mask, "iV32sV32si", "")
+BUILTIN(__builtin_ia32_pcmpeqb256_mask, "iV32cV32ci", "")
+BUILTIN(__builtin_ia32_pcmpeqd256_mask, "cV8iV8ic", "")
+BUILTIN(__builtin_ia32_pcmpeqq256_mask, "cV4LLiV4LLic", "")
+BUILTIN(__builtin_ia32_pcmpeqw256_mask, "sV16sV16ss", "")
+BUILTIN(__builtin_ia32_pcmpeqb128_mask, "sV16cV16cs", "")
+BUILTIN(__builtin_ia32_pcmpeqd128_mask, "cV4iV4ic", "")
+BUILTIN(__builtin_ia32_pcmpeqq128_mask, "cV2LLiV2LLic", "")
+BUILTIN(__builtin_ia32_pcmpeqw128_mask, "cV8sV8sc", "")
 BUILTIN(__builtin_ia32_cmppd512_mask, "UcV8dV8dCiUci", "")
 BUILTIN(__builtin_ia32_rndscaleps_mask, "V16fV16fCiV16fUsCi", "")
 BUILTIN(__builtin_ia32_rndscalepd_mask, "V8dV8dCiV8dUcCi", "")

Added: cfe/trunk/lib/Headers/avx512bwintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512bwintrin.h?rev=219319&view=auto
==============================================================================
--- cfe/trunk/lib/Headers/avx512bwintrin.h (added)
+++ cfe/trunk/lib/Headers/avx512bwintrin.h Wed Oct  8 12:18:13 2014
@@ -0,0 +1,60 @@
+/*===------------- avx512bwintrin.h - AVX512BW intrinsics ------------------===
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+#ifndef __AVX512BWINTRIN_H
+#define __AVX512BWINTRIN_H
+
+typedef unsigned int __mmask32;
+typedef unsigned long long __mmask64;
+typedef char __v64qi __attribute__ ((vector_size (64)));
+typedef short __v32hi __attribute__ ((__vector_size__ (64)));
+
+
+/* Integer compare */
+
+static __inline__ __mmask64 __attribute__((__always_inline__, __nodebug__))
+_mm512_cmpeq_epi8_mask(__m512i __a, __m512i __b) {
+  return (__mmask64)__builtin_ia32_pcmpeqb512_mask((__v64qi)__a, (__v64qi)__b,
+                                                   (__mmask64)-1);
+}
+
+static __inline__ __mmask64 __attribute__((__always_inline__, __nodebug__))
+_mm512_mask_cmpeq_epi8_mask(__mmask64 __u, __m512i __a, __m512i __b) {
+  return (__mmask64)__builtin_ia32_pcmpeqb512_mask((__v64qi)__a, (__v64qi)__b,
+                                                   __u);
+}
+
+static __inline__ __mmask32 __attribute__((__always_inline__, __nodebug__))
+_mm512_cmpeq_epi16_mask(__m512i __a, __m512i __b) {
+  return (__mmask32)__builtin_ia32_pcmpeqw512_mask((__v32hi)__a, (__v32hi)__b,
+                                                   (__mmask32)-1);
+}
+
+static __inline__ __mmask32 __attribute__((__always_inline__, __nodebug__))
+_mm512_mask_cmpeq_epi16_mask(__mmask32 __u, __m512i __a, __m512i __b) {
+  return (__mmask32)__builtin_ia32_pcmpeqw512_mask((__v32hi)__a, (__v32hi)__b,
+                                                   __u);
+}
+
+#endif

Modified: cfe/trunk/lib/Headers/avx512fintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512fintrin.h?rev=219319&r1=219318&r2=219319&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512fintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512fintrin.h Wed Oct  8 12:18:13 2014
@@ -974,4 +974,30 @@ _mm512_knot(__mmask16 __M)
   return __builtin_ia32_knothi(__M);
 }
 
+/* Integer compare */
+
+static __inline__ __mmask16 __attribute__((__always_inline__, __nodebug__))
+_mm512_cmpeq_epi32_mask(__m512i __a, __m512i __b) {
+  return (__mmask16)__builtin_ia32_pcmpeqd512_mask((__v16si)__a, (__v16si)__b,
+                                                   (__mmask16)-1);
+}
+
+static __inline__ __mmask16 __attribute__((__always_inline__, __nodebug__))
+_mm512_mask_cmpeq_epi32_mask(__mmask16 __u, __m512i __a, __m512i __b) {
+  return (__mmask16)__builtin_ia32_pcmpeqd512_mask((__v16si)__a, (__v16si)__b,
+                                                   __u);
+}
+
+static __inline__ __mmask8 __attribute__((__always_inline__, __nodebug__))
+_mm512_mask_cmpeq_epi64_mask(__mmask8 __u, __m512i __a, __m512i __b) {
+  return (__mmask8)__builtin_ia32_pcmpeqq512_mask((__v8di)__a, (__v8di)__b,
+                                                  __u);
+}
+
+static __inline__ __mmask8 __attribute__((__always_inline__, __nodebug__))
+_mm512_cmpeq_epi64_mask(__m512i __a, __m512i __b) {
+  return (__mmask8)__builtin_ia32_pcmpeqq512_mask((__v8di)__a, (__v8di)__b,
+                                                  (__mmask8)-1);
+}
+
 #endif // __AVX512FINTRIN_H

Added: cfe/trunk/lib/Headers/avx512vlbwintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512vlbwintrin.h?rev=219319&view=auto
==============================================================================
--- cfe/trunk/lib/Headers/avx512vlbwintrin.h (added)
+++ cfe/trunk/lib/Headers/avx512vlbwintrin.h Wed Oct  8 12:18:13 2014
@@ -0,0 +1,83 @@
+/*===---- avx512vlbwintrin.h - AVX512VL and AVX512BW intrinsics ----------===
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+#ifndef __IMMINTRIN_H
+#error "Never use <avx512vlbwintrin.h> directly; include <immintrin.h> instead."
+#endif
+
+#ifndef __AVX512VLBWINTRIN_H
+#define __AVX512VLBWINTRIN_H
+
+/* Integer compare */
+
+static __inline__ __mmask16 __attribute__((__always_inline__, __nodebug__))
+_mm_cmpeq_epi8_mask(__m128i __a, __m128i __b) {
+  return (__mmask16)__builtin_ia32_pcmpeqb128_mask((__v16qi)__a, (__v16qi)__b,
+                                                   (__mmask16)-1);
+}
+
+static __inline__ __mmask16 __attribute__((__always_inline__, __nodebug__))
+_mm_mask_cmpeq_epi8_mask(__mmask16 __u, __m128i __a, __m128i __b) {
+  return (__mmask16)__builtin_ia32_pcmpeqb128_mask((__v16qi)__a, (__v16qi)__b,
+                                                   __u);
+}
+
+
+static __inline__ __mmask32 __attribute__((__always_inline__, __nodebug__))
+_mm256_cmpeq_epi8_mask(__m256i __a, __m256i __b) {
+  return (__mmask32)__builtin_ia32_pcmpeqb256_mask((__v32qi)__a, (__v32qi)__b,
+                                                   (__mmask32)-1);
+}
+
+static __inline__ __mmask32 __attribute__((__always_inline__, __nodebug__))
+_mm256_mask_cmpeq_epi8_mask(__mmask32 __u, __m256i __a, __m256i __b) {
+  return (__mmask32)__builtin_ia32_pcmpeqb256_mask((__v32qi)__a, (__v32qi)__b,
+                                                   __u);
+}
+
+static __inline__ __mmask8 __attribute__((__always_inline__, __nodebug__))
+_mm_cmpeq_epi16_mask(__m128i __a, __m128i __b) {
+  return (__mmask8)__builtin_ia32_pcmpeqw128_mask((__v8hi)__a, (__v8hi)__b,
+                                                  (__mmask8)-1);
+}
+
+static __inline__ __mmask8 __attribute__((__always_inline__, __nodebug__))
+_mm_mask_cmpeq_epi16_mask(__mmask8 __u, __m128i __a, __m128i __b) {
+  return (__mmask8)__builtin_ia32_pcmpeqw128_mask((__v8hi)__a, (__v8hi)__b,
+                                                  __u);
+}
+
+
+static __inline__ __mmask16 __attribute__((__always_inline__, __nodebug__))
+_mm256_cmpeq_epi16_mask(__m256i __a, __m256i __b) {
+  return (__mmask16)__builtin_ia32_pcmpeqw256_mask((__v16hi)__a, (__v16hi)__b,
+                                                   (__mmask16)-1);
+}
+
+static __inline__ __mmask16 __attribute__((__always_inline__, __nodebug__))
+_mm256_mask_cmpeq_epi16_mask(__mmask16 __u, __m256i __a, __m256i __b) {
+  return (__mmask16)__builtin_ia32_pcmpeqw256_mask((__v16hi)__a, (__v16hi)__b,
+                                                   __u);
+}
+
+#endif /* __AVX512VLBWINTRIN_H */

Added: cfe/trunk/lib/Headers/avx512vlintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512vlintrin.h?rev=219319&view=auto
==============================================================================
--- cfe/trunk/lib/Headers/avx512vlintrin.h (added)
+++ cfe/trunk/lib/Headers/avx512vlintrin.h Wed Oct  8 12:18:13 2014
@@ -0,0 +1,83 @@
+/*===---- avx512vlintrin.h - AVX512VL intrinsics ---------------------------===
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+#ifndef __IMMINTRIN_H
+#error "Never use <avx512vlintrin.h> directly; include <immintrin.h> instead."
+#endif
+
+#ifndef __AVX512VLINTRIN_H
+#define __AVX512VLINTRIN_H
+
+/* Integer compare */
+
+static __inline__ __mmask8 __attribute__((__always_inline__, __nodebug__))
+_mm_cmpeq_epi32_mask(__m128i __a, __m128i __b) {
+  return (__mmask8)__builtin_ia32_pcmpeqd128_mask((__v4si)__a, (__v4si)__b,
+                                                  (__mmask8)-1);
+}
+
+static __inline__ __mmask8 __attribute__((__always_inline__, __nodebug__))
+_mm_mask_cmpeq_epi32_mask(__mmask8 __u, __m128i __a, __m128i __b) {
+  return (__mmask8)__builtin_ia32_pcmpeqd128_mask((__v4si)__a, (__v4si)__b,
+                                                  __u);
+}
+
+
+static __inline__ __mmask8 __attribute__((__always_inline__, __nodebug__))
+_mm256_cmpeq_epi32_mask(__m256i __a, __m256i __b) {
+  return (__mmask8)__builtin_ia32_pcmpeqd256_mask((__v8si)__a, (__v8si)__b,
+                                                  (__mmask8)-1);
+}
+
+static __inline__ __mmask8 __attribute__((__always_inline__, __nodebug__))
+_mm256_mask_cmpeq_epi32_mask(__mmask8 __u, __m256i __a, __m256i __b) {
+  return (__mmask8)__builtin_ia32_pcmpeqd256_mask((__v8si)__a, (__v8si)__b,
+                                                  __u);
+}
+
+static __inline__ __mmask8 __attribute__((__always_inline__, __nodebug__))
+_mm_cmpeq_epi64_mask(__m128i __a, __m128i __b) {
+  return (__mmask8)__builtin_ia32_pcmpeqq128_mask((__v2di)__a, (__v2di)__b,
+                                                  (__mmask8)-1);
+}
+
+static __inline__ __mmask8 __attribute__((__always_inline__, __nodebug__))
+_mm_mask_cmpeq_epi64_mask(__mmask8 __u, __m128i __a, __m128i __b) {
+  return (__mmask8)__builtin_ia32_pcmpeqq128_mask((__v2di)__a, (__v2di)__b,
+                                                  __u);
+}
+
+
+static __inline__ __mmask8 __attribute__((__always_inline__, __nodebug__))
+_mm256_cmpeq_epi64_mask(__m256i __a, __m256i __b) {
+  return (__mmask8)__builtin_ia32_pcmpeqq256_mask((__v4di)__a, (__v4di)__b,
+                                                  (__mmask8)-1);
+}
+
+static __inline__ __mmask8 __attribute__((__always_inline__, __nodebug__))
+_mm256_mask_cmpeq_epi64_mask(__mmask8 __u, __m256i __a, __m256i __b) {
+  return (__mmask8)__builtin_ia32_pcmpeqq256_mask((__v4di)__a, (__v4di)__b,
+                                                  __u);
+}
+
+#endif /* __AVX512VLINTRIN_H */

Modified: cfe/trunk/lib/Headers/immintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/immintrin.h?rev=219319&r1=219318&r2=219319&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/immintrin.h (original)
+++ cfe/trunk/lib/Headers/immintrin.h Wed Oct  8 12:18:13 2014
@@ -80,6 +80,18 @@
 #include <avx512fintrin.h>
 #endif
 
+#ifdef __AVX512VL__
+#include <avx512vlintrin.h>
+#endif
+
+#ifdef __AVX512BW__
+#include <avx512bwintrin.h>
+#endif
+
+#if defined (__AVX512VL__) && defined (__AVX512BW__)
+#include <avx512vlbwintrin.h>
+#endif
+
 #ifdef __AVX512ER__
 #include <avx512erintrin.h>
 #endif

Added: cfe/trunk/test/CodeGen/avx512bw-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512bw-builtins.c?rev=219319&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/avx512bw-builtins.c (added)
+++ cfe/trunk/test/CodeGen/avx512bw-builtins.c Wed Oct  8 12:18:13 2014
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 %s -O0 -triple=x86_64-apple-darwin -ffreestanding -target-feature +avx512bw -emit-llvm -o - -Werror | FileCheck %s
+
+#include <immintrin.h>
+
+__mmask64 test_mm512_cmpeq_epi8_mask(__m512i __a, __m512i __b) {
+  // CHECK-LABEL: @test_mm512_cmpeq_epi8_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.b.512
+  return (__mmask64)_mm512_cmpeq_epi8_mask(__a, __b);
+}
+
+__mmask64 test_mm512_mask_cmpeq_epi8_mask(__mmask64 __u, __m512i __a, __m512i __b) {
+  // CHECK-LABEL: @test_mm512_mask_cmpeq_epi8_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.b.512
+  return (__mmask64)_mm512_mask_cmpeq_epi8_mask(__u, __a, __b);
+}
+
+__mmask32 test_mm512_cmpeq_epi16_mask(__m512i __a, __m512i __b) {
+  // CHECK-LABEL: @test_mm512_cmpeq_epi16_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.w.512
+  return (__mmask32)_mm512_cmpeq_epi16_mask(__a, __b);
+}
+
+__mmask32 test_mm512_mask_cmpeq_epi16_mask(__mmask32 __u, __m512i __a, __m512i __b) {
+  // CHECK-LABEL: @test_mm512_mask_cmpeq_epi16_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.w.512
+  return (__mmask32)_mm512_mask_cmpeq_epi16_mask(__u, __a, __b);
+}

Modified: cfe/trunk/test/CodeGen/avx512f-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512f-builtins.c?rev=219319&r1=219318&r2=219319&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512f-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512f-builtins.c Wed Oct  8 12:18:13 2014
@@ -158,3 +158,27 @@ __m512i test_mm512_fmadd_pd(__m512d a, _
   // CHECK: @llvm.x86.fma.mask.vfmadd.pd.512
   return _mm512_fmadd_pd(a, b, c);
 }
+
+__mmask16 test_mm512_cmpeq_epi32_mask(__m512i __a, __m512i __b) {
+  // CHECK-LABEL: @test_mm512_cmpeq_epi32_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.d.512
+  return (__mmask16)_mm512_cmpeq_epi32_mask(__a, __b);
+}
+
+__mmask16 test_mm512_mask_cmpeq_epi32_mask(__mmask16 __u, __m512i __a, __m512i __b) {
+  // CHECK-LABEL: @test_mm512_mask_cmpeq_epi32_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.d.512
+  return (__mmask16)_mm512_mask_cmpeq_epi32_mask(__u, __a, __b);
+}
+
+__mmask8 test_mm512_mask_cmpeq_epi64_mask(__mmask8 __u, __m512i __a, __m512i __b) {
+  // CHECK-LABEL: @test_mm512_mask_cmpeq_epi64_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.q.512
+  return (__mmask8)_mm512_mask_cmpeq_epi64_mask(__u, __a, __b);
+}
+
+__mmask8 test_mm512_cmpeq_epi64_mask(__m512i __a, __m512i __b) {
+  // CHECK-LABEL: @test_mm512_cmpeq_epi64_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.q.512
+  return (__mmask8)_mm512_cmpeq_epi64_mask(__a, __b);
+}

Added: cfe/trunk/test/CodeGen/avx512vl-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512vl-builtins.c?rev=219319&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/avx512vl-builtins.c (added)
+++ cfe/trunk/test/CodeGen/avx512vl-builtins.c Wed Oct  8 12:18:13 2014
@@ -0,0 +1,51 @@
+// RUN: %clang_cc1 %s -O0 -triple=x86_64-apple-darwin -ffreestanding -target-feature +avx512f -target-feature +avx512vl -emit-llvm -o - -Werror | FileCheck %s
+
+#include <immintrin.h>
+
+__mmask8 test_mm256_cmpeq_epi32_mask(__m256i __a, __m256i __b) {
+  // CHECK-LABEL: @test_mm256_cmpeq_epi32_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.d.256
+  return (__mmask8)_mm256_cmpeq_epi32_mask(__a, __b);
+}
+
+__mmask8 test_mm256_mask_cmpeq_epi32_mask(__mmask8 __u, __m256i __a, __m256i __b) {
+  // CHECK-LABEL: @test_mm256_mask_cmpeq_epi32_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.d.256
+  return (__mmask8)_mm256_mask_cmpeq_epi32_mask(__u, __a, __b);
+}
+
+__mmask8 test_mm_cmpeq_epi32_mask(__m128i __a, __m128i __b) {
+  // CHECK-LABEL: @test_mm_cmpeq_epi32_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.d.128
+  return (__mmask8)_mm_cmpeq_epi32_mask(__a, __b);
+}
+
+__mmask8 test_mm_mask_cmpeq_epi32_mask(__mmask8 __u, __m128i __a, __m128i __b) {
+  // CHECK-LABEL: @test_mm_mask_cmpeq_epi32_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.d.128
+  return (__mmask8)_mm_mask_cmpeq_epi32_mask(__u, __a, __b);
+}
+
+__mmask8 test_mm256_cmpeq_epi64_mask(__m256i __a, __m256i __b) {
+  // CHECK-LABEL: @test_mm256_cmpeq_epi64_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.q.256
+  return (__mmask8)_mm256_cmpeq_epi64_mask(__a, __b);
+}
+
+__mmask8 test_mm256_mask_cmpeq_epi64_mask(__mmask8 __u, __m256i __a, __m256i __b) {
+  // CHECK-LABEL: @test_mm256_mask_cmpeq_epi64_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.q.256
+  return (__mmask8)_mm256_mask_cmpeq_epi64_mask(__u, __a, __b);
+}
+
+__mmask8 test_mm_cmpeq_epi64_mask(__m128i __a, __m128i __b) {
+  // CHECK-LABEL: @test_mm_cmpeq_epi64_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.q.128
+  return (__mmask8)_mm_cmpeq_epi64_mask(__a, __b);
+}
+
+__mmask8 test_mm_mask_cmpeq_epi64_mask(__mmask8 __u, __m128i __a, __m128i __b) {
+  // CHECK-LABEL: @test_mm_mask_cmpeq_epi64_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.q.128
+  return (__mmask8)_mm_mask_cmpeq_epi64_mask(__u, __a, __b);
+}

Added: cfe/trunk/test/CodeGen/avx512vlbw-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512vlbw-builtins.c?rev=219319&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/avx512vlbw-builtins.c (added)
+++ cfe/trunk/test/CodeGen/avx512vlbw-builtins.c Wed Oct  8 12:18:13 2014
@@ -0,0 +1,51 @@
+// RUN: %clang_cc1 %s -O0 -triple=x86_64-apple-darwin -ffreestanding -target-feature +avx512bw -target-feature +avx512vl -emit-llvm -o - -Werror | FileCheck %s
+
+#include <immintrin.h>
+
+__mmask32 test_mm256_cmpeq_epi8_mask(__m256i __a, __m256i __b) {
+  // CHECK-LABEL: @test_mm256_cmpeq_epi8_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.b.256
+  return (__mmask32)_mm256_cmpeq_epi8_mask(__a, __b);
+}
+
+__mmask32 test_mm256_mask_cmpeq_epi8_mask(__mmask32 __u, __m256i __a, __m256i __b) {
+  // CHECK-LABEL: @test_mm256_mask_cmpeq_epi8_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.b.256
+  return (__mmask32)_mm256_mask_cmpeq_epi8_mask(__u, __a, __b);
+}
+
+__mmask16 test_mm_cmpeq_epi8_mask(__m128i __a, __m128i __b) {
+  // CHECK-LABEL: @test_mm_cmpeq_epi8_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.b.128
+  return (__mmask16)_mm_cmpeq_epi8_mask(__a, __b);
+}
+
+__mmask16 test_mm_mask_cmpeq_epi8_mask(__mmask16 __u, __m128i __a, __m128i __b) {
+  // CHECK-LABEL: @test_mm_mask_cmpeq_epi8_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.b.128
+  return (__mmask16)_mm_mask_cmpeq_epi8_mask(__u, __a, __b);
+}
+
+__mmask16 test_mm256_cmpeq_epi16_mask(__m256i __a, __m256i __b) {
+  // CHECK-LABEL: @test_mm256_cmpeq_epi16_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.w.256
+  return (__mmask16)_mm256_cmpeq_epi16_mask(__a, __b);
+}
+
+__mmask16 test_mm256_mask_cmpeq_epi16_mask(__mmask16 __u, __m256i __a, __m256i __b) {
+  // CHECK-LABEL: @test_mm256_mask_cmpeq_epi16_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.w.256
+  return (__mmask16)_mm256_mask_cmpeq_epi16_mask(__u, __a, __b);
+}
+
+__mmask8 test_mm_cmpeq_epi16_mask(__m128i __a, __m128i __b) {
+  // CHECK-LABEL: @test_mm_cmpeq_epi16_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.w.128
+  return (__mmask8)_mm_cmpeq_epi16_mask(__a, __b);
+}
+
+__mmask8 test_mm_mask_cmpeq_epi16_mask(__mmask8 __u, __m128i __a, __m128i __b) {
+  // CHECK-LABEL: @test_mm_mask_cmpeq_epi16_mask
+  // CHECK: @llvm.x86.avx512.mask.pcmpeq.w.128
+  return (__mmask8)_mm_mask_cmpeq_epi16_mask(__u, __a, __b);
+}

Modified: cfe/trunk/test/Headers/x86intrin.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/x86intrin.c?rev=219319&r1=219318&r2=219319&view=diff
==============================================================================
--- cfe/trunk/test/Headers/x86intrin.c (original)
+++ cfe/trunk/test/Headers/x86intrin.c Wed Oct  8 12:18:13 2014
@@ -87,6 +87,12 @@
 #ifndef __AVX512F__
 #define __AVX512F__
 #endif
+#ifndef __AVX512VL__
+#define __AVX512VL__
+#endif
+#ifndef __AVX512BW__
+#define __AVX512BW__
+#endif
 #ifndef __AVX512ER__
 #define __AVX512ER__
 #endif





More information about the cfe-commits mailing list