r237698 - [X86] Add _mm_broadcastsd_pd intrinsic
Michael Kuperstein
michael.m.kuperstein at intel.com
Tue May 19 07:49:14 PDT 2015
Author: mkuper
Date: Tue May 19 09:49:14 2015
New Revision: 237698
URL: http://llvm.org/viewvc/llvm-project?rev=237698&view=rev
Log:
[X86] Add _mm_broadcastsd_pd intrinsic
_mm_broadcastsd_pd is basically an alias for _mm_movedup_pd, however the alias is only available from AVX2 forward.
Modified:
cfe/trunk/lib/Headers/avx2intrin.h
cfe/trunk/test/CodeGen/avx2-builtins.c
Modified: cfe/trunk/lib/Headers/avx2intrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx2intrin.h?rev=237698&r1=237697&r2=237698&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx2intrin.h (original)
+++ cfe/trunk/lib/Headers/avx2intrin.h Tue May 19 09:49:14 2015
@@ -760,6 +760,12 @@ _mm_broadcastss_ps(__m128 __X)
return (__m128)__builtin_ia32_vbroadcastss_ps((__v4sf)__X);
}
+static __inline__ __m128d __attribute__((__always_inline__, __nodebug__))
+_mm_broadcastsd_pd(__m128d __a)
+{
+ return __builtin_shufflevector(__a, __a, 0, 0);
+}
+
static __inline__ __m256 __attribute__((__always_inline__, __nodebug__))
_mm256_broadcastss_ps(__m128 __X)
{
Modified: cfe/trunk/test/CodeGen/avx2-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx2-builtins.c?rev=237698&r1=237697&r2=237698&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx2-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx2-builtins.c Tue May 19 09:49:14 2015
@@ -611,6 +611,11 @@ __m128 test_mm_broadcastss_ps(__m128 a)
return _mm_broadcastss_ps(a);
}
+__m128d test_mm_broadcastsd_pd(__m128d a) {
+ // CHECK: shufflevector <2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x i32> zeroinitializer
+ return _mm_broadcastsd_pd(a);
+}
+
__m256 test_mm256_broadcastss_ps(__m128 a) {
// CHECK: @llvm.x86.avx2.vbroadcast.ss.ps.256
return _mm256_broadcastss_ps(a);
More information about the cfe-commits
mailing list