@@ -119,6 +119,17 @@ define float @test_add_ss_1(float %a, float %b) {
119
119
ret float %7
120
120
}
121
121
122
+ define float @test_add_ss_2 (float %a ) {
123
+ ; CHECK-LABEL: @test_add_ss_2(
124
+ ; CHECK-NEXT: [[TMP1:%.*]] = fadd float [[A:%.*]], [[A]]
125
+ ; CHECK-NEXT: ret float [[TMP1]]
126
+ ;
127
+ %1 = insertelement <4 x float > zeroinitializer , float %a , i32 0
128
+ %2 = tail call <4 x float > @llvm.x86.sse.add.ss (<4 x float > %1 , <4 x float > %1 )
129
+ %3 = extractelement <4 x float > %2 , i32 0
130
+ ret float %3
131
+ }
132
+
122
133
define float @test_sub_ss_0 (float %a , float %b ) {
123
134
; CHECK-LABEL: @test_sub_ss_0(
124
135
; CHECK-NEXT: [[TMP1:%.*]] = fsub float [[A:%.*]], [[B:%.*]]
@@ -151,6 +162,17 @@ define float @test_sub_ss_2(float %a, float %b) {
151
162
ret float %7
152
163
}
153
164
165
+ define float @test_sub_ss_3 (float %a ) {
166
+ ; CHECK-LABEL: @test_sub_ss_3(
167
+ ; CHECK-NEXT: [[TMP1:%.*]] = fsub float [[A:%.*]], [[A]]
168
+ ; CHECK-NEXT: ret float [[TMP1]]
169
+ ;
170
+ %1 = insertelement <4 x float > zeroinitializer , float %a , i32 0
171
+ %2 = tail call <4 x float > @llvm.x86.sse.sub.ss (<4 x float > %1 , <4 x float > %1 )
172
+ %3 = extractelement <4 x float > %2 , i32 0
173
+ ret float %3
174
+ }
175
+
154
176
define float @test_mul_ss_0 (float %a , float %b ) {
155
177
; CHECK-LABEL: @test_mul_ss_0(
156
178
; CHECK-NEXT: [[TMP1:%.*]] = fmul float [[A:%.*]], [[B:%.*]]
@@ -183,6 +205,17 @@ define float @test_mul_ss_3(float %a, float %b) {
183
205
ret float %7
184
206
}
185
207
208
+ define float @test_mul_ss_4 (float %a ) {
209
+ ; CHECK-LABEL: @test_mul_ss_4(
210
+ ; CHECK-NEXT: [[TMP1:%.*]] = fmul float [[A:%.*]], [[A]]
211
+ ; CHECK-NEXT: ret float [[TMP1]]
212
+ ;
213
+ %1 = insertelement <4 x float > zeroinitializer , float %a , i32 0
214
+ %2 = tail call <4 x float > @llvm.x86.sse.mul.ss (<4 x float > %1 , <4 x float > %1 )
215
+ %3 = extractelement <4 x float > %2 , i32 0
216
+ ret float %3
217
+ }
218
+
186
219
define float @test_div_ss_0 (float %a , float %b ) {
187
220
; CHECK-LABEL: @test_div_ss_0(
188
221
; CHECK-NEXT: [[TMP1:%.*]] = fdiv float [[A:%.*]], [[B:%.*]]
@@ -215,6 +248,17 @@ define float @test_div_ss_1(float %a, float %b) {
215
248
ret float %7
216
249
}
217
250
251
+ define float @test_div_ss_2 (float %a ) {
252
+ ; CHECK-LABEL: @test_div_ss_2(
253
+ ; CHECK-NEXT: [[TMP1:%.*]] = fdiv float [[A:%.*]], [[A]]
254
+ ; CHECK-NEXT: ret float [[TMP1]]
255
+ ;
256
+ %1 = insertelement <4 x float > zeroinitializer , float %a , i32 0
257
+ %2 = tail call <4 x float > @llvm.x86.sse.div.ss (<4 x float > %1 , <4 x float > %1 )
258
+ %3 = extractelement <4 x float > %2 , i32 0
259
+ ret float %3
260
+ }
261
+
218
262
define <4 x float > @test_min_ss (<4 x float > %a , <4 x float > %b ) {
219
263
; CHECK-LABEL: @test_min_ss(
220
264
; CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.x86.sse.min.ss(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]])
@@ -262,6 +306,19 @@ define float @test_min_ss_2(float %a, float %b) {
262
306
ret float %7
263
307
}
264
308
309
+ define float @test_min_ss_3 (float %a ) {
310
+ ; CHECK-LABEL: @test_min_ss_3(
311
+ ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x float> <float undef, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, float [[A:%.*]], i32 0
312
+ ; CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x float> @llvm.x86.sse.min.ss(<4 x float> [[TMP1]], <4 x float> [[TMP1]])
313
+ ; CHECK-NEXT: [[TMP3:%.*]] = extractelement <4 x float> [[TMP2]], i32 0
314
+ ; CHECK-NEXT: ret float [[TMP3]]
315
+ ;
316
+ %1 = insertelement <4 x float > zeroinitializer , float %a , i32 0
317
+ %2 = tail call <4 x float > @llvm.x86.sse.min.ss (<4 x float > %1 , <4 x float > %1 )
318
+ %3 = extractelement <4 x float > %2 , i32 0
319
+ ret float %3
320
+ }
321
+
265
322
define <4 x float > @test_max_ss (<4 x float > %a , <4 x float > %b ) {
266
323
; CHECK-LABEL: @test_max_ss(
267
324
; CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.x86.sse.max.ss(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]])
@@ -309,6 +366,19 @@ define float @test_max_ss_3(float %a, float %b) {
309
366
ret float %7
310
367
}
311
368
369
+ define float @test_max_ss_4 (float %a ) {
370
+ ; CHECK-LABEL: @test_max_ss_4(
371
+ ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x float> <float undef, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, float [[A:%.*]], i32 0
372
+ ; CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x float> @llvm.x86.sse.max.ss(<4 x float> [[TMP1]], <4 x float> [[TMP1]])
373
+ ; CHECK-NEXT: [[TMP3:%.*]] = extractelement <4 x float> [[TMP2]], i32 0
374
+ ; CHECK-NEXT: ret float [[TMP3]]
375
+ ;
376
+ %1 = insertelement <4 x float > zeroinitializer , float %a , i32 0
377
+ %2 = tail call <4 x float > @llvm.x86.sse.max.ss (<4 x float > %1 , <4 x float > %1 )
378
+ %3 = extractelement <4 x float > %2 , i32 0
379
+ ret float %3
380
+ }
381
+
312
382
define <4 x float > @test_cmp_ss (<4 x float > %a , <4 x float > %b ) {
313
383
; CHECK-LABEL: @test_cmp_ss(
314
384
; CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.x86.sse.cmp.ss(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]], i8 0)
@@ -356,6 +426,19 @@ define float @test_cmp_ss_1(float %a, float %b) {
356
426
ret float %7
357
427
}
358
428
429
+ define float @test_cmp_ss_2 (float %a ) {
430
+ ; CHECK-LABEL: @test_cmp_ss_2(
431
+ ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x float> <float undef, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, float [[A:%.*]], i32 0
432
+ ; CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x float> @llvm.x86.sse.cmp.ss(<4 x float> [[TMP1]], <4 x float> [[TMP1]], i8 3)
433
+ ; CHECK-NEXT: [[TMP3:%.*]] = extractelement <4 x float> [[TMP2]], i32 0
434
+ ; CHECK-NEXT: ret float [[TMP3]]
435
+ ;
436
+ %1 = insertelement <4 x float > zeroinitializer , float %a , i32 0
437
+ %2 = tail call <4 x float > @llvm.x86.sse.cmp.ss (<4 x float > %1 , <4 x float > %1 , i8 3 )
438
+ %3 = extractelement <4 x float > %2 , i32 0
439
+ ret float %3
440
+ }
441
+
359
442
define i32 @test_comieq_ss_0 (float %a , float %b ) {
360
443
; CHECK-LABEL: @test_comieq_ss_0(
361
444
; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x float> undef, float [[A:%.*]], i32 0
0 commit comments