r333387 - [X86] Merge the 3 different flavors of masked vpermi2var/vpermt2var builtins to a single version without masking. Use select builtins with appropriate operand instead.

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Mon May 28 20:26:38 PDT 2018


Author: ctopper
Date: Mon May 28 20:26:38 2018
New Revision: 333387

URL: http://llvm.org/viewvc/llvm-project?rev=333387&view=rev
Log:
[X86] Merge the 3 different flavors of masked vpermi2var/vpermt2var builtins to a single version without masking. Use select builtins with appropriate operand instead.

Modified:
    cfe/trunk/include/clang/Basic/BuiltinsX86.def
    cfe/trunk/lib/Headers/avx512bwintrin.h
    cfe/trunk/lib/Headers/avx512fintrin.h
    cfe/trunk/lib/Headers/avx512vbmiintrin.h
    cfe/trunk/lib/Headers/avx512vbmivlintrin.h
    cfe/trunk/lib/Headers/avx512vlbwintrin.h
    cfe/trunk/lib/Headers/avx512vlintrin.h
    cfe/trunk/test/CodeGen/avx512bw-builtins.c
    cfe/trunk/test/CodeGen/avx512f-builtins.c
    cfe/trunk/test/CodeGen/avx512vbmi-builtins.c
    cfe/trunk/test/CodeGen/avx512vbmivl-builtin.c
    cfe/trunk/test/CodeGen/avx512vl-builtins.c
    cfe/trunk/test/CodeGen/avx512vlbw-builtins.c

Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=333387&r1=333386&r2=333387&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Mon May 28 20:26:38 2018
@@ -969,10 +969,6 @@ TARGET_BUILTIN(__builtin_ia32_storeupd51
 TARGET_BUILTIN(__builtin_ia32_storeapd512_mask, "vV8d*V8dUc", "n", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_storeups512_mask, "vf*V16fUs", "n", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_storeaps512_mask, "vV16f*V16fUs", "n", "avx512f")
-TARGET_BUILTIN(__builtin_ia32_vpermt2vard512_mask, "V16iV16iV16iV16iUs", "nc", "avx512f")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "nc", "avx512f")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varps512_mask, "V16fV16iV16fV16fUs", "nc", "avx512f")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varpd512_mask, "V8dV8LLiV8dV8dUc", "nc", "avx512f")
 
 TARGET_BUILTIN(__builtin_ia32_vpdpbusd128_mask, "V4iV4iV4iV4iUc", "nc", "avx512vl,avx512vnni")
 TARGET_BUILTIN(__builtin_ia32_vpdpbusd256_mask, "V8iV8iV8iV8iUc", "nc", "avx512vl,avx512vnni")
@@ -1092,10 +1088,6 @@ TARGET_BUILTIN(__builtin_ia32_psubsw512_
 TARGET_BUILTIN(__builtin_ia32_psubusb512_mask, "V64cV64cV64cV64cULLi", "nc", "avx512bw")
 TARGET_BUILTIN(__builtin_ia32_psubusw512_mask, "V32sV32sV32sV32sUi", "nc", "avx512bw")
 
-TARGET_BUILTIN(__builtin_ia32_vpermi2varhi512_mask, "V32sV32sV32sV32sUi", "nc", "avx512bw")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varhi512_mask, "V32sV32sV32sV32sUi", "nc", "avx512bw")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varhi512_maskz, "V32sV32sV32sV32sUi", "nc", "avx512bw")
-
 TARGET_BUILTIN(__builtin_ia32_vpconflictdi_128_mask, "V2LLiV2LLiV2LLiUc", "nc", "avx512cd,avx512vl")
 TARGET_BUILTIN(__builtin_ia32_vpconflictdi_256_mask, "V4LLiV4LLiV4LLiUc", "nc", "avx512cd,avx512vl")
 TARGET_BUILTIN(__builtin_ia32_vpconflictsi_128_mask, "V4iV4iV4iUc", "nc", "avx512cd,avx512vl")
@@ -1123,13 +1115,6 @@ TARGET_BUILTIN(__builtin_ia32_vpshufbitq
 TARGET_BUILTIN(__builtin_ia32_vpshufbitqmb256_mask, "UiV32cV32cUi", "nc", "avx512vl,avx512bitalg")
 TARGET_BUILTIN(__builtin_ia32_vpshufbitqmb512_mask, "ULLiV64cV64cULLi", "nc", "avx512bitalg")
 
-TARGET_BUILTIN(__builtin_ia32_vpermi2varhi128_mask, "V8sV8sV8sV8sUc", "nc", "avx512vl,avx512bw")
-TARGET_BUILTIN(__builtin_ia32_vpermi2varhi256_mask, "V16sV16sV16sV16sUs", "nc", "avx512vl,avx512bw")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varhi128_mask, "V8sV8sV8sV8sUc", "nc", "avx512vl,avx512bw")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varhi128_maskz, "V8sV8sV8sV8sUc", "nc", "avx512vl,avx512bw")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varhi256_mask, "V16sV16sV16sV16sUs", "nc", "avx512vl,avx512bw")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varhi256_maskz, "V16sV16sV16sV16sUs", "nc", "avx512vl,avx512bw")
-
 TARGET_BUILTIN(__builtin_ia32_pmulhrsw512, "V32sV32sV32s", "nc", "avx512bw")
 TARGET_BUILTIN(__builtin_ia32_pmulhuw512, "V32sV32sV32s", "nc", "avx512bw")
 TARGET_BUILTIN(__builtin_ia32_pmulhw512, "V32sV32sV32s", "nc", "avx512bw")
