[Clang][Builtin][AVX512]Adding intrinsics for vfpclass{sd|ss} vfpclass{pd|ps} instruc...
authorMichael Zuckerman <Michael.zuckerman@intel.com>
Mon, 25 Apr 2016 14:48:23 +0000 (14:48 +0000)
committerMichael Zuckerman <Michael.zuckerman@intel.com>
Mon, 25 Apr 2016 14:48:23 +0000 (14:48 +0000)
Differential Revision: http://reviews.llvm.org/D19476

llvm-svn: 267414

clang/include/clang/Basic/BuiltinsX86.def
clang/lib/Headers/avx512dqintrin.h
clang/lib/Headers/avx512vldqintrin.h
clang/test/CodeGen/avx512dq-builtins.c
clang/test/CodeGen/avx512vldq-builtins.c

index 44bb153..c88e8c8 100644 (file)
@@ -2169,6 +2169,14 @@ TARGET_BUILTIN(__builtin_ia32_permvardf256_mask, "V4dV4dV4LLiV4dUc","","avx512vl
 TARGET_BUILTIN(__builtin_ia32_permvardi256_mask, "V4LLiV4LLiV4LLiV4LLiUc","","avx512vl")
 TARGET_BUILTIN(__builtin_ia32_permvarsf256_mask, "V8fV8fV8iV8fUc","","avx512vl")
 TARGET_BUILTIN(__builtin_ia32_permvarsi256_mask, "V8iV8iV8iV8iUc","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_fpclasspd128_mask, "UcV2dIiUc","","avx512dq,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_fpclasspd256_mask, "UcV4dIiUc","","avx512dq,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_fpclassps128_mask, "UcV4fIiUc","","avx512dq,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_fpclassps256_mask, "UcV8fIiUc","","avx512dq,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_fpclassps512_mask, "UsV16fIiUs","","avx512dq")
+TARGET_BUILTIN(__builtin_ia32_fpclasspd512_mask, "UcV8dIiUc","","avx512dq")
+TARGET_BUILTIN(__builtin_ia32_fpclasssd_mask, "UcV2dIiUc","","avx512dq")
+TARGET_BUILTIN(__builtin_ia32_fpclassss_mask, "UcV4fIiUc","","avx512dq")
 
 #undef BUILTIN
 #undef TARGET_BUILTIN
index 7e91ed2..ab970f1 100644 (file)
@@ -1099,6 +1099,45 @@ __builtin_ia32_inserti64x2_512_mask ((__v8di)( __A),\
                 (__mmask8) ( __U));\
 })
 
+#define _mm512_mask_fpclass_ps_mask( __U, __A, __imm) __extension__ ({ \
+__builtin_ia32_fpclassps512_mask ((__v16sf)( __A),\
+                  ( __imm),\
+                  ( __U));\
+})
+
+#define _mm512_fpclass_ps_mask( __A, __imm) __extension__ ({ \
+__builtin_ia32_fpclassps512_mask ((__v16sf)( __A),\
+                   ( __imm),\
+                   (__mmask16) -1);\
+})
+
+#define _mm512_mask_fpclass_pd_mask( __U, __A, __imm) __extension__ ({ \
+__builtin_ia32_fpclasspd512_mask ((__v8df)( __A),\
+                  ( __imm),( __U));\
+})
+
+#define _mm512_fpclass_pd_mask( __A, __imm) __extension__ ({ \
+__builtin_ia32_fpclasspd512_mask ((__v8df)( __A),\
+                  ( __imm),\
+                  (__mmask8) -1);\
+})
+
+#define _mm_fpclass_sd_mask( __A, __imm) __extension__ ({ \
+__builtin_ia32_fpclasssd_mask ((__v2df)( __A), ( __imm), (__mmask8) -1);\
+})
+
+#define _mm_mask_fpclass_sd_mask( __U,__A, __imm) __extension__ ({ \
+__builtin_ia32_fpclasssd_mask ((__v2df)( __A), ( __imm), (__mmask8) __U);\
+})
+
+#define _mm_fpclass_ss_mask( __A, __imm) __extension__ ({ \
+__builtin_ia32_fpclassss_mask ((__v4sf)( __A), ( __imm), (__mmask8) -1);\
+})
+
+#define _mm_mask_fpclass_ss_mask(__U ,__A, __imm) __extension__ ({ \
+__builtin_ia32_fpclassss_mask ((__v4sf)( __A), ( __imm), (__mmask8) __U);\
+})
+
 #undef __DEFAULT_FN_ATTRS
 
 #endif
