[PowerPC] Recommit r314244 with refactoring and off by default
[llvm-core.git] / test / CodeGen / X86 / vec_extract-sse4.ll
blobf073f1538d2ea63aa7e62b304910c7145c23d8f8
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown -mattr=+sse4.1 | FileCheck %s --check-prefix=X32
3 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse4.1 | FileCheck %s --check-prefix=X64
5 define void @t1(float* %R, <4 x float>* %P1) nounwind {
6 ; X32-LABEL: t1:
7 ; X32:       # BB#0:
8 ; X32-NEXT:    movl {{[0-9]+}}(%esp), %eax
9 ; X32-NEXT:    movl {{[0-9]+}}(%esp), %ecx
10 ; X32-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
11 ; X32-NEXT:    movss %xmm0, (%eax)
12 ; X32-NEXT:    retl
14 ; X64-LABEL: t1:
15 ; X64:       # BB#0:
16 ; X64-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
17 ; X64-NEXT:    movss %xmm0, (%rdi)
18 ; X64-NEXT:    retq
19   %X = load <4 x float>, <4 x float>* %P1
20   %tmp = extractelement <4 x float> %X, i32 3
21   store float %tmp, float* %R
22   ret void
25 define float @t2(<4 x float>* %P1) nounwind {
26 ; X32-LABEL: t2:
27 ; X32:       # BB#0:
28 ; X32-NEXT:    pushl %eax
29 ; X32-NEXT:    movl {{[0-9]+}}(%esp), %eax
30 ; X32-NEXT:    movddup {{.*#+}} xmm0 = mem[0,0]
31 ; X32-NEXT:    movss %xmm0, (%esp)
32 ; X32-NEXT:    flds (%esp)
33 ; X32-NEXT:    popl %eax
34 ; X32-NEXT:    retl
36 ; X64-LABEL: t2:
37 ; X64:       # BB#0:
38 ; X64-NEXT:    movddup {{.*#+}} xmm0 = mem[0,0]
39 ; X64-NEXT:    retq
40   %X = load <4 x float>, <4 x float>* %P1
41   %tmp = extractelement <4 x float> %X, i32 2
42   ret float %tmp
45 define void @t3(i32* %R, <4 x i32>* %P1) nounwind {
46 ; X32-LABEL: t3:
47 ; X32:       # BB#0:
48 ; X32-NEXT:    movl {{[0-9]+}}(%esp), %eax
49 ; X32-NEXT:    movl {{[0-9]+}}(%esp), %ecx
50 ; X32-NEXT:    movl 12(%ecx), %ecx
51 ; X32-NEXT:    movl %ecx, (%eax)
52 ; X32-NEXT:    retl
54 ; X64-LABEL: t3:
55 ; X64:       # BB#0:
56 ; X64-NEXT:    movl 12(%rsi), %eax
57 ; X64-NEXT:    movl %eax, (%rdi)
58 ; X64-NEXT:    retq
59   %X = load <4 x i32>, <4 x i32>* %P1
60   %tmp = extractelement <4 x i32> %X, i32 3
61   store i32 %tmp, i32* %R
62   ret void
65 define i32 @t4(<4 x i32>* %P1) nounwind {
66 ; X32-LABEL: t4:
67 ; X32:       # BB#0:
68 ; X32-NEXT:    movl {{[0-9]+}}(%esp), %eax
69 ; X32-NEXT:    movl 12(%eax), %eax
70 ; X32-NEXT:    retl
72 ; X64-LABEL: t4:
73 ; X64:       # BB#0:
74 ; X64-NEXT:    movl 12(%rdi), %eax
75 ; X64-NEXT:    retq
76   %X = load <4 x i32>, <4 x i32>* %P1
77   %tmp = extractelement <4 x i32> %X, i32 3
78   ret i32 %tmp