1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -instcombine -S | FileCheck %s
3target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4
5define double @test_sqrt_sd_0(double %a) {
6; CHECK-LABEL: @test_sqrt_sd_0(
7; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x double> undef, double %a, i32 0
8; CHECK-NEXT:    [[TMP2:%.*]] = tail call <2 x double> @llvm.x86.sse2.sqrt.sd(<2 x double> [[TMP1]])
9; CHECK-NEXT:    [[TMP3:%.*]] = extractelement <2 x double> [[TMP2]], i32 0
10; CHECK-NEXT:    ret double [[TMP3]]
11;
12  %1 = insertelement <2 x double> undef, double %a, i32 0
13  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
14  %3 = tail call <2 x double> @llvm.x86.sse2.sqrt.sd(<2 x double> %2)
15  %4 = extractelement <2 x double> %3, i32 0
16  ret double %4
17}
18
19define double @test_sqrt_sd_1(double %a) {
20; CHECK-LABEL: @test_sqrt_sd_1(
21; CHECK-NEXT:    ret double 1.000000e+00
22;
23  %1 = insertelement <2 x double> undef, double %a, i32 0
24  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
25  %3 = tail call <2 x double> @llvm.x86.sse2.sqrt.sd(<2 x double> %2)
26  %4 = extractelement <2 x double> %3, i32 1
27  ret double %4
28}
29
30define <2 x double> @test_add_sd(<2 x double> %a, <2 x double> %b) {
31; CHECK-LABEL: @test_add_sd(
32; CHECK-NEXT:    [[TMP1:%.*]] = tail call <2 x double> @llvm.x86.sse2.add.sd(<2 x double> %a, <2 x double> %b)
33; CHECK-NEXT:    ret <2 x double> [[TMP1]]
34;
35  %1 = insertelement <2 x double> %b, double 2.000000e+00, i32 1
36  %2 = tail call <2 x double> @llvm.x86.sse2.add.sd(<2 x double> %a, <2 x double> %1)
37  ret <2 x double> %2
38}
39
40define double @test_add_sd_0(double %a, double %b) {
41; CHECK-LABEL: @test_add_sd_0(
42; CHECK-NEXT:    [[TMP1:%.*]] = fadd double %a, %b
43; CHECK-NEXT:    ret double [[TMP1]]
44;
45  %1 = insertelement <2 x double> undef, double %a, i32 0
46  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
47  %3 = insertelement <2 x double> undef, double %b, i32 0
48  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
49  %5 = tail call <2 x double> @llvm.x86.sse2.add.sd(<2 x double> %2, <2 x double> %4)
50  %6 = extractelement <2 x double> %5, i32 0
51  ret double %6
52}
53
54define double @test_add_sd_1(double %a, double %b) {
55; CHECK-LABEL: @test_add_sd_1(
56; CHECK-NEXT:    ret double 1.000000e+00
57;
58  %1 = insertelement <2 x double> undef, double %a, i32 0
59  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
60  %3 = insertelement <2 x double> undef, double %b, i32 0
61  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
62  %5 = tail call <2 x double> @llvm.x86.sse2.add.sd(<2 x double> %2, <2 x double> %4)
63  %6 = extractelement <2 x double> %5, i32 1
64  ret double %6
65}
66
67define <2 x double> @test_sub_sd(<2 x double> %a, <2 x double> %b) {
68; CHECK-LABEL: @test_sub_sd(
69; CHECK-NEXT:    [[TMP1:%.*]] = tail call <2 x double> @llvm.x86.sse2.sub.sd(<2 x double> %a, <2 x double> %b)
70; CHECK-NEXT:    ret <2 x double> [[TMP1]]
71;
72  %1 = insertelement <2 x double> %b, double 2.000000e+00, i32 1
73  %2 = tail call <2 x double> @llvm.x86.sse2.sub.sd(<2 x double> %a, <2 x double> %1)
74  ret <2 x double> %2
75}
76
77define double @test_sub_sd_0(double %a, double %b) {
78; CHECK-LABEL: @test_sub_sd_0(
79; CHECK-NEXT:    [[TMP1:%.*]] = fsub double %a, %b
80; CHECK-NEXT:    ret double [[TMP1]]
81;
82  %1 = insertelement <2 x double> undef, double %a, i32 0
83  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
84  %3 = insertelement <2 x double> undef, double %b, i32 0
85  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
86  %5 = tail call <2 x double> @llvm.x86.sse2.sub.sd(<2 x double> %2, <2 x double> %4)
87  %6 = extractelement <2 x double> %5, i32 0
88  ret double %6
89}
90
91define double @test_sub_sd_1(double %a, double %b) {
92; CHECK-LABEL: @test_sub_sd_1(
93; CHECK-NEXT:    ret double 1.000000e+00
94;
95  %1 = insertelement <2 x double> undef, double %a, i32 0
96  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
97  %3 = insertelement <2 x double> undef, double %b, i32 0
98  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
99  %5 = tail call <2 x double> @llvm.x86.sse2.sub.sd(<2 x double> %2, <2 x double> %4)
100  %6 = extractelement <2 x double> %5, i32 1
101  ret double %6
102}
103
104define <2 x double> @test_mul_sd(<2 x double> %a, <2 x double> %b) {
105; CHECK-LABEL: @test_mul_sd(
106; CHECK-NEXT:    [[TMP1:%.*]] = tail call <2 x double> @llvm.x86.sse2.mul.sd(<2 x double> %a, <2 x double> %b)
107; CHECK-NEXT:    ret <2 x double> [[TMP1]]
108;
109  %1 = insertelement <2 x double> %b, double 2.000000e+00, i32 1
110  %2 = tail call <2 x double> @llvm.x86.sse2.mul.sd(<2 x double> %a, <2 x double> %1)
111  ret <2 x double> %2
112}
113
114define double @test_mul_sd_0(double %a, double %b) {
115; CHECK-LABEL: @test_mul_sd_0(
116; CHECK-NEXT:    [[TMP1:%.*]] = fmul double %a, %b
117; CHECK-NEXT:    ret double [[TMP1]]
118;
119  %1 = insertelement <2 x double> undef, double %a, i32 0
120  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
121  %3 = insertelement <2 x double> undef, double %b, i32 0
122  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
123  %5 = tail call <2 x double> @llvm.x86.sse2.mul.sd(<2 x double> %2, <2 x double> %4)
124  %6 = extractelement <2 x double> %5, i32 0
125  ret double %6
126}
127
128define double @test_mul_sd_1(double %a, double %b) {
129; CHECK-LABEL: @test_mul_sd_1(
130; CHECK-NEXT:    ret double 1.000000e+00
131;
132  %1 = insertelement <2 x double> undef, double %a, i32 0
133  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
134  %3 = insertelement <2 x double> undef, double %b, i32 0
135  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
136  %5 = tail call <2 x double> @llvm.x86.sse2.mul.sd(<2 x double> %2, <2 x double> %4)
137  %6 = extractelement <2 x double> %5, i32 1
138  ret double %6
139}
140
141define <2 x double> @test_div_sd(<2 x double> %a, <2 x double> %b) {
142; CHECK-LABEL: @test_div_sd(
143; CHECK-NEXT:    [[TMP1:%.*]] = tail call <2 x double> @llvm.x86.sse2.div.sd(<2 x double> %a, <2 x double> %b)
144; CHECK-NEXT:    ret <2 x double> [[TMP1]]
145;
146  %1 = insertelement <2 x double> %b, double 2.000000e+00, i32 1
147  %2 = tail call <2 x double> @llvm.x86.sse2.div.sd(<2 x double> %a, <2 x double> %1)
148  ret <2 x double> %2
149}
150
151define double @test_div_sd_0(double %a, double %b) {
152; CHECK-LABEL: @test_div_sd_0(
153; CHECK-NEXT:    [[TMP1:%.*]] = fdiv double %a, %b
154; CHECK-NEXT:    ret double [[TMP1]]
155;
156  %1 = insertelement <2 x double> undef, double %a, i32 0
157  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
158  %3 = insertelement <2 x double> undef, double %b, i32 0
159  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
160  %5 = tail call <2 x double> @llvm.x86.sse2.div.sd(<2 x double> %2, <2 x double> %4)
161  %6 = extractelement <2 x double> %5, i32 0
162  ret double %6
163}
164
165define double @test_div_sd_1(double %a, double %b) {
166; CHECK-LABEL: @test_div_sd_1(
167; CHECK-NEXT:    ret double 1.000000e+00
168;
169  %1 = insertelement <2 x double> undef, double %a, i32 0
170  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
171  %3 = insertelement <2 x double> undef, double %b, i32 0
172  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
173  %5 = tail call <2 x double> @llvm.x86.sse2.div.sd(<2 x double> %2, <2 x double> %4)
174  %6 = extractelement <2 x double> %5, i32 1
175  ret double %6
176}
177
178define <2 x double> @test_min_sd(<2 x double> %a, <2 x double> %b) {
179; CHECK-LABEL: @test_min_sd(
180; CHECK-NEXT:    [[TMP1:%.*]] = tail call <2 x double> @llvm.x86.sse2.min.sd(<2 x double> %a, <2 x double> %b)
181; CHECK-NEXT:    ret <2 x double> [[TMP1]]
182;
183  %1 = insertelement <2 x double> %b, double 2.000000e+00, i32 1
184  %2 = tail call <2 x double> @llvm.x86.sse2.min.sd(<2 x double> %a, <2 x double> %1)
185  ret <2 x double> %2
186}
187
188define double @test_min_sd_0(double %a, double %b) {
189; CHECK-LABEL: @test_min_sd_0(
190; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x double> undef, double %a, i32 0
191; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <2 x double> undef, double %b, i32 0
192; CHECK-NEXT:    [[TMP3:%.*]] = tail call <2 x double> @llvm.x86.sse2.min.sd(<2 x double> [[TMP1]], <2 x double> [[TMP2]])
193; CHECK-NEXT:    [[TMP4:%.*]] = extractelement <2 x double> [[TMP3]], i32 0
194; CHECK-NEXT:    ret double [[TMP4]]
195;
196  %1 = insertelement <2 x double> undef, double %a, i32 0
197  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
198  %3 = insertelement <2 x double> undef, double %b, i32 0
199  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
200  %5 = tail call <2 x double> @llvm.x86.sse2.min.sd(<2 x double> %2, <2 x double> %4)
201  %6 = extractelement <2 x double> %5, i32 0
202  ret double %6
203}
204
205define double @test_min_sd_1(double %a, double %b) {
206; CHECK-LABEL: @test_min_sd_1(
207; CHECK-NEXT:    ret double 1.000000e+00
208;
209  %1 = insertelement <2 x double> undef, double %a, i32 0
210  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
211  %3 = insertelement <2 x double> undef, double %b, i32 0
212  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
213  %5 = tail call <2 x double> @llvm.x86.sse2.min.sd(<2 x double> %2, <2 x double> %4)
214  %6 = extractelement <2 x double> %5, i32 1
215  ret double %6
216}
217
218define <2 x double> @test_max_sd(<2 x double> %a, <2 x double> %b) {
219; CHECK-LABEL: @test_max_sd(
220; CHECK-NEXT:    [[TMP1:%.*]] = tail call <2 x double> @llvm.x86.sse2.max.sd(<2 x double> %a, <2 x double> %b)
221; CHECK-NEXT:    ret <2 x double> [[TMP1]]
222;
223  %1 = insertelement <2 x double> %b, double 2.000000e+00, i32 1
224  %2 = tail call <2 x double> @llvm.x86.sse2.max.sd(<2 x double> %a, <2 x double> %1)
225  ret <2 x double> %2
226}
227
228define double @test_max_sd_0(double %a, double %b) {
229; CHECK-LABEL: @test_max_sd_0(
230; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x double> undef, double %a, i32 0
231; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <2 x double> undef, double %b, i32 0
232; CHECK-NEXT:    [[TMP3:%.*]] = tail call <2 x double> @llvm.x86.sse2.max.sd(<2 x double> [[TMP1]], <2 x double> [[TMP2]])
233; CHECK-NEXT:    [[TMP4:%.*]] = extractelement <2 x double> [[TMP3]], i32 0
234; CHECK-NEXT:    ret double [[TMP4]]
235;
236  %1 = insertelement <2 x double> undef, double %a, i32 0
237  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
238  %3 = insertelement <2 x double> undef, double %b, i32 0
239  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
240  %5 = tail call <2 x double> @llvm.x86.sse2.max.sd(<2 x double> %2, <2 x double> %4)
241  %6 = extractelement <2 x double> %5, i32 0
242  ret double %6
243}
244
245define double @test_max_sd_1(double %a, double %b) {
246; CHECK-LABEL: @test_max_sd_1(
247; CHECK-NEXT:    ret double 1.000000e+00
248;
249  %1 = insertelement <2 x double> undef, double %a, i32 0
250  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
251  %3 = insertelement <2 x double> undef, double %b, i32 0
252  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
253  %5 = tail call <2 x double> @llvm.x86.sse2.max.sd(<2 x double> %2, <2 x double> %4)
254  %6 = extractelement <2 x double> %5, i32 1
255  ret double %6
256}
257
258define <2 x double> @test_cmp_sd(<2 x double> %a, <2 x double> %b) {
259; CHECK-LABEL: @test_cmp_sd(
260; CHECK-NEXT:    [[TMP1:%.*]] = tail call <2 x double> @llvm.x86.sse2.cmp.sd(<2 x double> %a, <2 x double> %b, i8 0)
261; CHECK-NEXT:    ret <2 x double> [[TMP1]]
262;
263  %1 = insertelement <2 x double> %b, double 2.000000e+00, i32 1
264  %2 = tail call <2 x double> @llvm.x86.sse2.cmp.sd(<2 x double> %a, <2 x double> %1, i8 0)
265  ret <2 x double> %2
266}
267
268define double @test_cmp_sd_0(double %a, double %b) {
269; CHECK-LABEL: @test_cmp_sd_0(
270; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x double> undef, double %a, i32 0
271; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <2 x double> undef, double %b, i32 0
272; CHECK-NEXT:    [[TMP3:%.*]] = tail call <2 x double> @llvm.x86.sse2.cmp.sd(<2 x double> [[TMP1]], <2 x double> [[TMP2]], i8 0)
273; CHECK-NEXT:    [[TMP4:%.*]] = extractelement <2 x double> [[TMP3]], i32 0
274; CHECK-NEXT:    ret double [[TMP4]]
275;
276  %1 = insertelement <2 x double> undef, double %a, i32 0
277  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
278  %3 = insertelement <2 x double> undef, double %b, i32 0
279  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
280  %5 = tail call <2 x double> @llvm.x86.sse2.cmp.sd(<2 x double> %2, <2 x double> %4, i8 0)
281  %6 = extractelement <2 x double> %5, i32 0
282  ret double %6
283}
284
285define double @test_cmp_sd_1(double %a, double %b) {
286; CHECK-LABEL: @test_cmp_sd_1(
287; CHECK-NEXT:    ret double 1.000000e+00
288;
289  %1 = insertelement <2 x double> undef, double %a, i32 0
290  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
291  %3 = insertelement <2 x double> undef, double %b, i32 0
292  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
293  %5 = tail call <2 x double> @llvm.x86.sse2.cmp.sd(<2 x double> %2, <2 x double> %4, i8 0)
294  %6 = extractelement <2 x double> %5, i32 1
295  ret double %6
296}
297
298define i32 @test_comieq_sd_0(double %a, double %b) {
299; CHECK-LABEL: @test_comieq_sd_0(
300; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x double> undef, double %a, i32 0
301; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <2 x double> undef, double %b, i32 0
302; CHECK-NEXT:    [[TMP3:%.*]] = tail call i32 @llvm.x86.sse2.comieq.sd(<2 x double> [[TMP1]], <2 x double> [[TMP2]])
303; CHECK-NEXT:    ret i32 [[TMP3]]
304;
305  %1 = insertelement <2 x double> undef, double %a, i32 0
306  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
307  %3 = insertelement <2 x double> undef, double %b, i32 0
308  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
309  %5 = tail call i32 @llvm.x86.sse2.comieq.sd(<2 x double> %2, <2 x double> %4)
310  ret i32 %5
311}
312
313define i32 @test_comige_sd_0(double %a, double %b) {
314; CHECK-LABEL: @test_comige_sd_0(
315; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x double> undef, double %a, i32 0
316; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <2 x double> undef, double %b, i32 0
317; CHECK-NEXT:    [[TMP3:%.*]] = tail call i32 @llvm.x86.sse2.comige.sd(<2 x double> [[TMP1]], <2 x double> [[TMP2]])
318; CHECK-NEXT:    ret i32 [[TMP3]]
319;
320  %1 = insertelement <2 x double> undef, double %a, i32 0
321  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
322  %3 = insertelement <2 x double> undef, double %b, i32 0
323  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
324  %5 = tail call i32 @llvm.x86.sse2.comige.sd(<2 x double> %2, <2 x double> %4)
325  ret i32 %5
326}
327
328define i32 @test_comigt_sd_0(double %a, double %b) {
329; CHECK-LABEL: @test_comigt_sd_0(
330; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x double> undef, double %a, i32 0
331; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <2 x double> undef, double %b, i32 0
332; CHECK-NEXT:    [[TMP3:%.*]] = tail call i32 @llvm.x86.sse2.comigt.sd(<2 x double> [[TMP1]], <2 x double> [[TMP2]])
333; CHECK-NEXT:    ret i32 [[TMP3]]
334;
335  %1 = insertelement <2 x double> undef, double %a, i32 0
336  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
337  %3 = insertelement <2 x double> undef, double %b, i32 0
338  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
339  %5 = tail call i32 @llvm.x86.sse2.comigt.sd(<2 x double> %2, <2 x double> %4)
340  ret i32 %5
341}
342
343define i32 @test_comile_sd_0(double %a, double %b) {
344; CHECK-LABEL: @test_comile_sd_0(
345; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x double> undef, double %a, i32 0
346; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <2 x double> undef, double %b, i32 0
347; CHECK-NEXT:    [[TMP3:%.*]] = tail call i32 @llvm.x86.sse2.comile.sd(<2 x double> [[TMP1]], <2 x double> [[TMP2]])
348; CHECK-NEXT:    ret i32 [[TMP3]]
349;
350  %1 = insertelement <2 x double> undef, double %a, i32 0
351  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
352  %3 = insertelement <2 x double> undef, double %b, i32 0
353  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
354  %5 = tail call i32 @llvm.x86.sse2.comile.sd(<2 x double> %2, <2 x double> %4)
355  ret i32 %5
356}
357
358define i32 @test_comilt_sd_0(double %a, double %b) {
359; CHECK-LABEL: @test_comilt_sd_0(
360; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x double> undef, double %a, i32 0
361; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <2 x double> undef, double %b, i32 0
362; CHECK-NEXT:    [[TMP3:%.*]] = tail call i32 @llvm.x86.sse2.comilt.sd(<2 x double> [[TMP1]], <2 x double> [[TMP2]])
363; CHECK-NEXT:    ret i32 [[TMP3]]
364;
365  %1 = insertelement <2 x double> undef, double %a, i32 0
366  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
367  %3 = insertelement <2 x double> undef, double %b, i32 0
368  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
369  %5 = tail call i32 @llvm.x86.sse2.comilt.sd(<2 x double> %2, <2 x double> %4)
370  ret i32 %5
371}
372
373define i32 @test_comineq_sd_0(double %a, double %b) {
374; CHECK-LABEL: @test_comineq_sd_0(
375; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x double> undef, double %a, i32 0
376; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <2 x double> undef, double %b, i32 0
377; CHECK-NEXT:    [[TMP3:%.*]] = tail call i32 @llvm.x86.sse2.comineq.sd(<2 x double> [[TMP1]], <2 x double> [[TMP2]])
378; CHECK-NEXT:    ret i32 [[TMP3]]
379;
380  %1 = insertelement <2 x double> undef, double %a, i32 0
381  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
382  %3 = insertelement <2 x double> undef, double %b, i32 0
383  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
384  %5 = tail call i32 @llvm.x86.sse2.comineq.sd(<2 x double> %2, <2 x double> %4)
385  ret i32 %5
386}
387
388define i32 @test_ucomieq_sd_0(double %a, double %b) {
389; CHECK-LABEL: @test_ucomieq_sd_0(
390; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x double> undef, double %a, i32 0
391; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <2 x double> undef, double %b, i32 0
392; CHECK-NEXT:    [[TMP3:%.*]] = tail call i32 @llvm.x86.sse2.ucomieq.sd(<2 x double> [[TMP1]], <2 x double> [[TMP2]])
393; CHECK-NEXT:    ret i32 [[TMP3]]
394;
395  %1 = insertelement <2 x double> undef, double %a, i32 0
396  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
397  %3 = insertelement <2 x double> undef, double %b, i32 0
398  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
399  %5 = tail call i32 @llvm.x86.sse2.ucomieq.sd(<2 x double> %2, <2 x double> %4)
400  ret i32 %5
401}
402
403define i32 @test_ucomige_sd_0(double %a, double %b) {
404; CHECK-LABEL: @test_ucomige_sd_0(
405; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x double> undef, double %a, i32 0
406; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <2 x double> undef, double %b, i32 0
407; CHECK-NEXT:    [[TMP3:%.*]] = tail call i32 @llvm.x86.sse2.ucomige.sd(<2 x double> [[TMP1]], <2 x double> [[TMP2]])
408; CHECK-NEXT:    ret i32 [[TMP3]]
409;
410  %1 = insertelement <2 x double> undef, double %a, i32 0
411  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
412  %3 = insertelement <2 x double> undef, double %b, i32 0
413  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
414  %5 = tail call i32 @llvm.x86.sse2.ucomige.sd(<2 x double> %2, <2 x double> %4)
415  ret i32 %5
416}
417
418define i32 @test_ucomigt_sd_0(double %a, double %b) {
419; CHECK-LABEL: @test_ucomigt_sd_0(
420; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x double> undef, double %a, i32 0
421; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <2 x double> undef, double %b, i32 0
422; CHECK-NEXT:    [[TMP3:%.*]] = tail call i32 @llvm.x86.sse2.ucomigt.sd(<2 x double> [[TMP1]], <2 x double> [[TMP2]])
423; CHECK-NEXT:    ret i32 [[TMP3]]
424;
425  %1 = insertelement <2 x double> undef, double %a, i32 0
426  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
427  %3 = insertelement <2 x double> undef, double %b, i32 0
428  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
429  %5 = tail call i32 @llvm.x86.sse2.ucomigt.sd(<2 x double> %2, <2 x double> %4)
430  ret i32 %5
431}
432
433define i32 @test_ucomile_sd_0(double %a, double %b) {
434; CHECK-LABEL: @test_ucomile_sd_0(
435; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x double> undef, double %a, i32 0
436; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <2 x double> undef, double %b, i32 0
437; CHECK-NEXT:    [[TMP3:%.*]] = tail call i32 @llvm.x86.sse2.ucomile.sd(<2 x double> [[TMP1]], <2 x double> [[TMP2]])
438; CHECK-NEXT:    ret i32 [[TMP3]]
439;
440  %1 = insertelement <2 x double> undef, double %a, i32 0
441  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
442  %3 = insertelement <2 x double> undef, double %b, i32 0
443  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
444  %5 = tail call i32 @llvm.x86.sse2.ucomile.sd(<2 x double> %2, <2 x double> %4)
445  ret i32 %5
446}
447
448define i32 @test_ucomilt_sd_0(double %a, double %b) {
449; CHECK-LABEL: @test_ucomilt_sd_0(
450; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x double> undef, double %a, i32 0
451; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <2 x double> undef, double %b, i32 0
452; CHECK-NEXT:    [[TMP3:%.*]] = tail call i32 @llvm.x86.sse2.ucomilt.sd(<2 x double> [[TMP1]], <2 x double> [[TMP2]])
453; CHECK-NEXT:    ret i32 [[TMP3]]
454;
455  %1 = insertelement <2 x double> undef, double %a, i32 0
456  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
457  %3 = insertelement <2 x double> undef, double %b, i32 0
458  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
459  %5 = tail call i32 @llvm.x86.sse2.ucomilt.sd(<2 x double> %2, <2 x double> %4)
460  ret i32 %5
461}
462
463define i32 @test_ucomineq_sd_0(double %a, double %b) {
464; CHECK-LABEL: @test_ucomineq_sd_0(
465; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x double> undef, double %a, i32 0
466; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <2 x double> undef, double %b, i32 0
467; CHECK-NEXT:    [[TMP3:%.*]] = tail call i32 @llvm.x86.sse2.ucomineq.sd(<2 x double> [[TMP1]], <2 x double> [[TMP2]])
468; CHECK-NEXT:    ret i32 [[TMP3]]
469;
470  %1 = insertelement <2 x double> undef, double %a, i32 0
471  %2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
472  %3 = insertelement <2 x double> undef, double %b, i32 0
473  %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
474  %5 = tail call i32 @llvm.x86.sse2.ucomineq.sd(<2 x double> %2, <2 x double> %4)
475  ret i32 %5
476}
477
478declare <2 x double> @llvm.x86.sse2.sqrt.sd(<2 x double>) nounwind readnone
479
480declare <2 x double> @llvm.x86.sse2.add.sd(<2 x double>, <2 x double>)
481declare <2 x double> @llvm.x86.sse2.sub.sd(<2 x double>, <2 x double>)
482declare <2 x double> @llvm.x86.sse2.mul.sd(<2 x double>, <2 x double>)
483declare <2 x double> @llvm.x86.sse2.div.sd(<2 x double>, <2 x double>)
484declare <2 x double> @llvm.x86.sse2.min.sd(<2 x double>, <2 x double>)
485declare <2 x double> @llvm.x86.sse2.max.sd(<2 x double>, <2 x double>)
486declare <2 x double> @llvm.x86.sse2.cmp.sd(<2 x double>, <2 x double>, i8)
487
488declare i32 @llvm.x86.sse2.comieq.sd(<2 x double>, <2 x double>)
489declare i32 @llvm.x86.sse2.comige.sd(<2 x double>, <2 x double>)
490declare i32 @llvm.x86.sse2.comigt.sd(<2 x double>, <2 x double>)
491declare i32 @llvm.x86.sse2.comile.sd(<2 x double>, <2 x double>)
492declare i32 @llvm.x86.sse2.comilt.sd(<2 x double>, <2 x double>)
493declare i32 @llvm.x86.sse2.comineq.sd(<2 x double>, <2 x double>)
494
495declare i32 @llvm.x86.sse2.ucomieq.sd(<2 x double>, <2 x double>)
496declare i32 @llvm.x86.sse2.ucomige.sd(<2 x double>, <2 x double>)
497declare i32 @llvm.x86.sse2.ucomigt.sd(<2 x double>, <2 x double>)
498declare i32 @llvm.x86.sse2.ucomile.sd(<2 x double>, <2 x double>)
499declare i32 @llvm.x86.sse2.ucomilt.sd(<2 x double>, <2 x double>)
500declare i32 @llvm.x86.sse2.ucomineq.sd(<2 x double>, <2 x double>)
501