index 12bf528..3c28df8 100644 (file)
@@ -1206,6 +1206,50 @@ __builtin_ia32_inserti64x2_256_mask ((__v4di)( __A),\
               (__mmask8) ( __U));\
 })
 
+#define _mm_mask_fpclass_pd_mask( __U, __A, __imm) __extension__ ({ \
+__builtin_ia32_fpclasspd128_mask ((__v2df)( __A),\
+                 ( __imm),( __U));\
+})
+
+#define _mm_fpclass_pd_mask( __A, __imm) __extension__ ({ \
+__builtin_ia32_fpclasspd128_mask ((__v2df)( __A),\
+                  ( __imm),\
+                  (__mmask8) -1);\
+})
+
+#define _mm256_mask_fpclass_pd_mask( __U, __A, __imm) __extension__ ({ \
+__builtin_ia32_fpclasspd256_mask ((__v4df)( __A),\
+                  ( __imm),( __U));\
+})
+
+#define _mm256_fpclass_pd_mask( __A, __imm) __extension__ ({ \
+__builtin_ia32_fpclasspd256_mask ((__v4df)( __A),\
+                  ( __imm),\
+                  (__mmask8) -1);\
+})
+
+#define _mm_mask_fpclass_ps_mask( __U, __A, __imm) __extension__ ({ \
+__builtin_ia32_fpclassps128_mask ((__v4sf)( __A),\
+                  ( __imm),( __U));\
+})
+
+#define _mm_fpclass_ps_mask( __A, __imm) __extension__ ({ \
+__builtin_ia32_fpclassps128_mask ((__v4sf)( __A),\
+                  ( __imm),\
+                  (__mmask8) -1);\
+})
+
+#define _mm256_mask_fpclass_ps_mask( __U, __A, __imm) __extension__ ({ \
+__builtin_ia32_fpclassps256_mask ((__v8sf)( __A),\
+                  ( __imm),( __U));\
+})
+
+#define _mm256_fpclass_ps_mask( __A, __imm) __extension__ ({ \
+__builtin_ia32_fpclassps256_mask ((__v8sf)( __A),\
+                  ( __imm),\
+                  (__mmask8) -1);\
+})
+
 #undef __DEFAULT_FN_ATTRS
 
 #endif
index d8bbd02..f9cc917 100644 (file)
@@ -999,3 +999,51 @@ __m512i test_mm512_maskz_inserti64x2(__mmask8 __U, __m512i __A, __m128i __B) {
   // CHECK: @llvm.x86.avx512.mask.inserti64x2
   return _mm512_maskz_inserti64x2(__U, __A, __B, 1); 
 }
