r214314 - [AVX512] Add set1 intrinsics
Adam Nemet
anemet at apple.com
Wed Jul 30 09:51:22 PDT 2014
Author: anemet
Date: Wed Jul 30 11:51:22 2014
New Revision: 214314
URL: http://llvm.org/viewvc/llvm-project?rev=214314&view=rev
Log:
[AVX512] Add set1 intrinsics
(Dropped the byte and word variants from the patch. Turns out these are not
part of AVX512F but only AVX512BW/VL.)
Part of <rdar://problem/17688758>
Modified:
cfe/trunk/lib/Headers/avx512fintrin.h
cfe/trunk/test/CodeGen/avx512f-builtins.c
Modified: cfe/trunk/lib/Headers/avx512fintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512fintrin.h?rev=214314&r1=214313&r2=214314&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512fintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512fintrin.h Wed Jul 30 11:51:22 2014
@@ -91,6 +91,32 @@ _mm512_setzero_pd(void)
return (__m512d){ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
}
+static __inline __m512 __attribute__((__always_inline__, __nodebug__))
+_mm512_set1_ps(float __w)
+{
+ return (__m512){ __w, __w, __w, __w, __w, __w, __w, __w,
+ __w, __w, __w, __w, __w, __w, __w, __w };
+}
+
+static __inline __m512d __attribute__((__always_inline__, __nodebug__))
+_mm512_set1_pd(double __w)
+{
+ return (__m512d){ __w, __w, __w, __w, __w, __w, __w, __w };
+}
+
+static __inline __m512i __attribute__((__always_inline__, __nodebug__))
+_mm512_set1_epi32(int __s)
+{
+ return (__m512i)(__v16si){ __s, __s, __s, __s, __s, __s, __s, __s,
+ __s, __s, __s, __s, __s, __s, __s, __s };
+}
+
+static __inline __m512i __attribute__((__always_inline__, __nodebug__))
+_mm512_set1_epi64(long long __d)
+{
+ return (__m512i)(__v8di){ __d, __d, __d, __d, __d, __d, __d, __d };
+}
+
/* Arithmetic */
static __inline __m512d __attribute__((__always_inline__, __nodebug__))
Modified: cfe/trunk/test/CodeGen/avx512f-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512f-builtins.c?rev=214314&r1=214313&r2=214314&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512f-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512f-builtins.c Wed Jul 30 11:51:22 2014
@@ -88,3 +88,17 @@ void test_mm512_store_pd(void *p, __m512
// CHECK: store <8 x double>
_mm512_store_pd(p, a);
}
+
+__m512d test_mm512_set1_pd(double d)
+{
+ // CHECK-LABEL: @test_mm512_set1_pd
+ // CHECK: insertelement <8 x double> {{.*}}, i32 0
+ // CHECK: insertelement <8 x double> {{.*}}, i32 1
+ // CHECK: insertelement <8 x double> {{.*}}, i32 2
+ // CHECK: insertelement <8 x double> {{.*}}, i32 3
+ // CHECK: insertelement <8 x double> {{.*}}, i32 4
+ // CHECK: insertelement <8 x double> {{.*}}, i32 5
+ // CHECK: insertelement <8 x double> {{.*}}, i32 6
+ // CHECK: insertelement <8 x double> {{.*}}, i32 7
+ return _mm512_set1_pd(d);
+}
More information about the cfe-commits
mailing list