Skip to content

Commit 637f352

Browse files
[NFC][CostModel][AArch64] Add bf16 coverage for compare tests.
1 parent bcfc9f4 commit 637f352

File tree

2 files changed

+212
-6
lines changed

2 files changed

+212
-6
lines changed

llvm/test/Analysis/CostModel/AArch64/cmp.ll

+4
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ define void @cmps() {
1616
; CHECK-NEXT: Cost Model: Found costs of 1 for: %cf16 = fcmp oge half undef, undef
1717
; CHECK-NEXT: Cost Model: Found costs of 1 for: %cf32 = fcmp ogt float undef, undef
1818
; CHECK-NEXT: Cost Model: Found costs of 1 for: %cf64 = fcmp ogt double undef, undef
19+
; CHECK-NEXT: Cost Model: Found costs of 1 for: %cbf64 = fcmp ogt bfloat undef, undef
1920
; CHECK-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %cfv816 = fcmp olt <8 x half> undef, undef
2021
; CHECK-NEXT: Cost Model: Found costs of 1 for: %cfv432 = fcmp oge <4 x float> undef, undef
2122
; CHECK-NEXT: Cost Model: Found costs of 1 for: %cfv264 = fcmp oge <2 x double> undef, undef
23+
; CHECK-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %cbfv816 = fcmp olt <8 x bfloat> undef, undef
2224
; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
2325
;
2426
%c8 = icmp slt i8 undef, undef
@@ -32,9 +34,11 @@ define void @cmps() {
3234
%cf16 = fcmp oge half undef, undef
3335
%cf32 = fcmp ogt float undef, undef
3436
%cf64 = fcmp ogt double undef, undef
37+
%cbf64 = fcmp ogt bfloat undef, undef
3538
%cfv816 = fcmp olt <8 x half> undef, undef
3639
%cfv432 = fcmp oge <4 x float> undef, undef
3740
%cfv264 = fcmp oge <2 x double> undef, undef
41+
%cbfv816 = fcmp olt <8 x bfloat> undef, undef
3842
ret void
3943
}
4044

llvm/test/Analysis/CostModel/AArch64/vector-select.ll

+208-6
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,28 @@ define <2 x double> @v2f64_select_ogt(<2 x double> %a, <2 x double> %b, <2 x dou
166166
ret <2 x double> %s.1
167167
}
168168

169+
define <4 x bfloat> @v4bf16_select_ogt(<4 x bfloat> %a, <4 x bfloat> %b, <4 x bfloat> %c) {
170+
; COST-LABEL: 'v4bf16_select_ogt'
171+
; COST-NEXT: Cost Model: Found costs of 1 for: %cmp.1 = fcmp ogt <4 x bfloat> %a, %b
172+
; COST-NEXT: Cost Model: Found costs of RThru:10 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <4 x i1> %cmp.1, <4 x bfloat> %a, <4 x bfloat> %c
173+
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x bfloat> %s.1
174+
;
175+
%cmp.1 = fcmp ogt <4 x bfloat> %a, %b
176+
%s.1 = select <4 x i1> %cmp.1, <4 x bfloat> %a, <4 x bfloat> %c
177+
ret <4 x bfloat> %s.1
178+
}
179+
180+
define <8 x bfloat> @v8bf16_select_ogt(<8 x bfloat> %a, <8 x bfloat> %b, <8 x bfloat> %c) {
181+
; COST-LABEL: 'v8bf16_select_ogt'
182+
; COST-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %cmp.1 = fcmp ogt <8 x bfloat> %a, %b
183+
; COST-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <8 x i1> %cmp.1, <8 x bfloat> %a, <8 x bfloat> %c
184+
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <8 x bfloat> %s.1
185+
;
186+
%cmp.1 = fcmp ogt <8 x bfloat> %a, %b
187+
%s.1 = select <8 x i1> %cmp.1, <8 x bfloat> %a, <8 x bfloat> %c
188+
ret <8 x bfloat> %s.1
189+
}
190+
169191
define <4 x half> @v4f16_select_oge(<4 x half> %a, <4 x half> %b, <4 x half> %c) {
170192
; COST-NOFP16-LABEL: 'v4f16_select_oge'
171193
; COST-NOFP16-NEXT: Cost Model: Found costs of RThru:4 CodeSize:1 Lat:1 SizeLat:1 for: %cmp.1 = fcmp oge <4 x half> %a, %b
@@ -231,6 +253,28 @@ define <2 x double> @v2f64_select_oge(<2 x double> %a, <2 x double> %b, <2 x dou
231253
ret <2 x double> %s.1
232254
}
233255

256+
define <4 x bfloat> @v4bf16_select_oge(<4 x bfloat> %a, <4 x bfloat> %b, <4 x bfloat> %c) {
257+
; COST-LABEL: 'v4bf16_select_oge'
258+
; COST-NEXT: Cost Model: Found costs of 1 for: %cmp.1 = fcmp oge <4 x bfloat> %a, %b
259+
; COST-NEXT: Cost Model: Found costs of RThru:10 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <4 x i1> %cmp.1, <4 x bfloat> %a, <4 x bfloat> %c
260+
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x bfloat> %s.1
261+
;
262+
%cmp.1 = fcmp oge <4 x bfloat> %a, %b
263+
%s.1 = select <4 x i1> %cmp.1, <4 x bfloat> %a, <4 x bfloat> %c
264+
ret <4 x bfloat> %s.1
265+
}
266+
267+
define <8 x bfloat> @v8bf16_select_oge(<8 x bfloat> %a, <8 x bfloat> %b, <8 x bfloat> %c) {
268+
; COST-LABEL: 'v8bf16_select_oge'
269+
; COST-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %cmp.1 = fcmp oge <8 x bfloat> %a, %b
270+
; COST-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <8 x i1> %cmp.1, <8 x bfloat> %a, <8 x bfloat> %c
271+
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <8 x bfloat> %s.1
272+
;
273+
%cmp.1 = fcmp oge <8 x bfloat> %a, %b
274+
%s.1 = select <8 x i1> %cmp.1, <8 x bfloat> %a, <8 x bfloat> %c
275+
ret <8 x bfloat> %s.1
276+
}
277+
234278
define <4 x half> @v4f16_select_olt(<4 x half> %a, <4 x half> %b, <4 x half> %c) {
235279
; COST-NOFP16-LABEL: 'v4f16_select_olt'
236280
; COST-NOFP16-NEXT: Cost Model: Found costs of RThru:4 CodeSize:1 Lat:1 SizeLat:1 for: %cmp.1 = fcmp olt <4 x half> %a, %b
@@ -296,6 +340,28 @@ define <2 x double> @v2f64_select_olt(<2 x double> %a, <2 x double> %b, <2 x dou
296340
ret <2 x double> %s.1
297341
}
298342

343+
define <4 x bfloat> @v4bf16_select_olt(<4 x bfloat> %a, <4 x bfloat> %b, <4 x bfloat> %c) {
344+
; COST-LABEL: 'v4bf16_select_olt'
345+
; COST-NEXT: Cost Model: Found costs of 1 for: %cmp.1 = fcmp olt <4 x bfloat> %a, %b
346+
; COST-NEXT: Cost Model: Found costs of RThru:10 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <4 x i1> %cmp.1, <4 x bfloat> %a, <4 x bfloat> %c
347+
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x bfloat> %s.1
348+
;
349+
%cmp.1 = fcmp olt <4 x bfloat> %a, %b
350+
%s.1 = select <4 x i1> %cmp.1, <4 x bfloat> %a, <4 x bfloat> %c
351+
ret <4 x bfloat> %s.1
352+
}
353+
354+
define <8 x bfloat> @v8bf16_select_olt(<8 x bfloat> %a, <8 x bfloat> %b, <8 x bfloat> %c) {
355+
; COST-LABEL: 'v8bf16_select_olt'
356+
; COST-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %cmp.1 = fcmp olt <8 x bfloat> %a, %b
357+
; COST-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <8 x i1> %cmp.1, <8 x bfloat> %a, <8 x bfloat> %c
358+
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <8 x bfloat> %s.1
359+
;
360+
%cmp.1 = fcmp olt <8 x bfloat> %a, %b
361+
%s.1 = select <8 x i1> %cmp.1, <8 x bfloat> %a, <8 x bfloat> %c
362+
ret <8 x bfloat> %s.1
363+
}
364+
299365
define <4 x half> @v4f16_select_ole(<4 x half> %a, <4 x half> %b, <4 x half> %c) {
300366
; COST-NOFP16-LABEL: 'v4f16_select_ole'
301367
; COST-NOFP16-NEXT: Cost Model: Found costs of RThru:4 CodeSize:1 Lat:1 SizeLat:1 for: %cmp.1 = fcmp ole <4 x half> %a, %b
@@ -361,6 +427,28 @@ define <2 x double> @v2f64_select_ole(<2 x double> %a, <2 x double> %b, <2 x dou
361427
ret <2 x double> %s.1
362428
}
363429

430+
define <4 x bfloat> @v4bf16_select_ole(<4 x bfloat> %a, <4 x bfloat> %b, <4 x bfloat> %c) {
431+
; COST-LABEL: 'v4bf16_select_ole'
432+
; COST-NEXT: Cost Model: Found costs of 1 for: %cmp.1 = fcmp ole <4 x bfloat> %a, %b
433+
; COST-NEXT: Cost Model: Found costs of RThru:10 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <4 x i1> %cmp.1, <4 x bfloat> %a, <4 x bfloat> %c
434+
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x bfloat> %s.1
435+
;
436+
%cmp.1 = fcmp ole <4 x bfloat> %a, %b
437+
%s.1 = select <4 x i1> %cmp.1, <4 x bfloat> %a, <4 x bfloat> %c
438+
ret <4 x bfloat> %s.1
439+
}
440+
441+
define <8 x bfloat> @v8bf16_select_ole(<8 x bfloat> %a, <8 x bfloat> %b, <8 x bfloat> %c) {
442+
; COST-LABEL: 'v8bf16_select_ole'
443+
; COST-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %cmp.1 = fcmp ole <8 x bfloat> %a, %b
444+
; COST-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <8 x i1> %cmp.1, <8 x bfloat> %a, <8 x bfloat> %c
445+
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <8 x bfloat> %s.1
446+
;
447+
%cmp.1 = fcmp ole <8 x bfloat> %a, %b
448+
%s.1 = select <8 x i1> %cmp.1, <8 x bfloat> %a, <8 x bfloat> %c
449+
ret <8 x bfloat> %s.1
450+
}
451+
364452
define <4 x half> @v4f16_select_oeq(<4 x half> %a, <4 x half> %b, <4 x half> %c) {
365453
; COST-NOFP16-LABEL: 'v4f16_select_oeq'
366454
; COST-NOFP16-NEXT: Cost Model: Found costs of RThru:4 CodeSize:1 Lat:1 SizeLat:1 for: %cmp.1 = fcmp oeq <4 x half> %a, %b
@@ -426,6 +514,28 @@ define <2 x double> @v2f64_select_oeq(<2 x double> %a, <2 x double> %b, <2 x dou
426514
ret <2 x double> %s.1
427515
}
428516

517+
define <4 x bfloat> @v4bf16_select_oeq(<4 x bfloat> %a, <4 x bfloat> %b, <4 x bfloat> %c) {
518+
; COST-LABEL: 'v4bf16_select_oeq'
519+
; COST-NEXT: Cost Model: Found costs of 1 for: %cmp.1 = fcmp oeq <4 x bfloat> %a, %b
520+
; COST-NEXT: Cost Model: Found costs of RThru:10 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <4 x i1> %cmp.1, <4 x bfloat> %a, <4 x bfloat> %c
521+
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x bfloat> %s.1
522+
;
523+
%cmp.1 = fcmp oeq <4 x bfloat> %a, %b
524+
%s.1 = select <4 x i1> %cmp.1, <4 x bfloat> %a, <4 x bfloat> %c
525+
ret <4 x bfloat> %s.1
526+
}
527+
528+
define <8 x bfloat> @v8bf16_select_oeq(<8 x bfloat> %a, <8 x bfloat> %b, <8 x bfloat> %c) {
529+
; COST-LABEL: 'v8bf16_select_oeq'
530+
; COST-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %cmp.1 = fcmp oeq <8 x bfloat> %a, %b
531+
; COST-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <8 x i1> %cmp.1, <8 x bfloat> %a, <8 x bfloat> %c
532+
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <8 x bfloat> %s.1
533+
;
534+
%cmp.1 = fcmp oeq <8 x bfloat> %a, %b
535+
%s.1 = select <8 x i1> %cmp.1, <8 x bfloat> %a, <8 x bfloat> %c
536+
ret <8 x bfloat> %s.1
537+
}
538+
429539
define <4 x half> @v4f16_select_one(<4 x half> %a, <4 x half> %b, <4 x half> %c) {
430540
; COST-NOFP16-LABEL: 'v4f16_select_one'
431541
; COST-NOFP16-NEXT: Cost Model: Found costs of RThru:4 CodeSize:1 Lat:1 SizeLat:1 for: %cmp.1 = fcmp one <4 x half> %a, %b
@@ -464,8 +574,6 @@ define <2 x float> @v2f32_select_one(<2 x float> %a, <2 x float> %b, <2 x float>
464574
; COST-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <2 x i1> %cmp.1, <2 x float> %a, <2 x float> %c
465575
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <2 x float> %s.1
466576
;
467-
468-
469577
%cmp.1 = fcmp one <2 x float> %a, %b
470578
%s.1 = select <2 x i1> %cmp.1, <2 x float> %a, <2 x float> %c
471579
ret <2 x float> %s.1
@@ -477,8 +585,6 @@ define <4 x float> @v4f32_select_one(<4 x float> %a, <4 x float> %b, <4 x float>
477585
; COST-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <4 x i1> %cmp.1, <4 x float> %a, <4 x float> %c
478586
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x float> %s.1
479587
;
480-
481-
482588
%cmp.1 = fcmp one <4 x float> %a, %b
483589
%s.1 = select <4 x i1> %cmp.1, <4 x float> %a, <4 x float> %c
484590
ret <4 x float> %s.1
@@ -495,6 +601,28 @@ define <2 x double> @v2f64_select_one(<2 x double> %a, <2 x double> %b, <2 x dou
495601
ret <2 x double> %s.1
496602
}
497603

604+
define <4 x bfloat> @v4bf16_select_one(<4 x bfloat> %a, <4 x bfloat> %b, <4 x bfloat> %c) {
605+
; COST-LABEL: 'v4bf16_select_one'
606+
; COST-NEXT: Cost Model: Found costs of 1 for: %cmp.1 = fcmp one <4 x bfloat> %a, %b
607+
; COST-NEXT: Cost Model: Found costs of RThru:10 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <4 x i1> %cmp.1, <4 x bfloat> %a, <4 x bfloat> %c
608+
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x bfloat> %s.1
609+
;
610+
%cmp.1 = fcmp one <4 x bfloat> %a, %b
611+
%s.1 = select <4 x i1> %cmp.1, <4 x bfloat> %a, <4 x bfloat> %c
612+
ret <4 x bfloat> %s.1
613+
}
614+
615+
define <8 x bfloat> @v8bf16_select_one(<8 x bfloat> %a, <8 x bfloat> %b, <8 x bfloat> %c) {
616+
; COST-LABEL: 'v8bf16_select_one'
617+
; COST-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %cmp.1 = fcmp one <8 x bfloat> %a, %b
618+
; COST-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <8 x i1> %cmp.1, <8 x bfloat> %a, <8 x bfloat> %c
619+
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <8 x bfloat> %s.1
620+
;
621+
%cmp.1 = fcmp one <8 x bfloat> %a, %b
622+
%s.1 = select <8 x i1> %cmp.1, <8 x bfloat> %a, <8 x bfloat> %c
623+
ret <8 x bfloat> %s.1
624+
}
625+
498626
define <4 x half> @v4f16_select_une(<4 x half> %a, <4 x half> %b, <4 x half> %c) {
499627
; COST-NOFP16-LABEL: 'v4f16_select_une'
500628
; COST-NOFP16-NEXT: Cost Model: Found costs of RThru:4 CodeSize:1 Lat:1 SizeLat:1 for: %cmp.1 = fcmp une <4 x half> %a, %b
@@ -560,6 +688,60 @@ define <2 x double> @v2f64_select_une(<2 x double> %a, <2 x double> %b, <2 x dou
560688
ret <2 x double> %s.1
561689
}
562690

691+
define <4 x bfloat> @v4bf16_select_une(<4 x bfloat> %a, <4 x bfloat> %b, <4 x bfloat> %c) {
692+
; COST-LABEL: 'v4bf16_select_une'
693+
; COST-NEXT: Cost Model: Found costs of 1 for: %cmp.1 = fcmp une <4 x bfloat> %a, %b
694+
; COST-NEXT: Cost Model: Found costs of RThru:10 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <4 x i1> %cmp.1, <4 x bfloat> %a, <4 x bfloat> %c
695+
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x bfloat> %s.1
696+
;
697+
%cmp.1 = fcmp une <4 x bfloat> %a, %b
698+
%s.1 = select <4 x i1> %cmp.1, <4 x bfloat> %a, <4 x bfloat> %c
699+
ret <4 x bfloat> %s.1
700+
}
701+
702+
define <8 x bfloat> @v8bf16_select_une(<8 x bfloat> %a, <8 x bfloat> %b, <8 x bfloat> %c) {
703+
; COST-LABEL: 'v8bf16_select_une'
704+
; COST-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %cmp.1 = fcmp une <8 x bfloat> %a, %b
705+
; COST-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <8 x i1> %cmp.1, <8 x bfloat> %a, <8 x bfloat> %c
706+
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <8 x bfloat> %s.1
707+
;
708+
%cmp.1 = fcmp une <8 x bfloat> %a, %b
709+
%s.1 = select <8 x i1> %cmp.1, <8 x bfloat> %a, <8 x bfloat> %c
710+
ret <8 x bfloat> %s.1
711+
}
712+
713+
define <4 x half> @v4f16_select_ord(<4 x half> %a, <4 x half> %b, <4 x half> %c) {
714+
; COST-NOFP16-LABEL: 'v4f16_select_ord'
715+
; COST-NOFP16-NEXT: Cost Model: Found costs of RThru:4 CodeSize:1 Lat:1 SizeLat:1 for: %cmp.1 = fcmp ord <4 x half> %a, %b
716+
; COST-NOFP16-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <4 x i1> %cmp.1, <4 x half> %a, <4 x half> %c
717+
; COST-NOFP16-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x half> %s.1
718+
;
719+
; COST-FULLFP16-LABEL: 'v4f16_select_ord'
720+
; COST-FULLFP16-NEXT: Cost Model: Found costs of 1 for: %cmp.1 = fcmp ord <4 x half> %a, %b
721+
; COST-FULLFP16-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <4 x i1> %cmp.1, <4 x half> %a, <4 x half> %c
722+
; COST-FULLFP16-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x half> %s.1
723+
;
724+
%cmp.1 = fcmp ord <4 x half> %a, %b
725+
%s.1 = select <4 x i1> %cmp.1, <4 x half> %a, <4 x half> %c
726+
ret <4 x half> %s.1
727+
}
728+
729+
define <8 x half> @v8f16_select_ord(<8 x half> %a, <8 x half> %b, <8 x half> %c) {
730+
; COST-NOFP16-LABEL: 'v8f16_select_ord'
731+
; COST-NOFP16-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %cmp.1 = fcmp ord <8 x half> %a, %b
732+
; COST-NOFP16-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <8 x i1> %cmp.1, <8 x half> %a, <8 x half> %c
733+
; COST-NOFP16-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <8 x half> %s.1
734+
;
735+
; COST-FULLFP16-LABEL: 'v8f16_select_ord'
736+
; COST-FULLFP16-NEXT: Cost Model: Found costs of 1 for: %cmp.1 = fcmp ord <8 x half> %a, %b
737+
; COST-FULLFP16-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <8 x i1> %cmp.1, <8 x half> %a, <8 x half> %c
738+
; COST-FULLFP16-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <8 x half> %s.1
739+
;
740+
%cmp.1 = fcmp ord <8 x half> %a, %b
741+
%s.1 = select <8 x i1> %cmp.1, <8 x half> %a, <8 x half> %c
742+
ret <8 x half> %s.1
743+
}
744+
563745
define <2 x float> @v2f32_select_ord(<2 x float> %a, <2 x float> %b, <2 x float> %c) {
564746
; COST-LABEL: 'v2f32_select_ord'
565747
; COST-NEXT: Cost Model: Found costs of 1 for: %cmp.1 = fcmp ord <2 x float> %a, %b
@@ -577,8 +759,6 @@ define <4 x float> @v4f32_select_ord(<4 x float> %a, <4 x float> %b, <4 x float>
577759
; COST-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <4 x i1> %cmp.1, <4 x float> %a, <4 x float> %c
578760
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x float> %s.1
579761
;
580-
581-
582762
%cmp.1 = fcmp ord <4 x float> %a, %b
583763
%s.1 = select <4 x i1> %cmp.1, <4 x float> %a, <4 x float> %c
584764
ret <4 x float> %s.1
@@ -594,3 +774,25 @@ define <2 x double> @v2f64_select_ord(<2 x double> %a, <2 x double> %b, <2 x dou
594774
%s.1 = select <2 x i1> %cmp.1, <2 x double> %a, <2 x double> %c
595775
ret <2 x double> %s.1
596776
}
777+
778+
define <4 x bfloat> @v4bf16_select_ord(<4 x bfloat> %a, <4 x bfloat> %b, <4 x bfloat> %c) {
779+
; COST-LABEL: 'v4bf16_select_ord'
780+
; COST-NEXT: Cost Model: Found costs of 1 for: %cmp.1 = fcmp ord <4 x bfloat> %a, %b
781+
; COST-NEXT: Cost Model: Found costs of RThru:10 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <4 x i1> %cmp.1, <4 x bfloat> %a, <4 x bfloat> %c
782+
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x bfloat> %s.1
783+
;
784+
%cmp.1 = fcmp ord <4 x bfloat> %a, %b
785+
%s.1 = select <4 x i1> %cmp.1, <4 x bfloat> %a, <4 x bfloat> %c
786+
ret <4 x bfloat> %s.1
787+
}
788+
789+
define <8 x bfloat> @v8bf16_select_ord(<8 x bfloat> %a, <8 x bfloat> %b, <8 x bfloat> %c) {
790+
; COST-LABEL: 'v8bf16_select_ord'
791+
; COST-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %cmp.1 = fcmp ord <8 x bfloat> %a, %b
792+
; COST-NEXT: Cost Model: Found costs of RThru:22 CodeSize:1 Lat:1 SizeLat:1 for: %s.1 = select <8 x i1> %cmp.1, <8 x bfloat> %a, <8 x bfloat> %c
793+
; COST-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <8 x bfloat> %s.1
794+
;
795+
%cmp.1 = fcmp ord <8 x bfloat> %a, %b
796+
%s.1 = select <8 x i1> %cmp.1, <8 x bfloat> %a, <8 x bfloat> %c
797+
ret <8 x bfloat> %s.1
798+
}

0 commit comments

Comments
 (0)