r242635 - [X86][AVX512BW] add clang intrinsics for pmulhrsw / pmulhuw / pmulhw
Asaf Badouh
asaf.badouh at intel.com
Sun Jul 19 01:47:31 PDT 2015
Author: abadouh
Date: Sun Jul 19 03:47:31 2015
New Revision: 242635
URL: http://llvm.org/viewvc/llvm-project?rev=242635&view=rev
Log:
[X86][AVX512BW] add clang intrinsics for pmulhrsw / pmulhuw / pmulhw
also made minor fix in "test_mm512_maskz_permutex2var_epi16"
Differential Revision: http://reviews.llvm.org/D11336
Modified:
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/lib/Headers/avx512bwintrin.h
cfe/trunk/test/CodeGen/avx512bw-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=242635&r1=242634&r2=242635&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Sun Jul 19 03:47:31 2015
@@ -1217,5 +1217,7 @@ BUILTIN(__builtin_ia32_vpermt2varhi128_m
BUILTIN(__builtin_ia32_vpermt2varhi128_maskz, "V8sV8sV8sV8sUc", "")
BUILTIN(__builtin_ia32_vpermt2varhi256_mask, "V16sV16sV16sV16sUs", "")
BUILTIN(__builtin_ia32_vpermt2varhi256_maskz, "V16sV16sV16sV16sUs", "")
-
+BUILTIN(__builtin_ia32_pmulhrsw512_mask, "V32sV32sV32sV32sUi", "")
+BUILTIN(__builtin_ia32_pmulhuw512_mask, "V32sV32sV32sV32sUi", "")
+BUILTIN(__builtin_ia32_pmulhw512_mask, "V32sV32sV32sV32sUi", "")
#undef BUILTIN
Modified: cfe/trunk/lib/Headers/avx512bwintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512bwintrin.h?rev=242635&r1=242634&r2=242635&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512bwintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512bwintrin.h Sun Jul 19 03:47:31 2015
@@ -1204,6 +1204,96 @@ _mm512_maskz_permutex2var_epi16 (__mmask
(__mmask32) __U);
}
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_mulhrs_epi16 (__m512i __A, __m512i __B)
+{
+ return (__m512i) __builtin_ia32_pmulhrsw512_mask ((__v32hi) __A,
+ (__v32hi) __B,
+ (__v32hi)
+ _mm512_setzero_hi (),
+ (__mmask32) -1);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_mask_mulhrs_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
+ __m512i __B)
+{
+ return (__m512i) __builtin_ia32_pmulhrsw512_mask ((__v32hi) __A,
+ (__v32hi) __B,
+ (__v32hi) __W,
+ (__mmask32) __U);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_maskz_mulhrs_epi16 (__mmask32 __U, __m512i __A, __m512i __B)
+{
+ return (__m512i) __builtin_ia32_pmulhrsw512_mask ((__v32hi) __A,
+ (__v32hi) __B,
+ (__v32hi)
+ _mm512_setzero_hi (),
+ (__mmask32) __U);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_mulhi_epi16 (__m512i __A, __m512i __B)
+{
+ return (__m512i) __builtin_ia32_pmulhw512_mask ((__v32hi) __A,
+ (__v32hi) __B,
+ (__v32hi)
+ _mm512_setzero_hi (),
+ (__mmask32) -1);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_mask_mulhi_epi16 (__m512i __W, __mmask32 __U, __m512i __A,
+ __m512i __B)
+{
+ return (__m512i) __builtin_ia32_pmulhw512_mask ((__v32hi) __A,
+ (__v32hi) __B,
+ (__v32hi) __W,
+ (__mmask32) __U);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_maskz_mulhi_epi16 (__mmask32 __U, __m512i __A, __m512i __B)
+{
+ return (__m512i) __builtin_ia32_pmulhw512_mask ((__v32hi) __A,
+ (__v32hi) __B,
+ (__v32hi)
+ _mm512_setzero_hi (),
+ (__mmask32) __U);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_mulhi_epu16 (__m512i __A, __m512i __B)
+{
+ return (__m512i) __builtin_ia32_pmulhuw512_mask ((__v32hi) __A,
+ (__v32hi) __B,
+ (__v32hi)
+ _mm512_setzero_hi (),
+ (__mmask32) -1);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_mask_mulhi_epu16 (__m512i __W, __mmask32 __U, __m512i __A,
+ __m512i __B)
+{
+ return (__m512i) __builtin_ia32_pmulhuw512_mask ((__v32hi) __A,
+ (__v32hi) __B,
+ (__v32hi) __W,
+ (__mmask32) __U);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_maskz_mulhi_epu16 (__mmask32 __U, __m512i __A, __m512i __B)
+{
+ return (__m512i) __builtin_ia32_pmulhuw512_mask ((__v32hi) __A,
+ (__v32hi) __B,
+ (__v32hi)
+ _mm512_setzero_hi (),
+ (__mmask32) __U);
+}
+
#define _mm512_cmp_epi8_mask(a, b, p) __extension__ ({ \
(__mmask16)__builtin_ia32_cmpb512_mask((__v64qi)(__m512i)(a), \
(__v64qi)(__m512i)(b), \
Modified: cfe/trunk/test/CodeGen/avx512bw-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512bw-builtins.c?rev=242635&r1=242634&r2=242635&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512bw-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512bw-builtins.c Sun Jul 19 03:47:31 2015
@@ -830,6 +830,53 @@ __m512i test_mm512_mask_permutex2var_epi
}
__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.mask.vpermt2var.hi.512
+ // CHECK: @llvm.x86.avx512.maskz.vpermt2var.hi.512
return _mm512_maskz_permutex2var_epi16(__U,__A,__I,__B);
}
+
+__m512i test_mm512_mulhrs_epi16(__m512i __A, __m512i __B) {
+ // CHECK-LABEL: @test_mm512_mulhrs_epi16
+ // CHECK: @llvm.x86.avx512.mask.pmul.hr.sw.512
+ return _mm512_mulhrs_epi16(__A,__B);
+}
+__m512i test_mm512_mask_mulhrs_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {
+ // CHECK-LABEL: @test_mm512_mask_mulhrs_epi16
+ // CHECK: @llvm.x86.avx512.mask.pmul.hr.sw.512
+ return _mm512_mask_mulhrs_epi16(__W,__U,__A,__B);
+}
+__m512i test_mm512_maskz_mulhrs_epi16(__mmask32 __U, __m512i __A, __m512i __B) {
+ // CHECK-LABEL: @test_mm512_maskz_mulhrs_epi16
+ // CHECK: @llvm.x86.avx512.mask.pmul.hr.sw.512
+ return _mm512_maskz_mulhrs_epi16(__U,__A,__B);
+}
+__m512i test_mm512_mulhi_epi16(__m512i __A, __m512i __B) {
+ // CHECK-LABEL: @test_mm512_mulhi_epi16
+ // CHECK: @llvm.x86.avx512.mask.pmulh.w.512
+ return _mm512_mulhi_epi16(__A,__B);
+}
+__m512i test_mm512_mask_mulhi_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {
+ // CHECK-LABEL: @test_mm512_mask_mulhi_epi16
+ // CHECK: @llvm.x86.avx512.mask.pmulh.w.512
+ return _mm512_mask_mulhi_epi16(__W,__U,__A,__B);
+}
+__m512i test_mm512_maskz_mulhi_epi16(__mmask32 __U, __m512i __A, __m512i __B) {
+ // CHECK-LABEL: @test_mm512_maskz_mulhi_epi16
+ // CHECK: @llvm.x86.avx512.mask.pmulh.w.512
+ return _mm512_maskz_mulhi_epi16(__U,__A,__B);
+}
+__m512i test_mm512_mulhi_epu16(__m512i __A, __m512i __B) {
+ // CHECK-LABEL: @test_mm512_mulhi_epu16
+ // CHECK: @llvm.x86.avx512.mask.pmulhu.w.512
+ return _mm512_mulhi_epu16(__A,__B);
+}
+__m512i test_mm512_mask_mulhi_epu16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {
+ // CHECK-LABEL: @test_mm512_mask_mulhi_epu16
+ // CHECK: @llvm.x86.avx512.mask.pmulhu.w.512
+ return _mm512_mask_mulhi_epu16(__W,__U,__A,__B);
+}
+__m512i test_mm512_maskz_mulhi_epu16(__mmask32 __U, __m512i __A, __m512i __B) {
+ // CHECK-LABEL: @test_mm512_maskz_mulhi_epu16
+ // CHECK: @llvm.x86.avx512.mask.pmulhu.w.512
+ return _mm512_maskz_mulhi_epu16(__U,__A,__B);
+}
+
More information about the cfe-commits
mailing list