From 4c9467ea5d376935a8ecb7ee5a693231c847bc16 Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Wed, 13 Aug 2014 00:30:05 +0000 Subject: [PATCH] [AVX512] Verify the code generated for the intrinsic _mm512_broadcastsd_pd git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215487 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/avx512-vbroadcast.ll | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/CodeGen/X86/avx512-vbroadcast.ll b/test/CodeGen/X86/avx512-vbroadcast.ll index 9f29f44d252..726f2d69d65 100644 --- a/test/CodeGen/X86/avx512-vbroadcast.ll +++ b/test/CodeGen/X86/avx512-vbroadcast.ll @@ -140,3 +140,21 @@ entry: %vecinit15.i = insertelement <16 x i32> %vecinit14.i, i32 %f, i32 15 ret <16 x i32> %vecinit15.i } + +; We implement the scalar broadcast intrinsics with vector initializers. +; Verify that the IR generated will produce the broadcast at the end. +define <8 x double> @test_mm512_broadcastsd_pd(<2 x double> %a) { +; CHECK-LABEL: _test_mm512_broadcastsd_pd: +; CHECK: vbroadcastsd %xmm0, %zmm0 +entry: + %0 = extractelement <2 x double> %a, i32 0 + %vecinit.i = insertelement <8 x double> undef, double %0, i32 0 + %vecinit1.i = insertelement <8 x double> %vecinit.i, double %0, i32 1 + %vecinit2.i = insertelement <8 x double> %vecinit1.i, double %0, i32 2 + %vecinit3.i = insertelement <8 x double> %vecinit2.i, double %0, i32 3 + %vecinit4.i = insertelement <8 x double> %vecinit3.i, double %0, i32 4 + %vecinit5.i = insertelement <8 x double> %vecinit4.i, double %0, i32 5 + %vecinit6.i = insertelement <8 x double> %vecinit5.i, double %0, i32 6 + %vecinit7.i = insertelement <8 x double> %vecinit6.i, double %0, i32 7 + ret <8 x double> %vecinit7.i +} -- 2.34.1