From 55db69c97e936abf8290a4dc639239f92ab34fcb Mon Sep 17 00:00:00 2001 From: Elena Demikhovsky Date: Sun, 11 Aug 2013 12:29:16 +0000 Subject: [PATCH] AVX-512: Added more tests for BROADCAST git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188148 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelLowering.cpp | 2 +- test/CodeGen/X86/avx512-vbroadcast.ll | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index dfd41b717f4..55b1f012252 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -5481,7 +5481,7 @@ X86TargetLowering::LowerVectorBroadcast(SDValue Op, SelectionDAG &DAG) const { return SDValue(); // Use the register form of the broadcast instruction available on AVX2. - if (VT.is256BitVector()) + if (VT.getSizeInBits() >= 256) Sc = Extract128BitVector(Sc, 0, DAG, dl); return DAG.getNode(X86ISD::VBROADCAST, dl, VT, Sc); } diff --git a/test/CodeGen/X86/avx512-vbroadcast.ll b/test/CodeGen/X86/avx512-vbroadcast.ll index d4ba6bd2b8f..6f89d6ce234 100644 --- a/test/CodeGen/X86/avx512-vbroadcast.ll +++ b/test/CodeGen/X86/avx512-vbroadcast.ll @@ -35,3 +35,19 @@ define <8 x double> @_inreg8xdouble(double %a) { %c = shufflevector <8 x double> %b, <8 x double> undef, <8 x i32> zeroinitializer ret <8 x double> %c } + +;CHECK-LABEL: _xmm16xi32 +;CHECK: vpbroadcastd +;CHECK: ret +define <16 x i32> @_xmm16xi32(<16 x i32> %a) { + %b = shufflevector <16 x i32> %a, <16 x i32> undef, <16 x i32> zeroinitializer + ret <16 x i32> %b +} + +;CHECK-LABEL: _xmm16xfloat +;CHECK: vbroadcastssz +;CHECK: ret +define <16 x float> @_xmm16xfloat(<16 x float> %a) { + %b = shufflevector <16 x float> %a, <16 x float> undef, <16 x i32> zeroinitializer + ret <16 x float> %b +} -- 2.34.1