@@ -578,6 +578,40 @@ define float @fmed3_x_y_poison_f32_strictfp(float %x, float %y) #2 {
578
578
ret float %med3
579
579
}
580
580
581
+ ; --------------------------------------------------------------------
582
+ ; llvm.amdgcn.fmed3 with flags
583
+ ; --------------------------------------------------------------------
584
+
585
+ define float @fmed3_qnan0_x_y_f32_flags (float %x , float %y ) #1 {
586
+ ; IEEE1-LABEL: define float @fmed3_qnan0_x_y_f32_flags(
587
+ ; IEEE1-SAME: float [[X:%.*]], float [[Y:%.*]]) #[[ATTR1]] {
588
+ ; IEEE1-NEXT: [[MED3:%.*]] = call ninf nsz float @llvm.minnum.f32(float [[X]], float [[Y]])
589
+ ; IEEE1-NEXT: ret float [[MED3]]
590
+ ;
591
+ %med3 = call nsz ninf float @llvm.amdgcn.fmed3.f32 (float 0x7FF8000000000000 , float %x , float %y )
592
+ ret float %med3
593
+ }
594
+
595
+ define float @fmed3_x_qnan0_y_f32_flags (float %x , float %y ) #1 {
596
+ ; IEEE1-LABEL: define float @fmed3_x_qnan0_y_f32_flags(
597
+ ; IEEE1-SAME: float [[X:%.*]], float [[Y:%.*]]) #[[ATTR1]] {
598
+ ; IEEE1-NEXT: [[MED3:%.*]] = call ninf nsz float @llvm.minnum.f32(float [[X]], float [[Y]])
599
+ ; IEEE1-NEXT: ret float [[MED3]]
600
+ ;
601
+ %med3 = call nsz ninf float @llvm.amdgcn.fmed3.f32 (float %x , float 0x7FF8000000000000 , float %y )
602
+ ret float %med3
603
+ }
604
+
605
+ define float @fmed3_x_y_qnan0_f32_flags (float %x , float %y ) #1 {
606
+ ; IEEE1-LABEL: define float @fmed3_x_y_qnan0_f32_flags(
607
+ ; IEEE1-SAME: float [[X:%.*]], float [[Y:%.*]]) #[[ATTR1]] {
608
+ ; IEEE1-NEXT: [[MED3:%.*]] = call ninf nsz float @llvm.minnum.f32(float [[X]], float [[Y]])
609
+ ; IEEE1-NEXT: ret float [[MED3]]
610
+ ;
611
+ %med3 = call nsz ninf float @llvm.amdgcn.fmed3.f32 (float %x , float %y , float 0x7FF8000000000000 )
612
+ ret float %med3
613
+ }
614
+
581
615
attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
582
616
attributes #1 = { nounwind "amdgpu-ieee" ="true" }
583
617
attributes #2 = { nounwind strictfp "amdgpu-ieee" ="true" }
0 commit comments