AVX-512: Added more tests for BROADCAST
authorElena Demikhovsky <elena.demikhovsky@intel.com>
Sun, 11 Aug 2013 12:29:16 +0000 (12:29 +0000)
committerElena Demikhovsky <elena.demikhovsky@intel.com>
Sun, 11 Aug 2013 12:29:16 +0000 (12:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188148 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/avx512-vbroadcast.ll

index dfd41b717f438cb6a572571b6b1cd7f95c0612a3..55b1f012252502e1b7e40a774beda58de04d69cf 100644 (file)
@@ -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);
       }
index d4ba6bd2b8f387af6a4232e9d2e450fb0e57106d..6f89d6ce2342cfb680cc81b9578e908950cc4ef5 100644 (file)
@@ -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
+}