summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/avx-vbroadcast.ll
diff options
context:
space:
mode:
authorNadav Rotem <nadav.rotem@intel.com>2012-04-08 12:54:54 +0000
committerNadav Rotem <nadav.rotem@intel.com>2012-04-08 12:54:54 +0000
commit82609df64774c9738d231384efd293d9b87a02e1 (patch)
tree75a02e00e39db35d9dfac10c1d4c2cfb0e42a362 /llvm/test/CodeGen/X86/avx-vbroadcast.ll
parent8c783d4122bea6e3a28a12bcf9f1a051cf30eb8d (diff)
downloadbcm5719-llvm-82609df64774c9738d231384efd293d9b87a02e1.tar.gz
bcm5719-llvm-82609df64774c9738d231384efd293d9b87a02e1.zip
AVX2: Build splat vectors by broadcasting a scalar from the constant pool.
Previously we used three instructions to broadcast an immediate value into a vector register. On Sandybridge we continue to load the broadcasted value from the constant pool. llvm-svn: 154284
Diffstat (limited to 'llvm/test/CodeGen/X86/avx-vbroadcast.ll')
-rw-r--r--llvm/test/CodeGen/X86/avx-vbroadcast.ll21
1 files changed, 17 insertions, 4 deletions
diff --git a/llvm/test/CodeGen/X86/avx-vbroadcast.ll b/llvm/test/CodeGen/X86/avx-vbroadcast.ll
index 5bf9f4f2e2f..148ae7329f4 100644
--- a/llvm/test/CodeGen/X86/avx-vbroadcast.ll
+++ b/llvm/test/CodeGen/X86/avx-vbroadcast.ll
@@ -47,7 +47,7 @@ entry:
;;;; 128-bit versions
; CHECK: vbroadcastss (%
-define <4 x float> @E(float* %ptr) nounwind uwtable readnone ssp {
+define <4 x float> @e(float* %ptr) nounwind uwtable readnone ssp {
entry:
%q = load float* %ptr, align 4
%vecinit.i = insertelement <4 x float> undef, float %q, i32 0
@@ -57,6 +57,19 @@ entry:
ret <4 x float> %vecinit6.i
}
+
+; CHECK: _e2
+; CHECK-NOT: vbroadcastss
+; CHECK: ret
+define <4 x float> @_e2(float* %ptr) nounwind uwtable readnone ssp {
+ %vecinit.i = insertelement <4 x float> undef, float 0xbf80000000000000, i32 0
+ %vecinit2.i = insertelement <4 x float> %vecinit.i, float 0xbf80000000000000, i32 1
+ %vecinit4.i = insertelement <4 x float> %vecinit2.i, float 0xbf80000000000000, i32 2
+ %vecinit6.i = insertelement <4 x float> %vecinit4.i, float 0xbf80000000000000, i32 3
+ ret <4 x float> %vecinit6.i
+}
+
+
; CHECK: vbroadcastss (%
define <4 x i32> @F(i32* %ptr) nounwind uwtable readnone ssp {
entry:
@@ -71,7 +84,7 @@ entry:
; Unsupported vbroadcasts
; CHECK: _G
-; CHECK-NOT: vbroadcastsd (%
+; CHECK-NOT: broadcast (%
; CHECK: ret
define <2 x i64> @G(i64* %ptr) nounwind uwtable readnone ssp {
entry:
@@ -82,7 +95,7 @@ entry:
}
; CHECK: _H
-; CHECK-NOT: vbroadcastss
+; CHECK-NOT: broadcast
; CHECK: ret
define <4 x i32> @H(<4 x i32> %a) {
%x = shufflevector <4 x i32> %a, <4 x i32> undef, <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
@@ -90,7 +103,7 @@ define <4 x i32> @H(<4 x i32> %a) {
}
; CHECK: _I
-; CHECK-NOT: vbroadcastsd (%
+; CHECK-NOT: broadcast (%
; CHECK: ret
define <2 x double> @I(double* %ptr) nounwind uwtable readnone ssp {
entry:
OpenPOWER on IntegriCloud