@@ -1266,30 +1251,24 @@ TARGET_BUILTIN(__builtin_ia32_scattersiv
 TARGET_BUILTIN(__builtin_ia32_scattersiv8sf, "vf*UcV8iV8fIi", "n", "avx512vl")
 TARGET_BUILTIN(__builtin_ia32_scattersiv8si, "vi*UcV8iV8iIi", "n", "avx512vl")
 
-TARGET_BUILTIN(__builtin_ia32_vpermi2vard128_mask, "V4iV4iV4iV4iUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermi2vard256_mask, "V8iV8iV8iV8iUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermi2varpd128_mask, "V2dV2dV2LLiV2dUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermi2varpd256_mask, "V4dV4dV4LLiV4dUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermi2varps128_mask, "V4fV4fV4iV4fUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermi2varps256_mask, "V8fV8fV8iV8fUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermi2varq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermi2varq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2vard128_mask, "V4iV4iV4iV4iUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2vard128_maskz, "V4iV4iV4iV4iUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2vard256_mask, "V8iV8iV8iV8iUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2vard256_maskz, "V8iV8iV8iV8iUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varpd128_mask, "V2dV2LLiV2dV2dUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varpd128_maskz, "V2dV2LLiV2dV2dUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varpd256_mask, "V4dV4LLiV4dV4dUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varpd256_maskz, "V4dV4LLiV4dV4dUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varps128_mask, "V4fV4iV4fV4fUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varps128_maskz, "V4fV4iV4fV4fUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varps256_mask, "V8fV8iV8fV8fUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varps256_maskz, "V8fV8iV8fV8fUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varq128_maskz, "V2LLiV2LLiV2LLiV2LLiUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "nc", "avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varq256_maskz, "V4LLiV4LLiV4LLiV4LLiUc", "nc", "avx512vl")
+TARGET_BUILTIN(__builtin_ia32_vpermi2vard128, "V4iV4iV4iV4i", "nc", "avx512vl")
+TARGET_BUILTIN(__builtin_ia32_vpermi2vard256, "V8iV8iV8iV8i", "nc", "avx512vl")
+TARGET_BUILTIN(__builtin_ia32_vpermi2vard512, "V16iV16iV16iV16i", "nc", "avx512f")
+TARGET_BUILTIN(__builtin_ia32_vpermi2varpd128, "V2dV2dV2LLiV2d", "nc", "avx512vl")
+TARGET_BUILTIN(__builtin_ia32_vpermi2varpd256, "V4dV4dV4LLiV4d", "nc", "avx512vl")
+TARGET_BUILTIN(__builtin_ia32_vpermi2varpd512, "V8dV8dV8LLiV8d", "nc", "avx512f")
+TARGET_BUILTIN(__builtin_ia32_vpermi2varps128, "V4fV4fV4iV4f", "nc", "avx512vl")
+TARGET_BUILTIN(__builtin_ia32_vpermi2varps256, "V8fV8fV8iV8f", "nc", "avx512vl")
+TARGET_BUILTIN(__builtin_ia32_vpermi2varps512, "V16fV16fV16iV16f", "nc", "avx512f")
+TARGET_BUILTIN(__builtin_ia32_vpermi2varq128, "V2LLiV2LLiV2LLiV2LLi", "nc", "avx512vl")
+TARGET_BUILTIN(__builtin_ia32_vpermi2varq256, "V4LLiV4LLiV4LLiV4LLi", "nc", "avx512vl")
+TARGET_BUILTIN(__builtin_ia32_vpermi2varq512, "V8LLiV8LLiV8LLiV8LLi", "nc", "avx512f")
+TARGET_BUILTIN(__builtin_ia32_vpermi2varqi128, "V16cV16cV16cV16c", "nc", "avx512vbmi,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_vpermi2varqi256, "V32cV32cV32cV32c", "nc", "avx512vbmi,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_vpermi2varqi512, "V64cV64cV64cV64c", "nc", "avx512vbmi")
+TARGET_BUILTIN(__builtin_ia32_vpermi2varhi128, "V8sV8sV8sV8s", "nc", "avx512vl,avx512bw")
+TARGET_BUILTIN(__builtin_ia32_vpermi2varhi256, "V16sV16sV16sV16s", "nc", "avx512vl,avx512bw")
+TARGET_BUILTIN(__builtin_ia32_vpermi2varhi512, "V32sV32sV32sV32s", "nc", "avx512bw")
 
 TARGET_BUILTIN(__builtin_ia32_vpshldd128_mask, "V4iV4iV4iIiV4iUc", "nc", "avx512vl,avx512vbmi2")
 TARGET_BUILTIN(__builtin_ia32_vpshldd256_mask, "V8iV8iV8iIiV8iUc", "nc", "avx512vl,avx512vbmi2")
@@ -1467,15 +1446,6 @@ TARGET_BUILTIN(__builtin_ia32_vpmadd52hu
 TARGET_BUILTIN(__builtin_ia32_vpmadd52huq256, "V4LLiV4LLiV4LLiV4LLi", "nc", "avx512ifma,avx512vl")
 TARGET_BUILTIN(__builtin_ia32_vpmadd52luq128, "V2LLiV2LLiV2LLiV2LLi", "nc", "avx512ifma,avx512vl")
 TARGET_BUILTIN(__builtin_ia32_vpmadd52luq256, "V4LLiV4LLiV4LLiV4LLi", "nc", "avx512ifma,avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermi2varqi512_mask, "V64cV64cV64cV64cULLi", "nc", "avx512vbmi")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varqi512_mask, "V64cV64cV64cV64cULLi", "nc", "avx512vbmi")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varqi512_maskz, "V64cV64cV64cV64cULLi", "nc", "avx512vbmi")
-TARGET_BUILTIN(__builtin_ia32_vpermi2varqi128_mask, "V16cV16cV16cV16cUs", "nc", "avx512vbmi,avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermi2varqi256_mask, "V32cV32cV32cV32cUi", "nc", "avx512vbmi,avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varqi128_mask, "V16cV16cV16cV16cUs", "nc", "avx512vbmi,avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varqi128_maskz, "V16cV16cV16cV16cUs", "nc", "avx512vbmi,avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varqi256_mask, "V32cV32cV32cV32cUi", "nc", "avx512vbmi,avx512vl")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varqi256_maskz, "V32cV32cV32cV32cUi", "nc", "avx512vbmi,avx512vl")
 TARGET_BUILTIN(__builtin_ia32_vcomisd, "iV2dV2dIiIi", "nc", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_vcomiss, "iV4fV4fIiIi", "nc", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_kunpckdi, "ULLiULLiULLi", "nc", "avx512bw")
@@ -1556,16 +1526,8 @@ TARGET_BUILTIN(__builtin_ia32_vcvttsd2si
 TARGET_BUILTIN(__builtin_ia32_vcvttsd2usi32, "UiV2dIi", "nc", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_vcvttss2si32, "iV4fIi", "nc", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_vcvttss2usi32, "UiV4fIi", "nc", "avx512f")
-TARGET_BUILTIN(__builtin_ia32_vpermi2vard512_mask, "V16iV16iV16iV16iUs", "nc", "avx512f")
-TARGET_BUILTIN(__builtin_ia32_vpermi2varpd512_mask, "V8dV8dV8LLiV8dUc", "nc", "avx512f")
-TARGET_BUILTIN(__builtin_ia32_vpermi2varps512_mask, "V16fV16fV16iV16fUs", "nc", "avx512f")
-TARGET_BUILTIN(__builtin_ia32_vpermi2varq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "nc", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_vpermilvarpd512, "V8dV8dV8LLi", "nc", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_vpermilvarps512, "V16fV16fV16i", "nc", "avx512f")
-TARGET_BUILTIN(__builtin_ia32_vpermt2vard512_maskz, "V16iV16iV16iV16iUs", "nc", "avx512f")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varpd512_maskz, "V8dV8LLiV8dV8dUc", "nc", "avx512f")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varps512_maskz, "V16fV16iV16fV16fUs", "nc", "avx512f")
-TARGET_BUILTIN(__builtin_ia32_vpermt2varq512_maskz, "V8LLiV8LLiV8LLiV8LLiUc", "nc", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_rndscalesd_round_mask, "V2dV2dV2dV2dUcIiIi", "nc", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_rndscaless_round_mask, "V4fV4fV4fV4fUcIiIi", "nc", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_scalefpd512_mask, "V8dV8dV8dV8dUcIi", "nc", "avx512f")

Modified: cfe/trunk/lib/Headers/avx512bwintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512bwintrin.h?rev=333387&r1=333386&r2=333387&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512bwintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512bwintrin.h Mon May 28 20:26:38 2018
@@ -917,43 +917,37 @@ _mm512_maskz_subs_epu16 (__mmask32 __U,
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_mask2_permutex2var_epi16 (__m512i __A, __m512i __I,
-         __mmask32 __U, __m512i __B)
+_mm512_permutex2var_epi16(__m512i __A, __m512i __I, __m512i __B)
 {
-  return (__m512i) __builtin_ia32_vpermi2varhi512_mask ((__v32hi) __A,
-              (__v32hi) __I /* idx */ ,
-              (__v32hi) __B,
-              (__mmask32) __U);
+  return (__m512i)__builtin_ia32_vpermi2varhi512((__v32hi)__A, (__v32hi)__I,
+                                                 (__v32hi)__B);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_permutex2var_epi16 (__m512i __A, __m512i __I, __m512i __B)
+_mm512_mask_permutex2var_epi16(__m512i __A, __mmask32 __U, __m512i __I,
+                               __m512i __B)
 {
-  return (__m512i) __builtin_ia32_vpermt2varhi512_mask ((__v32hi) __I /* idx */,
-              (__v32hi) __A,
-              (__v32hi) __B,
-              (__mmask32) -1);
+  return (__m512i)__builtin_ia32_selectw_512(__U,
+                              (__v32hi)_mm512_permutex2var_epi16(__A, __I, __B),
+                              (__v32hi)__A);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_mask_permutex2var_epi16 (__m512i __A, __mmask32 __U,
-        __m512i __I, __m512i __B)
+_mm512_mask2_permutex2var_epi16(__m512i __A, __m512i __I, __mmask32 __U,
+                                __m512i __B)
 {
-  return (__m512i) __builtin_ia32_vpermt2varhi512_mask ((__v32hi) __I /* idx */,
-              (__v32hi) __A,
-              (__v32hi) __B,
-              (__mmask32) __U);
+  return (__m512i)__builtin_ia32_selectw_512(__U,
+                              (__v32hi)_mm512_permutex2var_epi16(__A, __I, __B),
+                              (__v32hi)__I);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_maskz_permutex2var_epi16 (__mmask32 __U, __m512i __A,
-         __m512i __I, __m512i __B)
+_mm512_maskz_permutex2var_epi16(__mmask32 __U, __m512i __A, __m512i __I,
+                                __m512i __B)
 {
-  return (__m512i) __builtin_ia32_vpermt2varhi512_maskz ((__v32hi) __I
-              /* idx */ ,
-              (__v32hi) __A,
-              (__v32hi) __B,
-              (__mmask32) __U);
+  return (__m512i)__builtin_ia32_selectw_512(__U,
+                              (__v32hi)_mm512_permutex2var_epi16(__A, __I, __B),
+                              (__v32hi)_mm512_setzero_hi());
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS

Modified: cfe/trunk/lib/Headers/avx512fintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512fintrin.h?rev=333387&r1=333386&r2=333387&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512fintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512fintrin.h Mon May 28 20:26:38 2018
@@ -3399,66 +3399,69 @@ _mm512_mask3_fnmsub_ps(__m512 __A, __m51
 static __inline __m512i __DEFAULT_FN_ATTRS
 _mm512_permutex2var_epi32(__m512i __A, __m512i __I, __m512i __B)
 {
-  return (__m512i) __builtin_ia32_vpermt2vard512_mask ((__v16si) __I
-                                                       /* idx */ ,
-                                                       (__v16si) __A,
-                                                       (__v16si) __B,
-                                                       (__mmask16) -1);
+  return (__m512i)__builtin_ia32_vpermi2vard512((__v16si)__A, (__v16si) __I,
+                                                (__v16si) __B);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_mask_permutex2var_epi32 (__m512i __A, __mmask16 __U,
-                                __m512i __I, __m512i __B)
+_mm512_mask_permutex2var_epi32(__m512i __A, __mmask16 __U, __m512i __I,
+                               __m512i __B)
 {
-  return (__m512i) __builtin_ia32_vpermt2vard512_mask ((__v16si) __I
-                                                        /* idx */ ,
-                                                        (__v16si) __A,
-                                                        (__v16si) __B,
-                                                        (__mmask16) __U);
+  return (__m512i)__builtin_ia32_selectd_512(__U,
+                              (__v16si)_mm512_permutex2var_epi32(__A, __I, __B),
+                              (__v16si)__A);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_maskz_permutex2var_epi32 (__mmask16 __U, __m512i __A,
-                                 __m512i __I, __m512i __B)
+_mm512_mask2_permutex2var_epi32(__m512i __A, __m512i __I, __mmask16 __U,
+                                __m512i __B)
+{
+  return (__m512i)__builtin_ia32_selectd_512(__U,
+                              (__v16si)_mm512_permutex2var_epi32(__A, __I, __B),
+                              (__v16si)__I);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_maskz_permutex2var_epi32(__mmask16 __U, __m512i __A, __m512i __I,
+                                __m512i __B)
 {
-  return (__m512i) __builtin_ia32_vpermt2vard512_maskz ((__v16si) __I
-                                                        /* idx */ ,
-                                                        (__v16si) __A,
-                                                        (__v16si) __B,
-                                                        (__mmask16) __U);
+  return (__m512i)__builtin_ia32_selectd_512(__U,
+                              (__v16si)_mm512_permutex2var_epi32(__A, __I, __B),
+                              (__v16si)_mm512_setzero_si512());
 }
 
 static __inline __m512i __DEFAULT_FN_ATTRS
 _mm512_permutex2var_epi64(__m512i __A, __m512i __I, __m512i __B)
 {
-  return (__m512i) __builtin_ia32_vpermt2varq512_mask ((__v8di) __I
-                                                       /* idx */ ,
-                                                       (__v8di) __A,
-                                                       (__v8di) __B,
-                                                       (__mmask8) -1);
+  return (__m512i)__builtin_ia32_vpermi2varq512((__v8di)__A, (__v8di) __I,
+                                                (__v8di) __B);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_mask_permutex2var_epi64 (__m512i __A, __mmask8 __U, __m512i __I,
-                                __m512i __B)
+_mm512_mask_permutex2var_epi64(__m512i __A, __mmask8 __U, __m512i __I,
+                               __m512i __B)
 {
-  return (__m512i) __builtin_ia32_vpermt2varq512_mask ((__v8di) __I
-                                                       /* idx */ ,
-                                                       (__v8di) __A,
-                                                       (__v8di) __B,
-                                                       (__mmask8) __U);
+  return (__m512i)__builtin_ia32_selectq_512(__U,
+                               (__v8di)_mm512_permutex2var_epi64(__A, __I, __B),
+                               (__v8di)__A);
 }
 
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_mask2_permutex2var_epi64(__m512i __A, __m512i __I, __mmask8 __U,
+                                __m512i __B)
+{
+  return (__m512i)__builtin_ia32_selectq_512(__U,
+                               (__v8di)_mm512_permutex2var_epi64(__A, __I, __B),
+                               (__v8di)__I);
+}
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_maskz_permutex2var_epi64 (__mmask8 __U, __m512i __A,
-         __m512i __I, __m512i __B)
+_mm512_maskz_permutex2var_epi64(__mmask8 __U, __m512i __A, __m512i __I,
+                                __m512i __B)
 {
-  return (__m512i) __builtin_ia32_vpermt2varq512_maskz ((__v8di) __I
-                                                        /* idx */ ,
-                                                        (__v8di) __A,
-                                                        (__v8di) __B,
-                                                        (__mmask8) __U);
+  return (__m512i)__builtin_ia32_selectq_512(__U,
+                               (__v8di)_mm512_permutex2var_epi64(__A, __I, __B),
+                               (__v8di)_mm512_setzero_si512());
 }
 
 #define _mm512_alignr_epi64(A, B, I) __extension__ ({ \
@@ -5844,17 +5847,6 @@ _mm512_kmov (__mmask16 __A)
 #endif
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_mask2_permutex2var_epi32 (__m512i __A, __m512i __I,
-         __mmask16 __U, __m512i __B)
-{
-  return (__m512i) __builtin_ia32_vpermi2vard512_mask ((__v16si) __A,
-                   (__v16si) __I
-                   /* idx */ ,
-                   (__v16si) __B,
-                   (__mmask16) __U);
-}
-
-static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_sll_epi32(__m512i __A, __m128i __B)
 {
   return (__m512i)__builtin_ia32_pslld512((__v16si) __A, (__v4si)__B);
@@ -6331,39 +6323,6 @@ _mm_cvttss_u64 (__m128 __A)
 }
 #endif
 
-static __inline__ __m512d __DEFAULT_FN_ATTRS
-_mm512_mask2_permutex2var_pd (__m512d __A, __m512i __I, __mmask8 __U,
-            __m512d __B)
-{
-  return (__m512d) __builtin_ia32_vpermi2varpd512_mask ((__v8df) __A,
-              (__v8di) __I
-              /* idx */ ,
-              (__v8df) __B,
-              (__mmask8) __U);
-}
-
-static __inline__ __m512 __DEFAULT_FN_ATTRS
-_mm512_mask2_permutex2var_ps (__m512 __A, __m512i __I, __mmask16 __U,
-            __m512 __B)
-{
-  return (__m512) __builtin_ia32_vpermi2varps512_mask ((__v16sf) __A,
-                   (__v16si) __I
-                   /* idx */ ,
-                   (__v16sf) __B,
-                   (__mmask16) __U);
-}
-
-static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_mask2_permutex2var_epi64 (__m512i __A, __m512i __I,
-         __mmask8 __U, __m512i __B)
-{
-  return (__m512i) __builtin_ia32_vpermi2varq512_mask ((__v8di) __A,
-                   (__v8di) __I
-                   /* idx */ ,
-                   (__v8di) __B,
-                   (__mmask8) __U);
-}
-
 #define _mm512_permute_pd(X, C) __extension__ ({ \
   (__m512d)__builtin_shufflevector((__v8df)(__m512d)(X), \
                                    (__v8df)_mm512_undefined_pd(), \
@@ -6463,63 +6422,65 @@ _mm512_maskz_permutevar_ps(__mmask16 __U
 static __inline __m512d __DEFAULT_FN_ATTRS
 _mm512_permutex2var_pd(__m512d __A, __m512i __I, __m512d __B)
 {
-  return (__m512d) __builtin_ia32_vpermt2varpd512_mask ((__v8di) __I
-                    /* idx */ ,
-                    (__v8df) __A,
-                    (__v8df) __B,
-                    (__mmask8) -1);
+  return (__m512d)__builtin_ia32_vpermi2varpd512((__v8df)__A, (__v8di)__I,
+                                                 (__v8df)__B);
+}
+
+static __inline__ __m512d __DEFAULT_FN_ATTRS
+_mm512_mask_permutex2var_pd(__m512d __A, __mmask8 __U, __m512i __I, __m512d __B)
+{
+  return (__m512d)__builtin_ia32_selectpd_512(__U,
+                                  (__v8df)_mm512_permutex2var_pd(__A, __I, __B),
+                                  (__v8df)__A);
 }
 
 static __inline__ __m512d __DEFAULT_FN_ATTRS
-_mm512_mask_permutex2var_pd (__m512d __A, __mmask8 __U, __m512i __I, __m512d __B)
+_mm512_mask2_permutex2var_pd(__m512d __A, __m512i __I, __mmask8 __U,
+                             __m512d __B)
 {
-  return (__m512d) __builtin_ia32_vpermt2varpd512_mask ((__v8di) __I
-                    /* idx */ ,
-                    (__v8df) __A,
-                    (__v8df) __B,
-                    (__mmask8) __U);
+  return (__m512d)__builtin_ia32_selectpd_512(__U,
+                                  (__v8df)_mm512_permutex2var_pd(__A, __I, __B),
+                                  (__v8df)(__m512d)__I);
 }
 
 static __inline__ __m512d __DEFAULT_FN_ATTRS
-_mm512_maskz_permutex2var_pd (__mmask8 __U, __m512d __A, __m512i __I,
-            __m512d __B)
+_mm512_maskz_permutex2var_pd(__mmask8 __U, __m512d __A, __m512i __I,
+                             __m512d __B)
 {
-  return (__m512d) __builtin_ia32_vpermt2varpd512_maskz ((__v8di) __I
-                                                         /* idx */ ,
-                                                         (__v8df) __A,
-                                                         (__v8df) __B,
-                                                         (__mmask8) __U);
+  return (__m512d)__builtin_ia32_selectpd_512(__U,
+                                  (__v8df)_mm512_permutex2var_pd(__A, __I, __B),
+                                  (__v8df)_mm512_setzero_pd());
 }
 
 static __inline __m512 __DEFAULT_FN_ATTRS
 _mm512_permutex2var_ps(__m512 __A, __m512i __I, __m512 __B)
 {
-  return (__m512) __builtin_ia32_vpermt2varps512_mask ((__v16si) __I
-                                                         /* idx */ ,
-                                                         (__v16sf) __A,
-                                                         (__v16sf) __B,
-                                                         (__mmask16) -1);
+  return (__m512)__builtin_ia32_vpermi2varps512((__v16sf)__A, (__v16si)__I,
+                                                (__v16sf) __B);
+}
+
+static __inline__ __m512 __DEFAULT_FN_ATTRS
+_mm512_mask_permutex2var_ps(__m512 __A, __mmask16 __U, __m512i __I, __m512 __B)
+{
+  return (__m512)__builtin_ia32_selectps_512(__U,
+                                 (__v16sf)_mm512_permutex2var_ps(__A, __I, __B),
+                                 (__v16sf)__A);
 }
 
 static __inline__ __m512 __DEFAULT_FN_ATTRS
-_mm512_mask_permutex2var_ps (__m512 __A, __mmask16 __U, __m512i __I, __m512 __B)
+_mm512_mask2_permutex2var_ps(__m512 __A, __m512i __I, __mmask16 __U, __m512 __B)
 {
-  return (__m512) __builtin_ia32_vpermt2varps512_mask ((__v16si) __I
-                                                         /* idx */ ,
-                                                         (__v16sf) __A,
-                                                         (__v16sf) __B,
-                                                         (__mmask16) __U);
+  return (__m512)__builtin_ia32_selectps_512(__U,
+                                 (__v16sf)_mm512_permutex2var_ps(__A, __I, __B),
+                                 (__v16sf)(__m512)__I);
 }
 
 static __inline__ __m512 __DEFAULT_FN_ATTRS
-_mm512_maskz_permutex2var_ps (__mmask16 __U, __m512 __A, __m512i __I,
-            __m512 __B)
+_mm512_maskz_permutex2var_ps(__mmask16 __U, __m512 __A, __m512i __I, __m512 __B)
 {
-  return (__m512) __builtin_ia32_vpermt2varps512_maskz ((__v16si) __I
-                                                        /* idx */ ,
-                                                        (__v16sf) __A,
-                                                        (__v16sf) __B,
-                                                        (__mmask16) __U);
+  return (__m512)__builtin_ia32_selectps_512(__U,
+                                 (__v16sf)_mm512_permutex2var_ps(__A, __I, __B),
+                                 (__v16sf)_mm512_setzero_ps());
 }
 
 

Modified: cfe/trunk/lib/Headers/avx512vbmiintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512vbmiintrin.h?rev=333387&r1=333386&r2=333387&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512vbmiintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512vbmiintrin.h Mon May 28 20:26:38 2018
@@ -33,46 +33,37 @@
 
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_mask2_permutex2var_epi8 (__m512i __A, __m512i __I,
-         __mmask64 __U, __m512i __B)
+_mm512_permutex2var_epi8(__m512i __A, __m512i __I, __m512i __B)
 {
-  return (__m512i) __builtin_ia32_vpermi2varqi512_mask ((__v64qi) __A,
-              (__v64qi) __I
-              /* idx */ ,
-              (__v64qi) __B,
-              (__mmask64) __U);
+  return (__m512i)__builtin_ia32_vpermi2varqi512((__v64qi)__A, (__v64qi)__I,
+                                                 (__v64qi) __B);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_permutex2var_epi8 (__m512i __A, __m512i __I, __m512i __B)
+_mm512_mask_permutex2var_epi8(__m512i __A, __mmask64 __U, __m512i __I,
+                              __m512i __B)
 {
-  return (__m512i) __builtin_ia32_vpermt2varqi512_mask ((__v64qi) __I
-              /* idx */ ,
-              (__v64qi) __A,
-              (__v64qi) __B,
-              (__mmask64) -1);
+  return (__m512i)__builtin_ia32_selectb_512(__U,
+                               (__v64qi)_mm512_permutex2var_epi8(__A, __I, __B),
+                               (__v64qi)__A);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_mask_permutex2var_epi8 (__m512i __A, __mmask64 __U,
-        __m512i __I, __m512i __B)
+_mm512_mask2_permutex2var_epi8(__m512i __A, __m512i __I, __mmask64 __U,
+                               __m512i __B)
 {
-  return (__m512i) __builtin_ia32_vpermt2varqi512_mask ((__v64qi) __I
-              /* idx */ ,
-              (__v64qi) __A,
-              (__v64qi) __B,
-              (__mmask64) __U);
+  return (__m512i)__builtin_ia32_selectb_512(__U,
+                               (__v64qi)_mm512_permutex2var_epi8(__A, __I, __B),
+                               (__v64qi)__I);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_maskz_permutex2var_epi8 (__mmask64 __U, __m512i __A,
-         __m512i __I, __m512i __B)
+_mm512_maskz_permutex2var_epi8(__mmask64 __U, __m512i __A, __m512i __I,
+                               __m512i __B)
 {
-  return (__m512i) __builtin_ia32_vpermt2varqi512_maskz ((__v64qi) __I
-               /* idx */ ,
-               (__v64qi) __A,
-               (__v64qi) __B,
-               (__mmask64) __U);
+  return (__m512i)__builtin_ia32_selectb_512(__U,
+                               (__v64qi)_mm512_permutex2var_epi8(__A, __I, __B),
+                               (__v64qi)_mm512_setzero_si512());
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS

Modified: cfe/trunk/lib/Headers/avx512vbmivlintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512vbmivlintrin.h?rev=333387&r1=333386&r2=333387&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512vbmivlintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512vbmivlintrin.h Mon May 28 20:26:38 2018
@@ -33,97 +33,72 @@
 
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS
-_mm_mask2_permutex2var_epi8 (__m128i __A, __m128i __I, __mmask16 __U,
-            __m128i __B)
+_mm_permutex2var_epi8(__m128i __A, __m128i __I, __m128i __B)
 {
-  return (__m128i) __builtin_ia32_vpermi2varqi128_mask ((__v16qi) __A,
-              (__v16qi) __I
-              /* idx */ ,
-              (__v16qi) __B,
-              (__mmask16)
-              __U);
+  return (__m128i)__builtin_ia32_vpermi2varqi128((__v16qi)__A,
+                                                 (__v16qi)__I,
+                                                 (__v16qi)__B);
 }
 
-static __inline__ __m256i __DEFAULT_FN_ATTRS
-_mm256_mask2_permutex2var_epi8 (__m256i __A, __m256i __I,
-         __mmask32 __U, __m256i __B)
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_mask_permutex2var_epi8(__m128i __A, __mmask16 __U, __m128i __I,
+                           __m128i __B)
 {
-  return (__m256i) __builtin_ia32_vpermi2varqi256_mask ((__v32qi) __A,
-              (__v32qi) __I
-              /* idx */ ,
-              (__v32qi) __B,
-              (__mmask32)
-              __U);
+  return (__m128i)__builtin_ia32_selectb_128(__U,
+                                  (__v16qi)_mm_permutex2var_epi8(__A, __I, __B),
+                                  (__v16qi)__A);
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS
-_mm_permutex2var_epi8 (__m128i __A, __m128i __I, __m128i __B)
+_mm_mask2_permutex2var_epi8(__m128i __A, __m128i __I, __mmask16 __U,
+                            __m128i __B)
 {
-  return (__m128i) __builtin_ia32_vpermt2varqi128_mask ((__v16qi) __I
-              /* idx */ ,
-              (__v16qi) __A,
-              (__v16qi) __B,
-              (__mmask16) -
-              1);
+  return (__m128i)__builtin_ia32_selectb_128(__U,
+                                  (__v16qi)_mm_permutex2var_epi8(__A, __I, __B),
+                                  (__v16qi)__I);
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS
-_mm_mask_permutex2var_epi8 (__m128i __A, __mmask16 __U, __m128i __I,
-           __m128i __B)
+_mm_maskz_permutex2var_epi8(__mmask16 __U, __m128i __A, __m128i __I,
+                            __m128i __B)
 {
-  return (__m128i) __builtin_ia32_vpermt2varqi128_mask ((__v16qi) __I
-              /* idx */ ,
-              (__v16qi) __A,
-              (__v16qi) __B,
-              (__mmask16)
-              __U);
+  return (__m128i)__builtin_ia32_selectb_128(__U,
+                                  (__v16qi)_mm_permutex2var_epi8(__A, __I, __B),
+                                  (__v16qi)_mm_setzero_si128());
 }
 
-static __inline__ __m128i __DEFAULT_FN_ATTRS
-_mm_maskz_permutex2var_epi8 (__mmask16 __U, __m128i __A, __m128i __I,
-            __m128i __B)
+static __inline__ __m256i __DEFAULT_FN_ATTRS
+_mm256_permutex2var_epi8(__m256i __A, __m256i __I, __m256i __B)
 {
-  return (__m128i) __builtin_ia32_vpermt2varqi128_maskz ((__v16qi) __I
-               /* idx */ ,
-               (__v16qi) __A,
-               (__v16qi) __B,
-               (__mmask16)
-               __U);
+  return (__m256i)__builtin_ia32_vpermi2varqi256((__v32qi)__A, (__v32qi)__I,
+                                                 (__v32qi)__B);
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS
-_mm256_permutex2var_epi8 (__m256i __A, __m256i __I, __m256i __B)
+_mm256_mask_permutex2var_epi8(__m256i __A, __mmask32 __U, __m256i __I,
+                              __m256i __B)
 {
-  return (__m256i) __builtin_ia32_vpermt2varqi256_mask ((__v32qi) __I
-              /* idx */ ,
-              (__v32qi) __A,
-              (__v32qi) __B,
-              (__mmask32) -
-              1);
+  return (__m256i)__builtin_ia32_selectb_256(__U,
+                               (__v32qi)_mm256_permutex2var_epi8(__A, __I, __B),
+                               (__v32qi)__A);
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS
-_mm256_mask_permutex2var_epi8 (__m256i __A, __mmask32 __U,
-        __m256i __I, __m256i __B)
+_mm256_mask2_permutex2var_epi8(__m256i __A, __m256i __I, __mmask32 __U,
+                               __m256i __B)
 {
-  return (__m256i) __builtin_ia32_vpermt2varqi256_mask ((__v32qi) __I
-              /* idx */ ,
-              (__v32qi) __A,
-              (__v32qi) __B,
-              (__mmask32)
-              __U);
+  return (__m256i)__builtin_ia32_selectb_256(__U,
+                               (__v32qi)_mm256_permutex2var_epi8(__A, __I, __B),
+                               (__v32qi)__I);
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS
-_mm256_maskz_permutex2var_epi8 (__mmask32 __U, __m256i __A,
-         __m256i __I, __m256i __B)
+_mm256_maskz_permutex2var_epi8(__mmask32 __U, __m256i __A, __m256i __I,
+                               __m256i __B)
 {
-  return (__m256i) __builtin_ia32_vpermt2varqi256_maskz ((__v32qi) __I
-               /* idx */ ,
-               (__v32qi) __A,
-               (__v32qi) __B,
-               (__mmask32)
-               __U);
+  return (__m256i)__builtin_ia32_selectb_256(__U,
+                               (__v32qi)_mm256_permutex2var_epi8(__A, __I, __B),
+                               (__v32qi)_mm256_setzero_si256());
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS

Modified: cfe/trunk/lib/Headers/avx512vlbwintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512vlbwintrin.h?rev=333387&r1=333386&r2=333387&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512vlbwintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512vlbwintrin.h Mon May 28 20:26:38 2018
@@ -1290,81 +1290,71 @@ _mm256_maskz_subs_epu16(__mmask16 __U, _
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS
-_mm_mask2_permutex2var_epi16 (__m128i __A, __m128i __I, __mmask8 __U,
-            __m128i __B)
-{
-  return (__m128i) __builtin_ia32_vpermi2varhi128_mask ((__v8hi) __A,
-               (__v8hi) __I /* idx */ ,
-               (__v8hi) __B,
-               (__mmask8) __U);
-}
-
-static __inline__ __m256i __DEFAULT_FN_ATTRS
-_mm256_mask2_permutex2var_epi16 (__m256i __A, __m256i __I,
-         __mmask16 __U, __m256i __B)
+_mm_permutex2var_epi16(__m128i __A, __m128i __I, __m128i __B)
 {
-  return (__m256i) __builtin_ia32_vpermi2varhi256_mask ((__v16hi) __A,
-               (__v16hi) __I /* idx */ ,
-               (__v16hi) __B,
-               (__mmask16) __U);
+  return (__m128i)__builtin_ia32_vpermi2varhi128((__v8hi)__A, (__v8hi)__I,
+                                                 (__v8hi) __B);
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS
-_mm_permutex2var_epi16 (__m128i __A, __m128i __I, __m128i __B)
+_mm_mask_permutex2var_epi16(__m128i __A, __mmask8 __U, __m128i __I,
+                            __m128i __B)
 {
-  return (__m128i) __builtin_ia32_vpermt2varhi128_mask ((__v8hi) __I/* idx */,
-               (__v8hi) __A,
-               (__v8hi) __B,
-               (__mmask8) -1);
+  return (__m128i)__builtin_ia32_selectw_128(__U,
+                                  (__v8hi)_mm_permutex2var_epi16(__A, __I, __B),
+                                  (__v8hi)__A);
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS
-_mm_mask_permutex2var_epi16 (__m128i __A, __mmask8 __U, __m128i __I,
-           __m128i __B)
+_mm_mask2_permutex2var_epi16(__m128i __A, __m128i __I, __mmask8 __U,
+                             __m128i __B)
 {
-  return (__m128i) __builtin_ia32_vpermt2varhi128_mask ((__v8hi) __I/* idx */,
-               (__v8hi) __A,
-               (__v8hi) __B,
-               (__mmask8) __U);
+  return (__m128i)__builtin_ia32_selectw_128(__U,
+                                  (__v8hi)_mm_permutex2var_epi16(__A, __I, __B),
+                                  (__v8hi)__I);
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_maskz_permutex2var_epi16 (__mmask8 __U, __m128i __A, __m128i __I,
             __m128i __B)
 {
-  return (__m128i) __builtin_ia32_vpermt2varhi128_maskz ((__v8hi) __I/* idx */,
-               (__v8hi) __A,
-               (__v8hi) __B,
-               (__mmask8) __U);
+  return (__m128i)__builtin_ia32_selectw_128(__U,
+                                  (__v8hi)_mm_permutex2var_epi16(__A, __I, __B),
+                                  (__v8hi)_mm_setzero_si128());
+}
+
+static __inline__ __m256i __DEFAULT_FN_ATTRS
+_mm256_permutex2var_epi16(__m256i __A, __m256i __I, __m256i __B)
+{
+  return (__m256i)__builtin_ia32_vpermi2varhi256((__v16hi)__A, (__v16hi)__I,
+                                                 (__v16hi)__B);
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS
-_mm256_permutex2var_epi16 (__m256i __A, __m256i __I, __m256i __B)
+_mm256_mask_permutex2var_epi16(__m256i __A, __mmask16 __U, __m256i __I,
+                               __m256i __B)
 {
-  return (__m256i) __builtin_ia32_vpermt2varhi256_mask ((__v16hi) __I/* idx */,
-               (__v16hi) __A,
-               (__v16hi) __B,
-               (__mmask16) -1);
+  return (__m256i)__builtin_ia32_selectw_256(__U,
+                              (__v16hi)_mm256_permutex2var_epi16(__A, __I, __B),
+                              (__v16hi)__A);
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS
-_mm256_mask_permutex2var_epi16 (__m256i __A, __mmask16 __U,
-        __m256i __I, __m256i __B)
+_mm256_mask2_permutex2var_epi16(__m256i __A, __m256i __I, __mmask16 __U,
+                                __m256i __B)
 {
-  return (__m256i) __builtin_ia32_vpermt2varhi256_mask ((__v16hi) __I/* idx */,
-               (__v16hi) __A,
-               (__v16hi) __B,
-               (__mmask16) __U);
+  return (__m256i)__builtin_ia32_selectw_256(__U,
+                              (__v16hi)_mm256_permutex2var_epi16(__A, __I, __B),
+                              (__v16hi)__I);
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS
-_mm256_maskz_permutex2var_epi16 (__mmask16 __U, __m256i __A,
-         __m256i __I, __m256i __B)
+_mm256_maskz_permutex2var_epi16 (__mmask16 __U, __m256i __A, __m256i __I,
+                                 __m256i __B)
 {
-  return (__m256i) __builtin_ia32_vpermt2varhi256_maskz ((__v16hi) __I/* idx */,
-               (__v16hi) __A,
-               (__v16hi) __B,
-               (__mmask16) __U);
+  return (__m256i)__builtin_ia32_selectw_256(__U,
+                              (__v16hi)_mm256_permutex2var_epi16(__A, __I, __B),
+                              (__v16hi)_mm256_setzero_si256());
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS

Modified: cfe/trunk/lib/Headers/avx512vlintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512vlintrin.h?rev=333387&r1=333386&r2=333387&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512vlintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512vlintrin.h Mon May 28 20:26:38 2018
@@ -3598,330 +3598,237 @@ _mm256_maskz_sub_ps(__mmask8 __U, __m256
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS
-_mm_mask2_permutex2var_epi32 (__m128i __A, __m128i __I, __mmask8 __U,
-            __m128i __B) {
-  return (__m128i) __builtin_ia32_vpermi2vard128_mask ((__v4si) __A,
-                   (__v4si) __I
-                   /* idx */ ,
-                   (__v4si) __B,
-                   (__mmask8) __U);
-}
-
-static __inline__ __m256i __DEFAULT_FN_ATTRS
-_mm256_mask2_permutex2var_epi32 (__m256i __A, __m256i __I,
-         __mmask8 __U, __m256i __B) {
-  return (__m256i) __builtin_ia32_vpermi2vard256_mask ((__v8si) __A,
-                   (__v8si) __I
-                   /* idx */ ,
-                   (__v8si) __B,
-                   (__mmask8) __U);
-}
-
-static __inline__ __m128d __DEFAULT_FN_ATTRS
-_mm_mask2_permutex2var_pd (__m128d __A, __m128i __I, __mmask8 __U,
-         __m128d __B) {
-  return (__m128d) __builtin_ia32_vpermi2varpd128_mask ((__v2df) __A,
-              (__v2di) __I
-              /* idx */ ,
-              (__v2df) __B,
-              (__mmask8)
-              __U);
-}
-
-static __inline__ __m256d __DEFAULT_FN_ATTRS
-_mm256_mask2_permutex2var_pd (__m256d __A, __m256i __I, __mmask8 __U,
-            __m256d __B) {
-  return (__m256d) __builtin_ia32_vpermi2varpd256_mask ((__v4df) __A,
-              (__v4di) __I
-              /* idx */ ,
-              (__v4df) __B,
-              (__mmask8)
-              __U);
-}
-
-static __inline__ __m128 __DEFAULT_FN_ATTRS
-_mm_mask2_permutex2var_ps (__m128 __A, __m128i __I, __mmask8 __U,
-         __m128 __B) {
-  return (__m128) __builtin_ia32_vpermi2varps128_mask ((__v4sf) __A,
-                   (__v4si) __I
-                   /* idx */ ,
-                   (__v4sf) __B,
-                   (__mmask8) __U);
-}
-
-static __inline__ __m256 __DEFAULT_FN_ATTRS
-_mm256_mask2_permutex2var_ps (__m256 __A, __m256i __I, __mmask8 __U,
-            __m256 __B) {
-  return (__m256) __builtin_ia32_vpermi2varps256_mask ((__v8sf) __A,
-                   (__v8si) __I
-                   /* idx */ ,
-                   (__v8sf) __B,
-                   (__mmask8) __U);
+_mm_permutex2var_epi32(__m128i __A, __m128i __I, __m128i __B) {
+  return (__m128i)__builtin_ia32_vpermi2vard128((__v4si) __A, (__v4si)__I,
+                                                (__v4si)__B);
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS
-_mm_mask2_permutex2var_epi64 (__m128i __A, __m128i __I, __mmask8 __U,
-            __m128i __B) {
-  return (__m128i) __builtin_ia32_vpermi2varq128_mask ((__v2di) __A,
-                   (__v2di) __I
-                   /* idx */ ,
-                   (__v2di) __B,
-                   (__mmask8) __U);
-}
-
-static __inline__ __m256i __DEFAULT_FN_ATTRS
-_mm256_mask2_permutex2var_epi64 (__m256i __A, __m256i __I,
-         __mmask8 __U, __m256i __B) {
-  return (__m256i) __builtin_ia32_vpermi2varq256_mask ((__v4di) __A,
-                   (__v4di) __I
-                   /* idx */ ,
-                   (__v4di) __B,
-                   (__mmask8) __U);
+_mm_mask_permutex2var_epi32(__m128i __A, __mmask8 __U, __m128i __I,
+                            __m128i __B) {
+  return (__m128i)__builtin_ia32_selectd_128(__U,
+                                  (__v4si)_mm_permutex2var_epi32(__A, __I, __B),
+                                  (__v4si)__A);
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS
-_mm_permutex2var_epi32 (__m128i __A, __m128i __I, __m128i __B) {
-  return (__m128i) __builtin_ia32_vpermt2vard128_mask ((__v4si) __I
-                   /* idx */ ,
-                   (__v4si) __A,
-                   (__v4si) __B,
-                   (__mmask8) -1);
+_mm_mask2_permutex2var_epi32(__m128i __A, __m128i __I, __mmask8 __U,
+                             __m128i __B) {
+  return (__m128i)__builtin_ia32_selectd_128(__U,
+                                  (__v4si)_mm_permutex2var_epi32(__A, __I, __B),
+                                  (__v4si)__I);
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS
-_mm_mask_permutex2var_epi32 (__m128i __A, __mmask8 __U, __m128i __I,
-           __m128i __B) {
-  return (__m128i) __builtin_ia32_vpermt2vard128_mask ((__v4si) __I
-                   /* idx */ ,
-                   (__v4si) __A,
-                   (__v4si) __B,
-                   (__mmask8) __U);
+_mm_maskz_permutex2var_epi32(__mmask8 __U, __m128i __A, __m128i __I,
+                             __m128i __B) {
+  return (__m128i)__builtin_ia32_selectd_128(__U,
+                                  (__v4si)_mm_permutex2var_epi32(__A, __I, __B),
+                                  (__v4si)_mm_setzero_si128());
 }
 
-static __inline__ __m128i __DEFAULT_FN_ATTRS
-_mm_maskz_permutex2var_epi32 (__mmask8 __U, __m128i __A, __m128i __I,
-            __m128i __B) {
-  return (__m128i) __builtin_ia32_vpermt2vard128_maskz ((__v4si) __I
-              /* idx */ ,
-              (__v4si) __A,
-              (__v4si) __B,
-              (__mmask8)
-              __U);
+static __inline__ __m256i __DEFAULT_FN_ATTRS
+_mm256_permutex2var_epi32(__m256i __A, __m256i __I, __m256i __B) {
+  return (__m256i)__builtin_ia32_vpermi2vard256((__v8si)__A, (__v8si) __I,
+                                                (__v8si) __B);
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS
-_mm256_permutex2var_epi32 (__m256i __A, __m256i __I, __m256i __B) {
-  return (__m256i) __builtin_ia32_vpermt2vard256_mask ((__v8si) __I
-                   /* idx */ ,
-                   (__v8si) __A,
-                   (__v8si) __B,
-                   (__mmask8) -1);
+_mm256_mask_permutex2var_epi32(__m256i __A, __mmask8 __U, __m256i __I,
+                               __m256i __B) {
+  return (__m256i)__builtin_ia32_selectd_256(__U,
+                               (__v8si)_mm256_permutex2var_epi32(__A, __I, __B),
+                               (__v8si)__A);
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS
-_mm256_mask_permutex2var_epi32 (__m256i __A, __mmask8 __U, __m256i __I,
-        __m256i __B) {
-  return (__m256i) __builtin_ia32_vpermt2vard256_mask ((__v8si) __I
-                   /* idx */ ,
-                   (__v8si) __A,
-                   (__v8si) __B,
-                   (__mmask8) __U);
+_mm256_mask2_permutex2var_epi32(__m256i __A, __m256i __I, __mmask8 __U,
+                                __m256i __B) {
+  return (__m256i)__builtin_ia32_selectd_256(__U,
+                               (__v8si)_mm256_permutex2var_epi32(__A, __I, __B),
+                               (__v8si)__I);
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS
-_mm256_maskz_permutex2var_epi32 (__mmask8 __U, __m256i __A,
-         __m256i __I, __m256i __B) {
-  return (__m256i) __builtin_ia32_vpermt2vard256_maskz ((__v8si) __I
-              /* idx */ ,
-              (__v8si) __A,
-              (__v8si) __B,
-              (__mmask8)
-              __U);
+_mm256_maskz_permutex2var_epi32(__mmask8 __U, __m256i __A, __m256i __I,
+                                __m256i __B) {
+  return (__m256i)__builtin_ia32_selectd_256(__U,
+                               (__v8si)_mm256_permutex2var_epi32(__A, __I, __B),
+                               (__v8si)_mm256_setzero_si256());
 }
 
 static __inline__ __m128d __DEFAULT_FN_ATTRS
-_mm_permutex2var_pd (__m128d __A, __m128i __I, __m128d __B) {
-  return (__m128d) __builtin_ia32_vpermt2varpd128_mask ((__v2di) __I
-              /* idx */ ,
-              (__v2df) __A,
-              (__v2df) __B,
-              (__mmask8) -
-              1);
+_mm_permutex2var_pd(__m128d __A, __m128i __I, __m128d __B) {
+  return (__m128d)__builtin_ia32_vpermi2varpd128((__v2df)__A, (__v2di)__I,
+                                                 (__v2df)__B);
 }
 
 static __inline__ __m128d __DEFAULT_FN_ATTRS
-_mm_mask_permutex2var_pd (__m128d __A, __mmask8 __U, __m128i __I,
-        __m128d __B) {
-  return (__m128d) __builtin_ia32_vpermt2varpd128_mask ((__v2di) __I
-              /* idx */ ,
-              (__v2df) __A,
-              (__v2df) __B,
-              (__mmask8)
-              __U);
+_mm_mask_permutex2var_pd(__m128d __A, __mmask8 __U, __m128i __I, __m128d __B) {
+  return (__m128d)__builtin_ia32_selectpd_128(__U,
+                                     (__v2df)_mm_permutex2var_pd(__A, __I, __B),
+                                     (__v2df)__A);
 }
 
 static __inline__ __m128d __DEFAULT_FN_ATTRS
-_mm_maskz_permutex2var_pd (__mmask8 __U, __m128d __A, __m128i __I,
-         __m128d __B) {
-  return (__m128d) __builtin_ia32_vpermt2varpd128_maskz ((__v2di) __I
-               /* idx */ ,
-               (__v2df) __A,
-               (__v2df) __B,
-               (__mmask8)
-               __U);
+_mm_mask2_permutex2var_pd(__m128d __A, __m128i __I, __mmask8 __U, __m128d __B) {
+  return (__m128d)__builtin_ia32_selectpd_128(__U,
+                                     (__v2df)_mm_permutex2var_pd(__A, __I, __B),
+                                     (__v2df)(__m128d)__I);
+}
+
+static __inline__ __m128d __DEFAULT_FN_ATTRS
+_mm_maskz_permutex2var_pd(__mmask8 __U, __m128d __A, __m128i __I, __m128d __B) {
+  return (__m128d)__builtin_ia32_selectpd_128(__U,
+                                     (__v2df)_mm_permutex2var_pd(__A, __I, __B),
+                                     (__v2df)_mm_setzero_pd());
+}
+
+static __inline__ __m256d __DEFAULT_FN_ATTRS
+_mm256_permutex2var_pd(__m256d __A, __m256i __I, __m256d __B) {
+  return (__m256d)__builtin_ia32_vpermi2varpd256((__v4df)__A, (__v4di)__I,
+                                                 (__v4df)__B);
 }
 
 static __inline__ __m256d __DEFAULT_FN_ATTRS
-_mm256_permutex2var_pd (__m256d __A, __m256i __I, __m256d __B) {
-  return (__m256d) __builtin_ia32_vpermt2varpd256_mask ((__v4di) __I
-              /* idx */ ,
-              (__v4df) __A,
-              (__v4df) __B,
-              (__mmask8) -
-              1);
+_mm256_mask_permutex2var_pd(__m256d __A, __mmask8 __U, __m256i __I,
+                            __m256d __B) {
+  return (__m256d)__builtin_ia32_selectpd_256(__U,
+                                  (__v4df)_mm256_permutex2var_pd(__A, __I, __B),
+                                  (__v4df)__A);
 }
 
 static __inline__ __m256d __DEFAULT_FN_ATTRS
-_mm256_mask_permutex2var_pd (__m256d __A, __mmask8 __U, __m256i __I,
-           __m256d __B) {
-  return (__m256d) __builtin_ia32_vpermt2varpd256_mask ((__v4di) __I
-              /* idx */ ,
-              (__v4df) __A,
-              (__v4df) __B,
-              (__mmask8)
-              __U);
+_mm256_mask2_permutex2var_pd(__m256d __A, __m256i __I, __mmask8 __U,
+                             __m256d __B) {
+  return (__m256d)__builtin_ia32_selectpd_256(__U,
+                                  (__v4df)_mm256_permutex2var_pd(__A, __I, __B),
+                                  (__v4df)(__m256d)__I);
 }
 
 static __inline__ __m256d __DEFAULT_FN_ATTRS
-_mm256_maskz_permutex2var_pd (__mmask8 __U, __m256d __A, __m256i __I,
-            __m256d __B) {
-  return (__m256d) __builtin_ia32_vpermt2varpd256_maskz ((__v4di) __I
-               /* idx */ ,
-               (__v4df) __A,
-               (__v4df) __B,
-               (__mmask8)
-               __U);
+_mm256_maskz_permutex2var_pd(__mmask8 __U, __m256d __A, __m256i __I,
+                             __m256d __B) {
+  return (__m256d)__builtin_ia32_selectpd_256(__U,
+                                  (__v4df)_mm256_permutex2var_pd(__A, __I, __B),
+                                  (__v4df)_mm256_setzero_pd());
+}
+
+static __inline__ __m128 __DEFAULT_FN_ATTRS
+_mm_permutex2var_ps(__m128 __A, __m128i __I, __m128 __B) {
+  return (__m128)__builtin_ia32_vpermi2varps128((__v4sf)__A, (__v4si)__I,
+                                                (__v4sf)__B);
 }
 
 static __inline__ __m128 __DEFAULT_FN_ATTRS
-_mm_permutex2var_ps (__m128 __A, __m128i __I, __m128 __B) {
-  return (__m128) __builtin_ia32_vpermt2varps128_mask ((__v4si) __I
-                   /* idx */ ,
-                   (__v4sf) __A,
-                   (__v4sf) __B,
-                   (__mmask8) -1);
+_mm_mask_permutex2var_ps(__m128 __A, __mmask8 __U, __m128i __I, __m128 __B) {
+  return (__m128)__builtin_ia32_selectps_128(__U,
+                                     (__v4sf)_mm_permutex2var_ps(__A, __I, __B),
+                                     (__v4sf)__A);
 }
 
 static __inline__ __m128 __DEFAULT_FN_ATTRS
-_mm_mask_permutex2var_ps (__m128 __A, __mmask8 __U, __m128i __I,
-        __m128 __B) {
-  return (__m128) __builtin_ia32_vpermt2varps128_mask ((__v4si) __I
-                   /* idx */ ,
-                   (__v4sf) __A,
-                   (__v4sf) __B,
-                   (__mmask8) __U);
+_mm_mask2_permutex2var_ps(__m128 __A, __m128i __I, __mmask8 __U, __m128 __B) {
+  return (__m128)__builtin_ia32_selectps_128(__U,
+                                     (__v4sf)_mm_permutex2var_ps(__A, __I, __B),
+                                     (__v4sf)(__m128)__I);
 }
 
 static __inline__ __m128 __DEFAULT_FN_ATTRS
-_mm_maskz_permutex2var_ps (__mmask8 __U, __m128 __A, __m128i __I,
-         __m128 __B) {
-  return (__m128) __builtin_ia32_vpermt2varps128_maskz ((__v4si) __I
-              /* idx */ ,
-              (__v4sf) __A,
-              (__v4sf) __B,
-              (__mmask8)
-              __U);
+_mm_maskz_permutex2var_ps(__mmask8 __U, __m128 __A, __m128i __I, __m128 __B) {
+  return (__m128)__builtin_ia32_selectps_128(__U,
+                                     (__v4sf)_mm_permutex2var_ps(__A, __I, __B),
+                                     (__v4sf)_mm_setzero_ps());
 }
 
 static __inline__ __m256 __DEFAULT_FN_ATTRS
-_mm256_permutex2var_ps (__m256 __A, __m256i __I, __m256 __B) {
-  return (__m256) __builtin_ia32_vpermt2varps256_mask ((__v8si) __I
-                   /* idx */ ,
-                   (__v8sf) __A,
-                   (__v8sf) __B,
-                   (__mmask8) -1);
+_mm256_permutex2var_ps(__m256 __A, __m256i __I, __m256 __B) {
+  return (__m256)__builtin_ia32_vpermi2varps256((__v8sf)__A, (__v8si)__I,
+                                                (__v8sf) __B);
 }
 
 static __inline__ __m256 __DEFAULT_FN_ATTRS
-_mm256_mask_permutex2var_ps (__m256 __A, __mmask8 __U, __m256i __I,
-           __m256 __B) {
-  return (__m256) __builtin_ia32_vpermt2varps256_mask ((__v8si) __I
-                   /* idx */ ,
-                   (__v8sf) __A,
-                   (__v8sf) __B,
-                   (__mmask8) __U);
+_mm256_mask_permutex2var_ps(__m256 __A, __mmask8 __U, __m256i __I, __m256 __B) {
+  return (__m256)__builtin_ia32_selectps_256(__U,
+                                  (__v8sf)_mm256_permutex2var_ps(__A, __I, __B),
+                                  (__v8sf)__A);
 }
 
 static __inline__ __m256 __DEFAULT_FN_ATTRS
-_mm256_maskz_permutex2var_ps (__mmask8 __U, __m256 __A, __m256i __I,
-            __m256 __B) {
-  return (__m256) __builtin_ia32_vpermt2varps256_maskz ((__v8si) __I
-              /* idx */ ,
-              (__v8sf) __A,
-              (__v8sf) __B,
-              (__mmask8)
-              __U);
+_mm256_mask2_permutex2var_ps(__m256 __A, __m256i __I, __mmask8 __U,
+                             __m256 __B) {
+  return (__m256)__builtin_ia32_selectps_256(__U,
+                                  (__v8sf)_mm256_permutex2var_ps(__A, __I, __B),
+                                  (__v8sf)(__m256)__I);
+}
+
+static __inline__ __m256 __DEFAULT_FN_ATTRS
+_mm256_maskz_permutex2var_ps(__mmask8 __U, __m256 __A, __m256i __I,
+                             __m256 __B) {
+  return (__m256)__builtin_ia32_selectps_256(__U,
+                                  (__v8sf)_mm256_permutex2var_ps(__A, __I, __B),
+                                  (__v8sf)_mm256_setzero_ps());
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS
-_mm_permutex2var_epi64 (__m128i __A, __m128i __I, __m128i __B) {
-  return (__m128i) __builtin_ia32_vpermt2varq128_mask ((__v2di) __I
-                   /* idx */ ,
-                   (__v2di) __A,
-                   (__v2di) __B,
-                   (__mmask8) -1);
+_mm_permutex2var_epi64(__m128i __A, __m128i __I, __m128i __B) {
+  return (__m128i)__builtin_ia32_vpermi2varq128((__v2di)__A, (__v2di)__I,
+                                                (__v2di)__B);
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS
-_mm_mask_permutex2var_epi64 (__m128i __A, __mmask8 __U, __m128i __I,
-           __m128i __B) {
-  return (__m128i) __builtin_ia32_vpermt2varq128_mask ((__v2di) __I
-                   /* idx */ ,
-                   (__v2di) __A,
-                   (__v2di) __B,
-                   (__mmask8) __U);
+_mm_mask_permutex2var_epi64(__m128i __A, __mmask8 __U, __m128i __I,
+                            __m128i __B) {
+  return (__m128i)__builtin_ia32_selectq_128(__U,
+                                  (__v2di)_mm_permutex2var_epi64(__A, __I, __B),
+                                  (__v2di)__A);
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS
-_mm_maskz_permutex2var_epi64 (__mmask8 __U, __m128i __A, __m128i __I,
-            __m128i __B) {
-  return (__m128i) __builtin_ia32_vpermt2varq128_maskz ((__v2di) __I
-              /* idx */ ,
-              (__v2di) __A,
-              (__v2di) __B,
-              (__mmask8)
-              __U);
+_mm_mask2_permutex2var_epi64(__m128i __A, __m128i __I, __mmask8 __U,
+                             __m128i __B) {
+  return (__m128i)__builtin_ia32_selectq_128(__U,
+                                  (__v2di)_mm_permutex2var_epi64(__A, __I, __B),
+                                  (__v2di)__I);
 }
 
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_maskz_permutex2var_epi64(__mmask8 __U, __m128i __A, __m128i __I,
+                             __m128i __B) {
+  return (__m128i)__builtin_ia32_selectq_128(__U,
+                                  (__v2di)_mm_permutex2var_epi64(__A, __I, __B),
+                                  (__v2di)_mm_setzero_si128());
+}
+
+
+static __inline__ __m256i __DEFAULT_FN_ATTRS
+_mm256_permutex2var_epi64(__m256i __A, __m256i __I, __m256i __B) {
+  return (__m256i)__builtin_ia32_vpermi2varq256((__v4di)__A, (__v4di) __I,
+                                                (__v4di) __B);
+}
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS
-_mm256_permutex2var_epi64 (__m256i __A, __m256i __I, __m256i __B) {
-  return (__m256i) __builtin_ia32_vpermt2varq256_mask ((__v4di) __I
-                   /* idx */ ,
-                   (__v4di) __A,
-                   (__v4di) __B,
-                   (__mmask8) -1);
+_mm256_mask_permutex2var_epi64(__m256i __A, __mmask8 __U, __m256i __I,
+                               __m256i __B) {
+  return (__m256i)__builtin_ia32_selectq_256(__U,
+                               (__v4di)_mm256_permutex2var_epi64(__A, __I, __B),
+                               (__v4di)__A);
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS
-_mm256_mask_permutex2var_epi64 (__m256i __A, __mmask8 __U, __m256i __I,
-        __m256i __B) {
-  return (__m256i) __builtin_ia32_vpermt2varq256_mask ((__v4di) __I
-                   /* idx */ ,
-                   (__v4di) __A,
-                   (__v4di) __B,
-                   (__mmask8) __U);
+_mm256_mask2_permutex2var_epi64(__m256i __A, __m256i __I, __mmask8 __U,
+                                __m256i __B) {
+  return (__m256i)__builtin_ia32_selectq_256(__U,
+                               (__v4di)_mm256_permutex2var_epi64(__A, __I, __B),
+                               (__v4di)__I);
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS
-_mm256_maskz_permutex2var_epi64 (__mmask8 __U, __m256i __A,
-         __m256i __I, __m256i __B) {
-  return (__m256i) __builtin_ia32_vpermt2varq256_maskz ((__v4di) __I
-              /* idx */ ,
-              (__v4di) __A,
-              (__v4di) __B,
-              (__mmask8)
-              __U);
+_mm256_maskz_permutex2var_epi64(__mmask8 __U, __m256i __A, __m256i __I,
+                                __m256i __B) {
+  return (__m256i)__builtin_ia32_selectq_256(__U,
+                               (__v4di)_mm256_permutex2var_epi64(__A, __I, __B),
+                               (__v4di)_mm256_setzero_si256());
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS

Modified: cfe/trunk/test/CodeGen/avx512bw-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512bw-builtins.c?rev=333387&r1=333386&r2=333387&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512bw-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512bw-builtins.c Mon May 28 20:26:38 2018
@@ -963,22 +963,25 @@ __m512i test_mm512_maskz_subs_epu16(__mm
 }
 __m512i test_mm512_mask2_permutex2var_epi16(__m512i __A, __m512i __I, __mmask32 __U, __m512i __B) {
   // CHECK-LABEL: @test_mm512_mask2_permutex2var_epi16
-  // CHECK: @llvm.x86.avx512.mask.vpermi2var.hi.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.hi.512
+  // CHECK: select <32 x i1> %{{.*}}, <32 x i16> %{{.*}}, <32 x i16> %{{.*}}
   return _mm512_mask2_permutex2var_epi16(__A,__I,__U,__B); 
 }
 __m512i test_mm512_permutex2var_epi16(__m512i __A, __m512i __I, __m512i __B) {
   // CHECK-LABEL: @test_mm512_permutex2var_epi16
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.hi.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.hi.512
   return _mm512_permutex2var_epi16(__A,__I,__B); 
 }
 __m512i test_mm512_mask_permutex2var_epi16(__m512i __A, __mmask32 __U, __m512i __I, __m512i __B) {
   // CHECK-LABEL: @test_mm512_mask_permutex2var_epi16
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.hi.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.hi.512
+  // CHECK: select <32 x i1> %{{.*}}, <32 x i16> %{{.*}}, <32 x i16> %{{.*}}
   return _mm512_mask_permutex2var_epi16(__A,__U,__I,__B); 
 }
 __m512i test_mm512_maskz_permutex2var_epi16(__mmask32 __U, __m512i __A, __m512i __I, __m512i __B) {
   // CHECK-LABEL: @test_mm512_maskz_permutex2var_epi16
-  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.hi.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.hi.512
+  // CHECK: select <32 x i1> %{{.*}}, <32 x i16> %{{.*}}, <32 x i16> %{{.*}}
   return _mm512_maskz_permutex2var_epi16(__U,__A,__I,__B); 
 }
 

Modified: cfe/trunk/test/CodeGen/avx512f-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512f-builtins.c?rev=333387&r1=333386&r2=333387&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512f-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512f-builtins.c Mon May 28 20:26:38 2018
@@ -3246,7 +3246,8 @@ unsigned long long test_mm_cvt_roundsd_s
 #endif
 __m512i test_mm512_mask2_permutex2var_epi32(__m512i __A, __m512i __I, __mmask16 __U, __m512i __B) {
   // CHECK-LABEL: @test_mm512_mask2_permutex2var_epi32
-  // CHECK: @llvm.x86.avx512.mask.vpermi2var.d.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.d.512
+  // CHECK: select <16 x i1> %{{.*}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}}
   return _mm512_mask2_permutex2var_epi32(__A, __I, __U, __B); 
 }
 __m512i test_mm512_unpackhi_epi32(__m512i __A, __m512i __B) {
@@ -3270,7 +3271,8 @@ long long test_mm_cvt_roundsd_i64(__m128
 #endif
 __m512d test_mm512_mask2_permutex2var_pd(__m512d __A, __m512i __I, __mmask8 __U, __m512d __B) {
   // CHECK-LABEL: @test_mm512_mask2_permutex2var_pd
-  // CHECK: @llvm.x86.avx512.mask.vpermi2var.pd.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.pd.512
+  // CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
   return _mm512_mask2_permutex2var_pd(__A, __I, __U, __B); 
 }
 __m512i test_mm512_mask_unpackhi_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) {
@@ -3738,13 +3740,15 @@ __m256i test_mm512_maskz_cvt_roundpd_epu
 
 __m512 test_mm512_mask2_permutex2var_ps(__m512 __A, __m512i __I, __mmask16 __U, __m512 __B) {
   // CHECK-LABEL: @test_mm512_mask2_permutex2var_ps
-  // CHECK: @llvm.x86.avx512.mask.vpermi2var.ps.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.ps.512
+  // CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}}
   return _mm512_mask2_permutex2var_ps(__A, __I, __U, __B); 
 }
 
 __m512i test_mm512_mask2_permutex2var_epi64(__m512i __A, __m512i __I, __mmask8 __U, __m512i __B) {
   // CHECK-LABEL: @test_mm512_mask2_permutex2var_epi64
-  // CHECK: @llvm.x86.avx512.mask.vpermi2var.q.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.q.512
+  // CHECK: select <8 x i1> %{{.*}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}}
   return _mm512_mask2_permutex2var_epi64(__A, __I, __U, __B); 
 }
 
@@ -3828,68 +3832,88 @@ __m512 test_mm512_maskz_permutevar_ps(__
   return _mm512_maskz_permutevar_ps(__U, __A, __C); 
 }
 
+__m512i test_mm512_permutex2var_epi32(__m512i __A, __m512i __I, __m512i __B) {
+  // CHECK-LABEL: @test_mm512_permutex2var_epi32
+  // CHECK: @llvm.x86.avx512.vpermi2var.d.512
+  return _mm512_permutex2var_epi32(__A, __I, __B); 
+}
+
 __m512i test_mm512_maskz_permutex2var_epi32(__mmask16 __U, __m512i __A, __m512i __I, __m512i __B) {
   // CHECK-LABEL: @test_mm512_maskz_permutex2var_epi32
-  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.d.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.d.512
+  // CHECK: select <16 x i1> %{{.*}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}}
   return _mm512_maskz_permutex2var_epi32(__U, __A, __I, __B); 
 }
 
 __m512i test_mm512_mask_permutex2var_epi32 (__m512i __A, __mmask16 __U, __m512i __I, __m512i __B)
 {
   // CHECK-LABEL: @test_mm512_mask_permutex2var_epi32 
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.d.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.d.512
+  // CHECK: select <16 x i1> %{{.*}}, <16 x i32> %{{.*}}, <16 x i32> %{{.*}}
   return _mm512_mask_permutex2var_epi32 (__A,__U,__I,__B);
 }
 
 __m512d test_mm512_permutex2var_pd (__m512d __A, __m512i __I, __m512d __B)
 {
   // CHECK-LABEL: @test_mm512_permutex2var_pd 
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.pd.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.pd.512
   return _mm512_permutex2var_pd (__A, __I,__B);
 }
 
 __m512d test_mm512_mask_permutex2var_pd (__m512d __A, __mmask8 __U, __m512i __I, __m512d __B)
 {
   // CHECK-LABEL: @test_mm512_mask_permutex2var_pd 
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.pd.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.pd.512
+  // CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
   return _mm512_mask_permutex2var_pd (__A,__U,__I,__B);
 }
 
 __m512d test_mm512_maskz_permutex2var_pd(__mmask8 __U, __m512d __A, __m512i __I, __m512d __B) {
   // CHECK-LABEL: @test_mm512_maskz_permutex2var_pd
-  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.pd.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.pd.512
+  // CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
   return _mm512_maskz_permutex2var_pd(__U, __A, __I, __B); 
 }
 
 __m512 test_mm512_permutex2var_ps (__m512 __A, __m512i __I, __m512 __B)
 {
   // CHECK-LABEL: @test_mm512_permutex2var_ps 
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.ps.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.ps.512
   return _mm512_permutex2var_ps (__A, __I, __B);
 }
 
 __m512 test_mm512_mask_permutex2var_ps (__m512 __A, __mmask16 __U, __m512i __I, __m512 __B)
 {
   // CHECK-LABEL: @test_mm512_mask_permutex2var_ps 
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.ps.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.ps.512
+  // CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}}
   return _mm512_mask_permutex2var_ps (__A,__U,__I,__B);
 }
 
 __m512 test_mm512_maskz_permutex2var_ps(__mmask16 __U, __m512 __A, __m512i __I, __m512 __B) {
   // CHECK-LABEL: @test_mm512_maskz_permutex2var_ps
-  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.ps.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.ps.512
+  // CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}}
   return _mm512_maskz_permutex2var_ps(__U, __A, __I, __B); 
 }
 
+__m512i test_mm512_permutex2var_epi64 (__m512i __A, __m512i __I, __m512i __B){
+  // CHECK-LABEL: @test_mm512_permutex2var_epi64
+  // CHECK: @llvm.x86.avx512.vpermi2var.q.512
+  return _mm512_permutex2var_epi64(__A, __I, __B);
+}
+
 __m512i test_mm512_mask_permutex2var_epi64 (__m512i __A, __mmask8 __U, __m512i __I, __m512i __B){
   // CHECK-LABEL: @test_mm512_mask_permutex2var_epi64
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.q.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.q.512
+  // CHECK: select <8 x i1> %{{.*}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}}
   return _mm512_mask_permutex2var_epi64(__A, __U, __I, __B);
 }
 
 __m512i test_mm512_maskz_permutex2var_epi64(__mmask8 __U, __m512i __A, __m512i __I, __m512i __B) {
   // CHECK-LABEL: @test_mm512_maskz_permutex2var_epi64
-  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.q.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.q.512
+  // CHECK: select <8 x i1> %{{.*}}, <8 x i64> %{{.*}}, <8 x i64> %{{.*}}
   return _mm512_maskz_permutex2var_epi64(__U, __A, __I, __B);
 }
 __mmask16 test_mm512_testn_epi32_mask(__m512i __A, __m512i __B) {

Modified: cfe/trunk/test/CodeGen/avx512vbmi-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512vbmi-builtins.c?rev=333387&r1=333386&r2=333387&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512vbmi-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512vbmi-builtins.c Mon May 28 20:26:38 2018
@@ -5,25 +5,28 @@
 
 __m512i test_mm512_mask2_permutex2var_epi8(__m512i __A, __m512i __I, __mmask64 __U, __m512i __B) {
   // CHECK-LABEL: @test_mm512_mask2_permutex2var_epi8
-  // CHECK: @llvm.x86.avx512.mask.vpermi2var.qi.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.qi.512
+  // CHECK: select <64 x i1> %{{.*}}, <64 x i8> %{{.*}}, <64 x i8> %{{.*}}
   return _mm512_mask2_permutex2var_epi8(__A, __I, __U, __B); 
 }
 
 __m512i test_mm512_permutex2var_epi8(__m512i __A, __m512i __I, __m512i __B) {
   // CHECK-LABEL: @test_mm512_permutex2var_epi8
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.qi.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.qi.512
   return _mm512_permutex2var_epi8(__A, __I, __B); 
 }
 
 __m512i test_mm512_mask_permutex2var_epi8(__m512i __A, __mmask64 __U, __m512i __I, __m512i __B) {
   // CHECK-LABEL: @test_mm512_mask_permutex2var_epi8
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.qi.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.qi.512
+  // CHECK: select <64 x i1> %{{.*}}, <64 x i8> %{{.*}}, <64 x i8> %{{.*}}
   return _mm512_mask_permutex2var_epi8(__A, __U, __I, __B); 
 }
 
 __m512i test_mm512_maskz_permutex2var_epi8(__mmask64 __U, __m512i __A, __m512i __I, __m512i __B) {
   // CHECK-LABEL: @test_mm512_maskz_permutex2var_epi8
-  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.qi.512
+  // CHECK: @llvm.x86.avx512.vpermi2var.qi.512
+  // CHECK: select <64 x i1> %{{.*}}, <64 x i8> %{{.*}}, <64 x i8> %{{.*}}
   return _mm512_maskz_permutex2var_epi8(__U, __A, __I, __B); 
 }
 

Modified: cfe/trunk/test/CodeGen/avx512vbmivl-builtin.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512vbmivl-builtin.c?rev=333387&r1=333386&r2=333387&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512vbmivl-builtin.c (original)
+++ cfe/trunk/test/CodeGen/avx512vbmivl-builtin.c Mon May 28 20:26:38 2018
@@ -45,49 +45,55 @@ __m256i test_mm256_mask_permutexvar_epi8
 
 __m128i test_mm_mask2_permutex2var_epi8(__m128i __A, __m128i __I, __mmask16 __U, __m128i __B) {
   // CHECK-LABEL: @test_mm_mask2_permutex2var_epi8
-  // CHECK: @llvm.x86.avx512.mask.vpermi2var.qi.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.qi.128
+  // CHECK: select <16 x i1> %{{.*}}, <16 x i8> %{{.*}}, <16 x i8> %{{.*}}
   return _mm_mask2_permutex2var_epi8(__A, __I, __U, __B); 
 }
 
 __m256i test_mm256_mask2_permutex2var_epi8(__m256i __A, __m256i __I, __mmask32 __U, __m256i __B) {
   // CHECK-LABEL: @test_mm256_mask2_permutex2var_epi8
-  // CHECK: @llvm.x86.avx512.mask.vpermi2var.qi.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.qi.256
+  // CHECK: select <32 x i1> %{{.*}}, <32 x i8> %{{.*}}, <32 x i8> %{{.*}}
   return _mm256_mask2_permutex2var_epi8(__A, __I, __U, __B); 
 }
 
 __m128i test_mm_permutex2var_epi8(__m128i __A, __m128i __I, __m128i __B) {
   // CHECK-LABEL: @test_mm_permutex2var_epi8
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.qi.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.qi.128
   return _mm_permutex2var_epi8(__A, __I, __B); 
 }
 
 __m128i test_mm_mask_permutex2var_epi8(__m128i __A, __mmask16 __U, __m128i __I, __m128i __B) {
   // CHECK-LABEL: @test_mm_mask_permutex2var_epi8
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.qi.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.qi.128
+  // CHECK: select <16 x i1> %{{.*}}, <16 x i8> %{{.*}}, <16 x i8> %{{.*}}
   return _mm_mask_permutex2var_epi8(__A, __U, __I, __B); 
 }
 
 __m128i test_mm_maskz_permutex2var_epi8(__mmask16 __U, __m128i __A, __m128i __I, __m128i __B) {
   // CHECK-LABEL: @test_mm_maskz_permutex2var_epi8
-  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.qi.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.qi.128
+  // CHECK: select <16 x i1> %{{.*}}, <16 x i8> %{{.*}}, <16 x i8> %{{.*}}
   return _mm_maskz_permutex2var_epi8(__U, __A, __I, __B); 
 }
 
 __m256i test_mm256_permutex2var_epi8(__m256i __A, __m256i __I, __m256i __B) {
   // CHECK-LABEL: @test_mm256_permutex2var_epi8
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.qi.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.qi.256
   return _mm256_permutex2var_epi8(__A, __I, __B); 
 }
 
 __m256i test_mm256_mask_permutex2var_epi8(__m256i __A, __mmask32 __U, __m256i __I, __m256i __B) {
   // CHECK-LABEL: @test_mm256_mask_permutex2var_epi8
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.qi.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.qi.256
+  // CHECK: select <32 x i1> %{{.*}}, <32 x i8> %{{.*}}, <32 x i8> %{{.*}}
   return _mm256_mask_permutex2var_epi8(__A, __U, __I, __B); 
 }
 
 __m256i test_mm256_maskz_permutex2var_epi8(__mmask32 __U, __m256i __A, __m256i __I, __m256i __B) {
   // CHECK-LABEL: @test_mm256_maskz_permutex2var_epi8
-  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.qi.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.qi.256
+  // CHECK: select <32 x i1> %{{.*}}, <32 x i8> %{{.*}}, <32 x i8> %{{.*}}
   return _mm256_maskz_permutex2var_epi8(__U, __A, __I, __B); 
 }
 

Modified: cfe/trunk/test/CodeGen/avx512vl-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512vl-builtins.c?rev=333387&r1=333386&r2=333387&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512vl-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512vl-builtins.c Mon May 28 20:26:38 2018
@@ -3284,162 +3284,186 @@ __m256 test_mm256_maskz_sub_ps(__mmask8
 }
 __m128i test_mm_mask2_permutex2var_epi32(__m128i __A, __m128i __I, __mmask8 __U,  __m128i __B) {
   // CHECK-LABEL: @test_mm_mask2_permutex2var_epi32
-  // CHECK: @llvm.x86.avx512.mask.vpermi2var.d.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.d.128
+  // CHECK: select <4 x i1> %{{.*}}, <4 x i32> %{{.*}}, <4 x i32> %{{.*}}
   return _mm_mask2_permutex2var_epi32(__A,__I,__U,__B); 
 }
 __m256i test_mm256_mask2_permutex2var_epi32(__m256i __A, __m256i __I, __mmask8 __U, __m256i __B) {
   // CHECK-LABEL: @test_mm256_mask2_permutex2var_epi32
-  // CHECK: @llvm.x86.avx512.mask.vpermi2var.d.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.d.256
+  // CHECK: select <8 x i1> %{{.*}}, <8 x i32> %{{.*}}, <8 x i32> %{{.*}}
   return _mm256_mask2_permutex2var_epi32(__A,__I,__U,__B); 
 }
 __m128d test_mm_mask2_permutex2var_pd(__m128d __A, __m128i __I, __mmask8 __U, __m128d __B) {
   // CHECK-LABEL: @test_mm_mask2_permutex2var_pd
-  // CHECK: @llvm.x86.avx512.mask.vpermi2var.pd.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.pd.128
+  // CHECK: select <2 x i1> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}}
   return _mm_mask2_permutex2var_pd(__A,__I,__U,__B); 
 }
 __m256d test_mm256_mask2_permutex2var_pd(__m256d __A, __m256i __I, __mmask8 __U,  __m256d __B) {
   // CHECK-LABEL: @test_mm256_mask2_permutex2var_pd
-  // CHECK: @llvm.x86.avx512.mask.vpermi2var.pd.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.pd.256
+  // CHECK: select <4 x i1> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}}
   return _mm256_mask2_permutex2var_pd(__A,__I,__U,__B); 
 }
 __m128 test_mm_mask2_permutex2var_ps(__m128 __A, __m128i __I, __mmask8 __U, __m128 __B) {
   // CHECK-LABEL: @test_mm_mask2_permutex2var_ps
-  // CHECK: @llvm.x86.avx512.mask.vpermi2var.ps.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.ps.128
+  // CHECK: select <4 x i1> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}
   return _mm_mask2_permutex2var_ps(__A,__I,__U,__B); 
 }
 __m256 test_mm256_mask2_permutex2var_ps(__m256 __A, __m256i __I, __mmask8 __U,  __m256 __B) {
   // CHECK-LABEL: @test_mm256_mask2_permutex2var_ps
-  // CHECK: @llvm.x86.avx512.mask.vpermi2var.ps.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.ps.256
+  // CHECK: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
   return _mm256_mask2_permutex2var_ps(__A,__I,__U,__B); 
 }
 __m128i test_mm_mask2_permutex2var_epi64(__m128i __A, __m128i __I, __mmask8 __U,  __m128i __B) {
   // CHECK-LABEL: @test_mm_mask2_permutex2var_epi64
-  // CHECK: @llvm.x86.avx512.mask.vpermi2var.q.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.q.128
+  // CHECK: select <2 x i1> %{{.*}}, <2 x i64> %{{.*}}, <2 x i64> %{{.*}}
   return _mm_mask2_permutex2var_epi64(__A,__I,__U,__B); 
 }
 __m256i test_mm256_mask2_permutex2var_epi64(__m256i __A, __m256i __I, __mmask8 __U, __m256i __B) {
   // CHECK-LABEL: @test_mm256_mask2_permutex2var_epi64
-  // CHECK: @llvm.x86.avx512.mask.vpermi2var.q.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.q.256
+  // CHECK: select <4 x i1> %{{.*}}, <4 x i64> %{{.*}}, <4 x i64> %{{.*}}
   return _mm256_mask2_permutex2var_epi64(__A,__I,__U,__B); 
 }
 __m128i test_mm_permutex2var_epi32(__m128i __A, __m128i __I, __m128i __B) {
   // CHECK-LABEL: @test_mm_permutex2var_epi32
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.d.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.d.128
   return _mm_permutex2var_epi32(__A,__I,__B); 
 }
 __m128i test_mm_mask_permutex2var_epi32(__m128i __A, __mmask8 __U, __m128i __I, __m128i __B) {
   // CHECK-LABEL: @test_mm_mask_permutex2var_epi32
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.d.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.d.128
+  // CHECK: select <4 x i1> %{{.*}}, <4 x i32> %{{.*}}, <4 x i32> %{{.*}}
   return _mm_mask_permutex2var_epi32(__A,__U,__I,__B); 
 }
 __m128i test_mm_maskz_permutex2var_epi32(__mmask8 __U, __m128i __A, __m128i __I,  __m128i __B) {
   // CHECK-LABEL: @test_mm_maskz_permutex2var_epi32
-  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.d.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.d.128
+  // CHECK: select <4 x i1> %{{.*}}, <4 x i32> %{{.*}}, <4 x i32> %{{.*}}
   return _mm_maskz_permutex2var_epi32(__U,__A,__I,__B); 
 }
 __m256i test_mm256_permutex2var_epi32(__m256i __A, __m256i __I, __m256i __B) {
   // CHECK-LABEL: @test_mm256_permutex2var_epi32
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.d.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.d.256
   return _mm256_permutex2var_epi32(__A,__I,__B); 
 }
 __m256i test_mm256_mask_permutex2var_epi32(__m256i __A, __mmask8 __U, __m256i __I, __m256i __B) {
   // CHECK-LABEL: @test_mm256_mask_permutex2var_epi32
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.d.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.d.256
+  // CHECK: select <8 x i1> %{{.*}}, <8 x i32> %{{.*}}, <8 x i32> %{{.*}}
   return _mm256_mask_permutex2var_epi32(__A,__U,__I,__B); 
 }
 __m256i test_mm256_maskz_permutex2var_epi32(__mmask8 __U, __m256i __A, __m256i __I, __m256i __B) {
   // CHECK-LABEL: @test_mm256_maskz_permutex2var_epi32
-  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.d.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.d.256
+  // CHECK: select <8 x i1> %{{.*}}, <8 x i32> %{{.*}}, <8 x i32> %{{.*}}
   return _mm256_maskz_permutex2var_epi32(__U,__A,__I,__B); 
 }
 __m128d test_mm_permutex2var_pd(__m128d __A, __m128i __I, __m128d __B) {
   // CHECK-LABEL: @test_mm_permutex2var_pd
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.pd.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.pd.128
   return _mm_permutex2var_pd(__A,__I,__B); 
 }
 __m128d test_mm_mask_permutex2var_pd(__m128d __A, __mmask8 __U, __m128i __I, __m128d __B) {
   // CHECK-LABEL: @test_mm_mask_permutex2var_pd
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.pd.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.pd.128
+  // CHECK: select <2 x i1> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}}
   return _mm_mask_permutex2var_pd(__A,__U,__I,__B); 
 }
 __m128d test_mm_maskz_permutex2var_pd(__mmask8 __U, __m128d __A, __m128i __I, __m128d __B) {
   // CHECK-LABEL: @test_mm_maskz_permutex2var_pd
-  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.pd.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.pd.128
+  // CHECK: select <2 x i1> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}}
   return _mm_maskz_permutex2var_pd(__U,__A,__I,__B); 
 }
 __m256d test_mm256_permutex2var_pd(__m256d __A, __m256i __I, __m256d __B) {
   // CHECK-LABEL: @test_mm256_permutex2var_pd
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.pd.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.pd.256
   return _mm256_permutex2var_pd(__A,__I,__B); 
 }
 __m256d test_mm256_mask_permutex2var_pd(__m256d __A, __mmask8 __U, __m256i __I, __m256d __B) {
   // CHECK-LABEL: @test_mm256_mask_permutex2var_pd
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.pd.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.pd.256
+  // CHECK: select <4 x i1> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}}
   return _mm256_mask_permutex2var_pd(__A,__U,__I,__B); 
 }
 __m256d test_mm256_maskz_permutex2var_pd(__mmask8 __U, __m256d __A, __m256i __I,  __m256d __B) {
   // CHECK-LABEL: @test_mm256_maskz_permutex2var_pd
-  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.pd.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.pd.256
+  // CHECK: select <4 x i1> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}}
   return _mm256_maskz_permutex2var_pd(__U,__A,__I,__B); 
 }
 __m128 test_mm_permutex2var_ps(__m128 __A, __m128i __I, __m128 __B) {
   // CHECK-LABEL: @test_mm_permutex2var_ps
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.ps.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.ps.128
   return _mm_permutex2var_ps(__A,__I,__B); 
 }
 __m128 test_mm_mask_permutex2var_ps(__m128 __A, __mmask8 __U, __m128i __I, __m128 __B) {
   // CHECK-LABEL: @test_mm_mask_permutex2var_ps
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.ps.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.ps.128
+  // CHECK: select <4 x i1> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}
   return _mm_mask_permutex2var_ps(__A,__U,__I,__B); 
 }
 __m128 test_mm_maskz_permutex2var_ps(__mmask8 __U, __m128 __A, __m128i __I, __m128 __B) {
   // CHECK-LABEL: @test_mm_maskz_permutex2var_ps
-  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.ps.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.ps.128
+  // CHECK: select <4 x i1> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}
   return _mm_maskz_permutex2var_ps(__U,__A,__I,__B); 
 }
 __m256 test_mm256_permutex2var_ps(__m256 __A, __m256i __I, __m256 __B) {
   // CHECK-LABEL: @test_mm256_permutex2var_ps
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.ps.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.ps.256
   return _mm256_permutex2var_ps(__A,__I,__B); 
 }
 __m256 test_mm256_mask_permutex2var_ps(__m256 __A, __mmask8 __U, __m256i __I, __m256 __B) {
   // CHECK-LABEL: @test_mm256_mask_permutex2var_ps
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.ps.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.ps.256
+  // CHECK: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
   return _mm256_mask_permutex2var_ps(__A,__U,__I,__B); 
 }
 __m256 test_mm256_maskz_permutex2var_ps(__mmask8 __U, __m256 __A, __m256i __I, __m256 __B) {
   // CHECK-LABEL: @test_mm256_maskz_permutex2var_ps
-  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.ps.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.ps.256
+  // CHECK: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
   return _mm256_maskz_permutex2var_ps(__U,__A,__I,__B); 
 }
 __m128i test_mm_permutex2var_epi64(__m128i __A, __m128i __I, __m128i __B) {
   // CHECK-LABEL: @test_mm_permutex2var_epi64
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.q.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.q.128
   return _mm_permutex2var_epi64(__A,__I,__B); 
 }
 __m128i test_mm_mask_permutex2var_epi64(__m128i __A, __mmask8 __U, __m128i __I, __m128i __B) {
   // CHECK-LABEL: @test_mm_mask_permutex2var_epi64
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.q.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.q.128
+  // CHECK: select <2 x i1> %{{.*}}, <2 x i64> %{{.*}}, <2 x i64> %{{.*}}
   return _mm_mask_permutex2var_epi64(__A,__U,__I,__B); 
 }
 __m128i test_mm_maskz_permutex2var_epi64(__mmask8 __U, __m128i __A, __m128i __I, __m128i __B) {
   // CHECK-LABEL: @test_mm_maskz_permutex2var_epi64
-  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.q.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.q.128
+  // CHECK: select <2 x i1> %{{.*}}, <2 x i64> %{{.*}}, <2 x i64> %{{.*}}
   return _mm_maskz_permutex2var_epi64(__U,__A,__I,__B); 
 }
 __m256i test_mm256_permutex2var_epi64(__m256i __A, __m256i __I, __m256i __B) {
   // CHECK-LABEL: @test_mm256_permutex2var_epi64
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.q.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.q.256
   return _mm256_permutex2var_epi64(__A,__I,__B); 
 }
 __m256i test_mm256_mask_permutex2var_epi64(__m256i __A, __mmask8 __U, __m256i __I, __m256i __B) {
   // CHECK-LABEL: @test_mm256_mask_permutex2var_epi64
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.q.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.q.256
+  // CHECK: select <4 x i1> %{{.*}}, <4 x i64> %{{.*}}, <4 x i64> %{{.*}}
   return _mm256_mask_permutex2var_epi64(__A,__U,__I,__B); 
 }
 __m256i test_mm256_maskz_permutex2var_epi64(__mmask8 __U, __m256i __A, __m256i __I, __m256i __B) {
   // CHECK-LABEL: @test_mm256_maskz_permutex2var_epi64
-  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.q.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.q.256
+  // CHECK: select <4 x i1> %{{.*}}, <4 x i64> %{{.*}}, <4 x i64> %{{.*}}
   return _mm256_maskz_permutex2var_epi64(__U,__A,__I,__B); 
 }
 

Modified: cfe/trunk/test/CodeGen/avx512vlbw-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512vlbw-builtins.c?rev=333387&r1=333386&r2=333387&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512vlbw-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512vlbw-builtins.c Mon May 28 20:26:38 2018
@@ -1617,43 +1617,49 @@ __m256i test_mm256_maskz_subs_epu16(__mm
 
 __m128i test_mm_mask2_permutex2var_epi16(__m128i __A, __m128i __I, __mmask8 __U,            __m128i __B) {
   // CHECK-LABEL: @test_mm_mask2_permutex2var_epi16
-  // CHECK: @llvm.x86.avx512.mask.vpermi2var.hi.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.hi.128
+  // CHECK: select <8 x i1> %{{.*}}, <8 x i16> %{{.*}}, <8 x i16> %{{.*}}
   return _mm_mask2_permutex2var_epi16(__A,__I,__U,__B); 
 }
 __m256i test_mm256_mask2_permutex2var_epi16(__m256i __A, __m256i __I,         __mmask16 __U, __m256i __B) {
   // CHECK-LABEL: @test_mm256_mask2_permutex2var_epi16
-  // CHECK: @llvm.x86.avx512.mask.vpermi2var.hi.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.hi.256
+  // CHECK: select <16 x i1> %{{.*}}, <16 x i16> %{{.*}}, <16 x i16> %{{.*}}
   return _mm256_mask2_permutex2var_epi16(__A,__I,__U,__B); 
 }
 __m128i test_mm_permutex2var_epi16(__m128i __A, __m128i __I, __m128i __B) {
   // CHECK-LABEL: @test_mm_permutex2var_epi16
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.hi.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.hi.128
   return _mm_permutex2var_epi16(__A,__I,__B); 
 }
 __m128i test_mm_mask_permutex2var_epi16(__m128i __A, __mmask8 __U, __m128i __I,           __m128i __B) {
   // CHECK-LABEL: @test_mm_mask_permutex2var_epi16
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.hi.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.hi.128
+  // CHECK: select <8 x i1> %{{.*}}, <8 x i16> %{{.*}}, <8 x i16> %{{.*}}
   return _mm_mask_permutex2var_epi16(__A,__U,__I,__B); 
 }
 __m128i test_mm_maskz_permutex2var_epi16(__mmask8 __U, __m128i __A, __m128i __I,            __m128i __B) {
   // CHECK-LABEL: @test_mm_maskz_permutex2var_epi16
-  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.hi.128
+  // CHECK: @llvm.x86.avx512.vpermi2var.hi.128
+  // CHECK: select <8 x i1> %{{.*}}, <8 x i16> %{{.*}}, <8 x i16> %{{.*}}
   return _mm_maskz_permutex2var_epi16(__U,__A,__I,__B); 
 }
 
 __m256i test_mm256_permutex2var_epi16(__m256i __A, __m256i __I, __m256i __B) {
   // CHECK-LABEL: @test_mm256_permutex2var_epi16
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.hi.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.hi.256
   return _mm256_permutex2var_epi16(__A,__I,__B); 
 }
 __m256i test_mm256_mask_permutex2var_epi16(__m256i __A, __mmask16 __U,        __m256i __I, __m256i __B) {
   // CHECK-LABEL: @test_mm256_mask_permutex2var_epi16
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.hi.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.hi.256
+  // CHECK: select <16 x i1> %{{.*}}, <16 x i16> %{{.*}}, <16 x i16> %{{.*}}
   return _mm256_mask_permutex2var_epi16(__A,__U,__I,__B); 
 }
 __m256i test_mm256_maskz_permutex2var_epi16(__mmask16 __U, __m256i __A,         __m256i __I, __m256i __B) {
   // CHECK-LABEL: @test_mm256_maskz_permutex2var_epi16
-  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.hi.256
+  // CHECK: @llvm.x86.avx512.vpermi2var.hi.256
+  // CHECK: select <16 x i1> %{{.*}}, <16 x i16> %{{.*}}, <16 x i16> %{{.*}}
   return _mm256_maskz_permutex2var_epi16(__U,__A,__I,__B); 
 }
 __m128i test_mm_mask_maddubs_epi16(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y) {




More information about the cfe-commits mailing list