1 ; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=knl | FileCheck %s
7 define <16 x float> @test1(<16 x float> %x, float* %br, float %y) nounwind {
9 %rrr2 = insertelement <16 x float> %x, float %rrr, i32 1
10 %rrr3 = insertelement <16 x float> %rrr2, float %y, i32 14
11 ret <16 x float> %rrr3
15 ;CHECK: vinsertf32x4 $0
16 ;CHECK: vextractf32x4 $3
17 ;CHECK: vinsertf32x4 $3
19 define <8 x double> @test2(<8 x double> %x, double* %br, double %y) nounwind {
20 %rrr = load double* %br
21 %rrr2 = insertelement <8 x double> %x, double %rrr, i32 1
22 %rrr3 = insertelement <8 x double> %rrr2, double %y, i32 6
23 ret <8 x double> %rrr3
27 ;CHECK: vextractf32x4 $1
28 ;CHECK: vinsertf32x4 $0
30 define <16 x float> @test3(<16 x float> %x) nounwind {
31 %eee = extractelement <16 x float> %x, i32 4
32 %rrr2 = insertelement <16 x float> %x, float %eee, i32 1
33 ret <16 x float> %rrr2
37 ;CHECK: vextracti32x4 $2
38 ;CHECK: vinserti32x4 $0
40 define <8 x i64> @test4(<8 x i64> %x) nounwind {
41 %eee = extractelement <8 x i64> %x, i32 4
42 %rrr2 = insertelement <8 x i64> %x, i64 %eee, i32 1
49 define i32 @test5(<4 x float> %x) nounwind {
50 %ef = extractelement <4 x float> %x, i32 3
51 %ei = bitcast float %ef to i32
56 ;CHECK: vextractps {{.*}}, (%rdi)
58 define void @test6(<4 x float> %x, float* %out) nounwind {
59 %ef = extractelement <4 x float> %x, i32 3
60 store float %ef, float* %out, align 4
68 define float @test7(<16 x float> %x, i32 %ind) nounwind {
69 %e = extractelement <16 x float> %x, i32 %ind
77 define double @test8(<8 x double> %x, i32 %ind) nounwind {
78 %e = extractelement <8 x double> %x, i32 %ind
86 define float @test9(<8 x float> %x, i32 %ind) nounwind {
87 %e = extractelement <8 x float> %x, i32 %ind
94 ;CHECK: vmovd %xmm0, %eax
96 define i32 @test10(<16 x i32> %x, i32 %ind) nounwind {
97 %e = extractelement <16 x i32> %x, i32 %ind
109 define <16 x i32> @test11(<16 x i32>%a, <16 x i32>%b) {
110 %cmp_res = icmp ult <16 x i32> %a, %b
111 %ia = extractelement <16 x i1> %cmp_res, i32 4
112 br i1 %ia, label %A, label %B
116 %c = add <16 x i32>%b, %a
127 define i64 @test12(<16 x i64>%a, <16 x i64>%b, i64 %a1, i64 %b1) {
129 %cmpvector_func.i = icmp slt <16 x i64> %a, %b
130 %extract24vector_func.i = extractelement <16 x i1> %cmpvector_func.i, i32 0
131 %res = select i1 %extract24vector_func.i, i64 %a1, i64 %b1
140 define i16 @test13(i32 %a, i32 %b) {
141 %cmp_res = icmp ult i32 %a, %b
142 %maskv = insertelement <16 x i1> <i1 true, i1 false, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, i1 %cmp_res, i32 0
143 %res = bitcast <16 x i1> %maskv to i16
154 define i64 @test14(<8 x i64>%a, <8 x i64>%b, i64 %a1, i64 %b1) {
156 %cmpvector_func.i = icmp slt <8 x i64> %a, %b
157 %extract24vector_func.i = extractelement <8 x i1> %cmpvector_func.i, i32 4
158 %res = select i1 %extract24vector_func.i, i64 %a1, i64 %b1
166 define i16 @test15(i1 *%addr) {
167 %x = load i1 * %addr, align 128
168 %x1 = insertelement <16 x i1> undef, i1 %x, i32 10
169 %x2 = bitcast <16 x i1>%x1 to i16
178 define i16 @test16(i1 *%addr, i16 %a) {
179 %x = load i1 * %addr, align 128
180 %a1 = bitcast i16 %a to <16 x i1>
181 %x1 = insertelement <16 x i1> %a1, i1 %x, i32 10
182 %x2 = bitcast <16 x i1>%x1 to i16
191 define i8 @test17(i1 *%addr, i8 %a) {
192 %x = load i1 * %addr, align 128
193 %a1 = bitcast i8 %a to <8 x i1>
194 %x1 = insertelement <8 x i1> %a1, i1 %x, i32 10
195 %x2 = bitcast <8 x i1>%x1 to i8