1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+avx | FileCheck %s
4 define <8 x float> @A(<8 x float> %a) nounwind uwtable readnone ssp {
6 ; CHECK: ## %bb.0: ## %entry
7 ; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0
10 %shuffle = shufflevector <8 x float> %a, <8 x float> undef, <8 x i32> <i32 4, i32 5, i32 6, i32 7, i32 8, i32 8, i32 8, i32 8>
11 ret <8 x float> %shuffle
14 define <4 x double> @B(<4 x double> %a) nounwind uwtable readnone ssp {
16 ; CHECK: ## %bb.0: ## %entry
17 ; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0
20 %shuffle = shufflevector <4 x double> %a, <4 x double> undef, <4 x i32> <i32 2, i32 3, i32 4, i32 4>
21 ret <4 x double> %shuffle
24 define void @t0(float* nocapture %addr, <8 x float> %a) nounwind uwtable ssp {
26 ; CHECK: ## %bb.0: ## %entry
27 ; CHECK-NEXT: vextractf128 $1, %ymm0, (%rdi)
28 ; CHECK-NEXT: vzeroupper
31 %0 = tail call <4 x float> @llvm.x86.avx.vextractf128.ps.256(<8 x float> %a, i8 1)
32 %1 = bitcast float* %addr to <4 x float>*
33 store <4 x float> %0, <4 x float>* %1, align 16
37 define void @t2(double* nocapture %addr, <4 x double> %a) nounwind uwtable ssp {
39 ; CHECK: ## %bb.0: ## %entry
40 ; CHECK-NEXT: vextractf128 $1, %ymm0, (%rdi)
41 ; CHECK-NEXT: vzeroupper
44 %0 = tail call <2 x double> @llvm.x86.avx.vextractf128.pd.256(<4 x double> %a, i8 1)
45 %1 = bitcast double* %addr to <2 x double>*
46 store <2 x double> %0, <2 x double>* %1, align 16
50 define void @t4(<2 x i64>* nocapture %addr, <4 x i64> %a) nounwind uwtable ssp {
52 ; CHECK: ## %bb.0: ## %entry
53 ; CHECK-NEXT: vextractf128 $1, %ymm0, (%rdi)
54 ; CHECK-NEXT: vzeroupper
57 %0 = bitcast <4 x i64> %a to <8 x i32>
58 %1 = tail call <4 x i32> @llvm.x86.avx.vextractf128.si.256(<8 x i32> %0, i8 1)
59 %2 = bitcast <4 x i32> %1 to <2 x i64>
60 store <2 x i64> %2, <2 x i64>* %addr, align 16
64 define void @t5(float* nocapture %addr, <8 x float> %a) nounwind uwtable ssp {
66 ; CHECK: ## %bb.0: ## %entry
67 ; CHECK-NEXT: vmovaps %xmm0, (%rdi)
68 ; CHECK-NEXT: vzeroupper
71 %0 = tail call <4 x float> @llvm.x86.avx.vextractf128.ps.256(<8 x float> %a, i8 0)
72 %1 = bitcast float* %addr to <4 x float>*
73 store <4 x float> %0, <4 x float>* %1, align 16
77 define void @t6(double* nocapture %addr, <4 x double> %a) nounwind uwtable ssp {
79 ; CHECK: ## %bb.0: ## %entry
80 ; CHECK-NEXT: vmovaps %xmm0, (%rdi)
81 ; CHECK-NEXT: vzeroupper
84 %0 = tail call <2 x double> @llvm.x86.avx.vextractf128.pd.256(<4 x double> %a, i8 0)
85 %1 = bitcast double* %addr to <2 x double>*
86 store <2 x double> %0, <2 x double>* %1, align 16
90 define void @t7(<2 x i64>* nocapture %addr, <4 x i64> %a) nounwind uwtable ssp {
92 ; CHECK: ## %bb.0: ## %entry
93 ; CHECK-NEXT: vmovaps %xmm0, (%rdi)
94 ; CHECK-NEXT: vzeroupper
97 %0 = bitcast <4 x i64> %a to <8 x i32>
98 %1 = tail call <4 x i32> @llvm.x86.avx.vextractf128.si.256(<8 x i32> %0, i8 0)
99 %2 = bitcast <4 x i32> %1 to <2 x i64>
100 store <2 x i64> %2, <2 x i64>* %addr, align 16
104 define void @t8(<2 x i64>* nocapture %addr, <4 x i64> %a) nounwind uwtable ssp {
106 ; CHECK: ## %bb.0: ## %entry
107 ; CHECK-NEXT: vmovups %xmm0, (%rdi)
108 ; CHECK-NEXT: vzeroupper
111 %0 = bitcast <4 x i64> %a to <8 x i32>
112 %1 = tail call <4 x i32> @llvm.x86.avx.vextractf128.si.256(<8 x i32> %0, i8 0)
113 %2 = bitcast <4 x i32> %1 to <2 x i64>
114 store <2 x i64> %2, <2 x i64>* %addr, align 1
119 define void @t9(i64* %p) {
122 ; CHECK-NEXT: vxorps %xmm0, %xmm0, %xmm0
123 ; CHECK-NEXT: vmovups %ymm0, (%rdi)
124 ; CHECK-NEXT: vzeroupper
127 %q = getelementptr i64, i64* %p, i64 1
129 %r = getelementptr i64, i64* %p, i64 2
131 %s = getelementptr i64, i64* %p, i64 3
136 declare <2 x double> @llvm.x86.avx.vextractf128.pd.256(<4 x double>, i8) nounwind readnone
137 declare <4 x float> @llvm.x86.avx.vextractf128.ps.256(<8 x float>, i8) nounwind readnone
138 declare <4 x i32> @llvm.x86.avx.vextractf128.si.256(<8 x i32>, i8) nounwind readnone