summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/vec_extract.ll
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2016-04-01 20:55:19 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2016-04-01 20:55:19 +0000
commita372a0f29560f6946212f41c82205892f99cd3a3 (patch)
tree1b2809261c3a80d571eb51ae8cf591dc9cd1b626 /llvm/test/CodeGen/X86/vec_extract.ll
parent66b1bb45b5aa2816621d83f75edb5622b848fc15 (diff)
downloadbcm5719-llvm-a372a0f29560f6946212f41c82205892f99cd3a3.tar.gz
bcm5719-llvm-a372a0f29560f6946212f41c82205892f99cd3a3.zip
[X86][SSE] Regenerated the vec_extract tests.
llvm-svn: 265183
Diffstat (limited to 'llvm/test/CodeGen/X86/vec_extract.ll')
-rw-r--r--llvm/test/CodeGen/X86/vec_extract.ll142
1 files changed, 86 insertions, 56 deletions
diff --git a/llvm/test/CodeGen/X86/vec_extract.ll b/llvm/test/CodeGen/X86/vec_extract.ll
index 3b478880590..47f719d9e32 100644
--- a/llvm/test/CodeGen/X86/vec_extract.ll
+++ b/llvm/test/CodeGen/X86/vec_extract.ll
@@ -1,74 +1,104 @@
-; RUN: llc < %s -mcpu=corei7 -march=x86 -mattr=+sse2,-sse4.1 | FileCheck %s
-
-target triple = "x86_64-unknown-linux-gnu"
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=i686-unknown-linux-gnu -mattr=+sse2,-sse4.1 | FileCheck %s --check-prefix=X32
+; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2,-sse4.1 | FileCheck %s --check-prefix=X64
define void @test1(<4 x float>* %F, float* %f) nounwind {
-; CHECK-LABEL: test1:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
-; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
-; CHECK-NEXT: movaps (%ecx), %xmm0
-; CHECK-NEXT: addps %xmm0, %xmm0
-; CHECK-NEXT: movss %xmm0, (%eax)
-; CHECK-NEXT: retl
+; X32-LABEL: test1:
+; X32: # BB#0: # %entry
+; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X32-NEXT: movaps (%ecx), %xmm0
+; X32-NEXT: addps %xmm0, %xmm0
+; X32-NEXT: movss %xmm0, (%eax)
+; X32-NEXT: retl
+;
+; X64-LABEL: test1:
+; X64: # BB#0: # %entry
+; X64-NEXT: movaps (%rdi), %xmm0
+; X64-NEXT: addps %xmm0, %xmm0
+; X64-NEXT: movss %xmm0, (%rsi)
+; X64-NEXT: retq
entry:
- %tmp = load <4 x float>, <4 x float>* %F ; <<4 x float>> [#uses=2]
- %tmp7 = fadd <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1]
- %tmp2 = extractelement <4 x float> %tmp7, i32 0 ; <float> [#uses=1]
- store float %tmp2, float* %f
- ret void
+ %tmp = load <4 x float>, <4 x float>* %F
+ %tmp7 = fadd <4 x float> %tmp, %tmp
+ %tmp2 = extractelement <4 x float> %tmp7, i32 0
+ store float %tmp2, float* %f
+ ret void
}
define float @test2(<4 x float>* %F, float* %f) nounwind {
-; CHECK-LABEL: test2:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: pushl %eax
-; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
-; CHECK-NEXT: movaps (%eax), %xmm0
-; CHECK-NEXT: addps %xmm0, %xmm0
-; CHECK-NEXT: shufpd {{.*#+}} xmm0 = xmm0[1,0]
-; CHECK-NEXT: movss %xmm0, (%esp)
-; CHECK-NEXT: flds (%esp)
-; CHECK-NEXT: popl %eax
-; CHECK-NEXT: retl
+; X32-LABEL: test2:
+; X32: # BB#0: # %entry
+; X32-NEXT: pushl %eax
+; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X32-NEXT: movaps (%eax), %xmm0
+; X32-NEXT: addps %xmm0, %xmm0
+; X32-NEXT: shufpd {{.*#+}} xmm0 = xmm0[1,0]
+; X32-NEXT: movss %xmm0, (%esp)
+; X32-NEXT: flds (%esp)
+; X32-NEXT: popl %eax
+; X32-NEXT: retl
+;
+; X64-LABEL: test2:
+; X64: # BB#0: # %entry
+; X64-NEXT: movaps (%rdi), %xmm0
+; X64-NEXT: addps %xmm0, %xmm0
+; X64-NEXT: shufpd {{.*#+}} xmm0 = xmm0[1,0]
+; X64-NEXT: retq
entry:
- %tmp = load <4 x float>, <4 x float>* %F ; <<4 x float>> [#uses=2]
- %tmp7 = fadd <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1]
- %tmp2 = extractelement <4 x float> %tmp7, i32 2 ; <float> [#uses=1]
- ret float %tmp2
+ %tmp = load <4 x float>, <4 x float>* %F
+ %tmp7 = fadd <4 x float> %tmp, %tmp
+ %tmp2 = extractelement <4 x float> %tmp7, i32 2
+ ret float %tmp2
}
define void @test3(float* %R, <4 x float>* %P1) nounwind {
-; CHECK-LABEL: test3:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
-; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
-; CHECK-NEXT: movss 12(%ecx), %xmm0
-; CHECK-NEXT: movss %xmm0, (%eax)
-; CHECK-NEXT: retl
+; X32-LABEL: test3:
+; X32: # BB#0: # %entry
+; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X32-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
+; X32-NEXT: movss %xmm0, (%eax)
+; X32-NEXT: retl
+;
+; X64-LABEL: test3:
+; X64: # BB#0: # %entry
+; X64-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
+; X64-NEXT: movss %xmm0, (%rdi)
+; X64-NEXT: retq
entry:
- %X = load <4 x float>, <4 x float>* %P1 ; <<4 x float>> [#uses=1]
- %tmp = extractelement <4 x float> %X, i32 3 ; <float> [#uses=1]
- store float %tmp, float* %R
- ret void
+ %X = load <4 x float>, <4 x float>* %P1
+ %tmp = extractelement <4 x float> %X, i32 3
+ store float %tmp, float* %R
+ ret void
}
define double @test4(double %A) nounwind {
-; CHECK-LABEL: test4:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: subl $12, %esp
-; CHECK-NEXT: calll foo
-; CHECK-NEXT: shufpd {{.*#+}} xmm0 = xmm0[1,0]
-; CHECK-NEXT: addsd {{[0-9]+}}(%esp), %xmm0
-; CHECK-NEXT: movsd %xmm0, (%esp)
-; CHECK-NEXT: fldl (%esp)
-; CHECK-NEXT: addl $12, %esp
-; CHECK-NEXT: retl
+; X32-LABEL: test4:
+; X32: # BB#0: # %entry
+; X32-NEXT: subl $12, %esp
+; X32-NEXT: calll foo
+; X32-NEXT: shufpd {{.*#+}} xmm0 = xmm0[1,0]
+; X32-NEXT: addsd {{[0-9]+}}(%esp), %xmm0
+; X32-NEXT: movsd %xmm0, (%esp)
+; X32-NEXT: fldl (%esp)
+; X32-NEXT: addl $12, %esp
+; X32-NEXT: retl
+;
+; X64-LABEL: test4:
+; X64: # BB#0: # %entry
+; X64-NEXT: pushq %rax
+; X64-NEXT: movsd %xmm0, (%rsp) # 8-byte Spill
+; X64-NEXT: callq foo
+; X64-NEXT: shufpd {{.*#+}} xmm0 = xmm0[1,0]
+; X64-NEXT: addsd (%rsp), %xmm0 # 8-byte Folded Reload
+; X64-NEXT: popq %rax
+; X64-NEXT: retq
entry:
- %tmp1 = call <2 x double> @foo( ) ; <<2 x double>> [#uses=1]
- %tmp2 = extractelement <2 x double> %tmp1, i32 1 ; <double> [#uses=1]
- %tmp3 = fadd double %tmp2, %A ; <double> [#uses=1]
- ret double %tmp3
+ %tmp1 = call <2 x double> @foo( )
+ %tmp2 = extractelement <2 x double> %tmp1, i32 1
+ %tmp3 = fadd double %tmp2, %A
+ ret double %tmp3
}
declare <2 x double> @foo()
OpenPOWER on IntegriCloud