r317456 - lowering broadcastm
Jina Nahias via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 5 23:04:12 PST 2017
Author: jina.nahias
Date: Sun Nov 5 23:04:12 2017
New Revision: 317456
URL: http://llvm.org/viewvc/llvm-project?rev=317456&view=rev
Log:
lowering broadcastm
Change-Id: I0661abea3e3742860e0a03ff9e4fcdc367eff7db
Modified:
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/lib/Headers/avx512cdintrin.h
cfe/trunk/lib/Headers/avx512vlcdintrin.h
cfe/trunk/test/CodeGen/avx512cdintrin.c
cfe/trunk/test/CodeGen/avx512vlcd-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=317456&r1=317455&r2=317456&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Sun Nov 5 23:04:12 2017
@@ -1580,12 +1580,6 @@ TARGET_BUILTIN(__builtin_ia32_cvtmask2q1
TARGET_BUILTIN(__builtin_ia32_cvtmask2q256, "V4LLiUc","","avx512dq,avx512vl")
TARGET_BUILTIN(__builtin_ia32_cvtq2mask128, "UcV2LLi","","avx512dq,avx512vl")
TARGET_BUILTIN(__builtin_ia32_cvtq2mask256, "UcV4LLi","","avx512dq,avx512vl")
-TARGET_BUILTIN(__builtin_ia32_broadcastmb512, "V8LLiUc","","avx512cd")
-TARGET_BUILTIN(__builtin_ia32_broadcastmw512, "V16iUs","","avx512cd")
-TARGET_BUILTIN(__builtin_ia32_broadcastmb128, "V2LLiUc","","avx512cd,avx512vl")
-TARGET_BUILTIN(__builtin_ia32_broadcastmb256, "V4LLiUc","","avx512cd,avx512vl")
-TARGET_BUILTIN(__builtin_ia32_broadcastmw128, "V4iUs","","avx512cd,avx512vl")
-TARGET_BUILTIN(__builtin_ia32_broadcastmw256, "V8iUs","","avx512cd,avx512vl")
TARGET_BUILTIN(__builtin_ia32_pmovsdb512_mask, "V16cV16iV16cUs","","avx512f")
TARGET_BUILTIN(__builtin_ia32_pmovsdb512mem_mask, "vV16c*V16iUs","","avx512f")
TARGET_BUILTIN(__builtin_ia32_pmovswb512mem_mask, "vV32c*V32sUi","","avx512bw")
Modified: cfe/trunk/lib/Headers/avx512cdintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512cdintrin.h?rev=317456&r1=317455&r2=317456&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512cdintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512cdintrin.h Sun Nov 5 23:04:12 2017
@@ -130,13 +130,14 @@ _mm512_maskz_lzcnt_epi64 (__mmask8 __U,
static __inline__ __m512i __DEFAULT_FN_ATTRS
_mm512_broadcastmb_epi64 (__mmask8 __A)
{
- return (__m512i) __builtin_ia32_broadcastmb512 (__A);
+ return (__m512i) _mm512_set1_epi64((long long) __A);
}
static __inline__ __m512i __DEFAULT_FN_ATTRS
_mm512_broadcastmw_epi32 (__mmask16 __A)
{
- return (__m512i) __builtin_ia32_broadcastmw512 (__A);
+ return (__m512i) _mm512_set1_epi32((int) __A);
+
}
#undef __DEFAULT_FN_ATTRS
Modified: cfe/trunk/lib/Headers/avx512vlcdintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512vlcdintrin.h?rev=317456&r1=317455&r2=317456&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512vlcdintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512vlcdintrin.h Sun Nov 5 23:04:12 2017
@@ -33,26 +33,26 @@
static __inline__ __m128i __DEFAULT_FN_ATTRS
_mm_broadcastmb_epi64 (__mmask8 __A)
-{
- return (__m128i) __builtin_ia32_broadcastmb128 (__A);
+{
+ return (__m128i) _mm_set1_epi64x((long long) __A);
}
static __inline__ __m256i __DEFAULT_FN_ATTRS
_mm256_broadcastmb_epi64 (__mmask8 __A)
{
- return (__m256i) __builtin_ia32_broadcastmb256 (__A);
+ return (__m256i) _mm256_set1_epi64x((long long)__A);
}
static __inline__ __m128i __DEFAULT_FN_ATTRS
_mm_broadcastmw_epi32 (__mmask16 __A)
{
- return (__m128i) __builtin_ia32_broadcastmw128 (__A);
+ return (__m128i) _mm_set1_epi32((int)__A);
}
static __inline__ __m256i __DEFAULT_FN_ATTRS
_mm256_broadcastmw_epi32 (__mmask16 __A)
{
- return (__m256i) __builtin_ia32_broadcastmw256 (__A);
+ return (__m256i) _mm256_set1_epi32((int)__A);
}
Modified: cfe/trunk/test/CodeGen/avx512cdintrin.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512cdintrin.c?rev=317456&r1=317455&r2=317456&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512cdintrin.c (original)
+++ cfe/trunk/test/CodeGen/avx512cdintrin.c Sun Nov 5 23:04:12 2017
@@ -68,14 +68,40 @@ __m512i test_mm512_maskz_lzcnt_epi64(__m
return _mm512_maskz_lzcnt_epi64(__U,__A);
}
-__m512i test_mm512_broadcastmb_epi64(__mmask8 __A) {
+__m512i test_mm512_broadcastmb_epi64(__m512i a, __m512i b) {
// CHECK-LABEL: @test_mm512_broadcastmb_epi64
- // CHECK: @llvm.x86.avx512.broadcastmb.512
- return _mm512_broadcastmb_epi64(__A);
+ // CHECK: icmp eq <8 x i64> %{{.*}}, %{{.*}}
+ // CHECK: zext i8 %{{.*}} to i64
+ // CHECK: insertelement <8 x i64> undef, i64 %{{.*}}, i32 0
+ // CHECK: insertelement <8 x i64> %{{.*}}, i64 %{{.*}}, i32 1
+ // CHECK: insertelement <8 x i64> %{{.*}}, i64 %{{.*}}, i32 2
+ // CHECK: insertelement <8 x i64> %{{.*}}, i64 %{{.*}}, i32 3
+ // CHECK: insertelement <8 x i64> %{{.*}}, i64 %{{.*}}, i32 4
+ // CHECK: insertelement <8 x i64> %{{.*}}, i64 %{{.*}}, i32 5
+ // CHECK: insertelement <8 x i64> %{{.*}}, i64 %{{.*}}, i32 6
+ // CHECK: insertelement <8 x i64> %{{.*}}, i64 %{{.*}}, i32 7
+ return _mm512_broadcastmb_epi64(_mm512_cmpeq_epu64_mask ( a, b));
}
-__m512i test_mm512_broadcastmw_epi32(__mmask16 __A) {
+__m512i test_mm512_broadcastmw_epi32(__m512i a, __m512i b) {
// CHECK-LABEL: @test_mm512_broadcastmw_epi32
- // CHECK: @llvm.x86.avx512.broadcastmw.512
- return _mm512_broadcastmw_epi32(__A);
+ // CHECK: icmp eq <16 x i32> %{{.*}}, %{{.*}}
+ // CHECK: zext i16 %{{.*}} to i32
+ // CHECK: insertelement <16 x i32> undef, i32 %{{.*}}
+ // CHECK: insertelement <16 x i32> %{{.*}}, i32 %{{.*}}
+ // CHECK: insertelement <16 x i32> %{{.*}}, i32 %{{.*}}
+ // CHECK: insertelement <16 x i32> %{{.*}}, i32 %{{.*}}
+ // CHECK: insertelement <16 x i32> %{{.*}}, i32 %{{.*}}
+ // CHECK: insertelement <16 x i32> %{{.*}}, i32 %{{.*}}
+ // CHECK: insertelement <16 x i32> %{{.*}}, i32 %{{.*}}
+ // CHECK: insertelement <16 x i32> %{{.*}}, i32 %{{.*}}
+ // CHECK: insertelement <16 x i32> %{{.*}}, i32 %{{.*}}
+ // CHECK: insertelement <16 x i32> %{{.*}}, i32 %{{.*}}
+ // CHECK: insertelement <16 x i32> %{{.*}}, i32 %{{.*}}
+ // CHECK: insertelement <16 x i32> %{{.*}}, i32 %{{.*}}
+ // CHECK: insertelement <16 x i32> %{{.*}}, i32 %{{.*}}
+ // CHECK: insertelement <16 x i32> %{{.*}}, i32 %{{.*}}
+ // CHECK: insertelement <16 x i32> %{{.*}}, i32 %{{.*}}
+ // CHECK: insertelement <16 x i32> %{{.*}}, i32 %{{.*}}
+ return _mm512_broadcastmw_epi32(_mm512_cmpeq_epi32_mask ( a, b));
}
Modified: cfe/trunk/test/CodeGen/avx512vlcd-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512vlcd-builtins.c?rev=317456&r1=317455&r2=317456&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512vlcd-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512vlcd-builtins.c Sun Nov 5 23:04:12 2017
@@ -3,28 +3,56 @@
#include <immintrin.h>
-__m128i test_mm_broadcastmb_epi64(__mmask8 __A) {
+__m128i test_mm_broadcastmb_epi64(__m128i a,__m128i b) {
// CHECK-LABEL: @test_mm_broadcastmb_epi64
- // CHECK: @llvm.x86.avx512.broadcastmb.128
- return _mm_broadcastmb_epi64(__A);
+ // CHECK: icmp eq <4 x i32> %{{.*}}, %{{.*}}
+ // CHECK: shufflevector <4 x i1> %{{.*}}, <4 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
+ // CHECK: bitcast <8 x i1> %{{.*}} to i8
+ // CHECK: zext i8 %{{.*}} to i64
+ // CHECK: insertelement <2 x i64> undef, i64 %{{.*}}, i32 0
+ // CHECK: insertelement <2 x i64> %{{.*}}, i64 %{{.*}}, i32 1
+ return _mm_broadcastmb_epi64(_mm_cmpeq_epi32_mask (a, b));
}
-__m256i test_mm256_broadcastmb_epi64(__mmask8 __A) {
+__m256i test_mm256_broadcastmb_epi64(__m256i a, __m256i b) {
// CHECK-LABEL: @test_mm256_broadcastmb_epi64
- // CHECK: @llvm.x86.avx512.broadcastmb.256
- return _mm256_broadcastmb_epi64(__A);
+ // CHECK: icmp eq <4 x i64> %{{.*}}, %{{.*}}
+ // CHECK: shufflevector <4 x i1> %{{.*}}, <4 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
+ // CHECK: bitcast <8 x i1> %{{.*}} to i8
+ // CHECK: zext i8 %{{.*}} to i64
+ // CHECK: insertelement <4 x i64> undef, i64 %{{.*}}, i32 0
+ // CHECK: insertelement <4 x i64> %{{.*}}, i64 %{{.*}}, i32 1
+ // CHECK: insertelement <4 x i64> %{{.*}}, i64 %{{.*}}, i32 2
+ // CHECK: insertelement <4 x i64> %{{.*}}, i64 %{{.*}}, i32 3
+ return _mm256_broadcastmb_epi64(_mm256_cmpeq_epi64_mask ( a, b));
}
-__m128i test_mm_broadcastmw_epi32(__mmask16 __A) {
+__m128i test_mm_broadcastmw_epi32(__m512i a, __m512i b) {
// CHECK-LABEL: @test_mm_broadcastmw_epi32
- // CHECK: @llvm.x86.avx512.broadcastmw.128
- return _mm_broadcastmw_epi32(__A);
+ // CHECK: icmp eq <16 x i32> %{{.*}}, %{{.*}}
+ // CHECK: bitcast <16 x i1> %{{.*}} to i16
+ // CHECK: zext i16 %{{.*}} to i32
+ // CHECK: insertelement <4 x i32> undef, i32 %{{.*}}, i32 0
+ // CHECK: insertelement <4 x i32> %{{.*}}, i32 %{{.*}}, i32 1
+ // CHECK: insertelement <4 x i32> %{{.*}}, i32 %{{.*}}, i32 2
+ // CHECK: insertelement <4 x i32> %{{.*}}, i32 %{{.*}}, i32 3
+ return _mm_broadcastmw_epi32(_mm512_cmpeq_epi32_mask ( a, b));
}
-__m256i test_mm256_broadcastmw_epi32(__mmask16 __A) {
+__m256i test_mm256_broadcastmw_epi32(__m512i a, __m512i b) {
// CHECK-LABEL: @test_mm256_broadcastmw_epi32
- // CHECK: @llvm.x86.avx512.broadcastmw.256
- return _mm256_broadcastmw_epi32(__A);
+ // CHECK: icmp eq <16 x i32> %{{.*}}, %{{.*}}
+ // CHECK: bitcast <16 x i1> %{{.*}} to i16
+ // CHECK: zext i16 %{{.*}} to i32
+ // CHECK: insertelement <8 x i32> undef, i32 %{{.*}}, i32 0
+ // CHECK: insertelement <8 x i32> %{{.*}}, i32 %{{.*}}, i32 1
+ // CHECK: insertelement <8 x i32> %{{.*}}, i32 %{{.*}}, i32 2
+ // CHECK: insertelement <8 x i32> %{{.*}}, i32 %{{.*}}, i32 3
+ // CHECK: insertelement <8 x i32> %{{.*}}, i32 %{{.*}}, i32 4
+ // CHECK: insertelement <8 x i32> %{{.*}}, i32 %{{.*}}, i32 5
+ // CHECK: insertelement <8 x i32> %{{.*}}, i32 %{{.*}}, i32 6
+ // CHECK: insertelement <8 x i32> %{{.*}}, i32 %{{.*}}, i32 7
+ return _mm256_broadcastmw_epi32(_mm512_cmpeq_epi32_mask ( a, b));
}
__m128i test_mm_conflict_epi64(__m128i __A) {
More information about the cfe-commits
mailing list