summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena Demikhovsky <elena.demikhovsky@intel.com>2013-08-11 12:29:16 +0000
committerElena Demikhovsky <elena.demikhovsky@intel.com>2013-08-11 12:29:16 +0000
commit55db69c97e936abf8290a4dc639239f92ab34fcb (patch)
tree8d94052e1fdaf3fd7d92f4a0967017dfec5e6cb4
parentfac4a4eb7dfbfc90ae1d5c7d6c39a2d89a33c30e (diff)
downloadllvm-55db69c97e936abf8290a4dc639239f92ab34fcb.tar.gz
llvm-55db69c97e936abf8290a4dc639239f92ab34fcb.tar.bz2
llvm-55db69c97e936abf8290a4dc639239f92ab34fcb.tar.xz
AVX-512: Added more tests for BROADCAST
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188148 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/X86ISelLowering.cpp2
-rw-r--r--test/CodeGen/X86/avx512-vbroadcast.ll16
2 files changed, 17 insertions, 1 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index dfd41b717f..55b1f01225 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 d4ba6bd2b8..6f89d6ce23 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
+}