+__mmask8 test_mm512_mask_fpclass_pd_mask(__mmask8 __U, __m512d __A) {
+  // CHECK-LABEL: @test_mm512_mask_fpclass_pd_mask
+  // CHECK: @llvm.x86.avx512.mask.fpclass.pd.512
+  return _mm512_mask_fpclass_pd_mask(__U, __A, 4); 
+}
+
+__mmask8 test_mm512_fpclass_pd_mask(__m512d __A) {
+  // CHECK-LABEL: @test_mm512_fpclass_pd_mask
+  // CHECK: @llvm.x86.avx512.mask.fpclass.pd.512
+  return _mm512_fpclass_pd_mask(__A, 4); 
+}
+
+__mmask16 test_mm512_mask_fpclass_ps_mask(__mmask16 __U, __m512 __A) {
+  // CHECK-LABEL: @test_mm512_mask_fpclass_ps_mask
+  // CHECK: @llvm.x86.avx512.mask.fpclass.ps.512
+  return _mm512_mask_fpclass_ps_mask(__U, __A, 4); 
+}
+
+__mmask16 test_mm512_fpclass_ps_mask(__m512 __A) {
+  // CHECK-LABEL: @test_mm512_fpclass_ps_mask
+  // CHECK: @llvm.x86.avx512.mask.fpclass.ps.512
+  return _mm512_fpclass_ps_mask(__A, 4); 
+}
+
+__mmask8 test_mm_fpclass_sd_mask(__m128 __A)  { 
+  // CHECK-LABEL: @test_mm_fpclass_sd_mask
+  // CHECK: @llvm.x86.avx512.mask.fpclass.sd
+ return _mm_fpclass_sd_mask (__A, 2);
+}
+
+__mmask8 test_mm_mask_fpclass_sd_mask(__mmask8 __U, __m128 __A)  {
+ // CHECK-LABEL: @test_mm_mask_fpclass_sd_mask
+ // CHECK: @llvm.x86.avx512.mask.fpclass.sd
+ return _mm_mask_fpclass_sd_mask (__U,  __A, 2);
+}
+
+__mmask8 test_mm_fpclass_ss_mask(__m128 __A)  { 
+ // CHECK-LABEL: @test_mm_fpclass_ss_mask
+ // CHECK: @llvm.x86.avx512.mask.fpclass.ss
+ return _mm_fpclass_ss_mask ( __A, 2);
+}
+
+__mmask8 test_mm_mask_fpclass_ss_mask(__mmask8 __U, __m128 __A)  {
+ // CHECK-LABEL: @test_mm_mask_fpclass_ss_mask
+ // CHECK: @llvm.x86.avx512.mask.fpclass.ss
+ return _mm_mask_fpclass_ss_mask (__U, __A, 2);
+}
+
index c6f7f9a..fa1e062 100644 (file)
@@ -1019,3 +1019,51 @@ __m256i test_mm256_maskz_inserti64x2(__mmask8 __U, __m256i __A, __m128i __B) {
   // CHECK: @llvm.x86.avx512.mask.inserti64x2
   return _mm256_maskz_inserti64x2(__U, __A, __B, 1); 
 }
+
+__mmask8 test_mm_mask_fpclass_pd_mask(__mmask8 __U, __m128d __A) {
+  // CHECK-LABEL: @test_mm_mask_fpclass_pd_mask
+  // CHECK: @llvm.x86.avx512.mask.fpclass.pd.128
+  return _mm_mask_fpclass_pd_mask(__U, __A, 2); 
+}
+
+__mmask8 test_mm_fpclass_pd_mask(__m128d __A) {
+  // CHECK-LABEL: @test_mm_fpclass_pd_mask
+  // CHECK: @llvm.x86.avx512.mask.fpclass.pd.128
+  return _mm_fpclass_pd_mask(__A, 2); 
+}
+
+__mmask8 test_mm256_mask_fpclass_pd_mask(__mmask8 __U, __m256d __A) {
+  // CHECK-LABEL: @test_mm256_mask_fpclass_pd_mask
+  // CHECK: @llvm.x86.avx512.mask.fpclass.pd.256
+  return _mm256_mask_fpclass_pd_mask(__U, __A, 2); 
+}
+
+__mmask8 test_mm256_fpclass_pd_mask(__m256d __A) {
+  // CHECK-LABEL: @test_mm256_fpclass_pd_mask
+  // CHECK: @llvm.x86.avx512.mask.fpclass.pd.256
+  return _mm256_fpclass_pd_mask(__A, 2); 
+}
+
+__mmask8 test_mm_mask_fpclass_ps_mask(__mmask8 __U, __m128 __A) {
+  // CHECK-LABEL: @test_mm_mask_fpclass_ps_mask
+  // CHECK: @llvm.x86.avx512.mask.fpclass.ps.128
+  return _mm_mask_fpclass_ps_mask(__U, __A, 2); 
+}
+
+__mmask8 test_mm_fpclass_ps_mask(__m128 __A) {
+  // CHECK-LABEL: @test_mm_fpclass_ps_mask
+  // CHECK: @llvm.x86.avx512.mask.fpclass.ps.128
+  return _mm_fpclass_ps_mask(__A, 2); 
+}
+
+__mmask8 test_mm256_mask_fpclass_ps_mask(__mmask8 __U, __m256 __A) {
+  // CHECK-LABEL: @test_mm256_mask_fpclass_ps_mask
+  // CHECK: @llvm.x86.avx512.mask.fpclass.ps.256
+  return _mm256_mask_fpclass_ps_mask(__U, __A, 2); 
+}
+
+__mmask8 test_mm256_fpclass_ps_mask(__m256 __A) {
+  // CHECK-LABEL: @test_mm256_fpclass_ps_mask
+  // CHECK: @llvm.x86.avx512.mask.fpclass.ps.256
+  return _mm256_fpclass_ps_mask(__A, 2); 
+}