@@ -830,6 +830,67 @@ define float @maxnum(float %a, float %b) {
830830 ret float %r
831831}
832832
833+ define float @maxnum_const_snan (float %x ) {
834+ ; CHECK-LABEL: @maxnum_const_snan(
835+ ; CHECK-NEXT: ret float 0x7FFC000000000000
836+ ;
837+ %r = call float @llvm.minnum.f32 (float %x , float 0x7FF4000000000000 )
838+ ret float %r
839+ }
840+
841+ define double @minnum_const_snan (double %x ) {
842+ ; CHECK-LABEL: @minnum_const_snan(
843+ ; CHECK-NEXT: ret double 0x7FFC000000000000
844+ ;
845+ %r = call double @llvm.minnum.f64 (double %x , double 0x7FF4000000000000 )
846+ ret double %r
847+ }
848+
849+ define float @maxnum_const_qnan (float %x ) {
850+ ; CHECK-LABEL: @maxnum_const_qnan(
851+ ; CHECK-NEXT: ret float [[X:%.*]]
852+ ;
853+ %r = call float @llvm.minnum.f32 (float %x , float 0x7FF8000000000000 )
854+ ret float %r
855+ }
856+
857+ define double @minnum_const_qnan (double %x ) {
858+ ; CHECK-LABEL: @minnum_const_qnan(
859+ ; CHECK-NEXT: ret double [[X:%.*]]
860+ ;
861+ %r = call double @llvm.minnum.f64 (double %x , double 0x7FF8000000000000 )
862+ ret double %r
863+ }
864+
865+ define <2 x float > @maxnum_const_snan_v2f32 (<2 x float > %a ) {
866+ ; CHECK-LABEL: @maxnum_const_snan_v2f32(
867+ ; CHECK-NEXT: entry:
868+ ; CHECK-NEXT: ret <2 x float> splat (float 0x7FFC000000000000)
869+ ;
870+ entry:
871+ %r = tail call <2 x float > @llvm.maxnum.v2f32 (<2 x float > %a , <2 x float > <float 0x7FF4000000000000 , float 0x7FF4000000000000 >)
872+ ret <2 x float > %r
873+ }
874+ define <2 x float > @maxnum_const_qnan_v2f32 (<2 x float > %a ) {
875+ ; CHECK-LABEL: @maxnum_const_qnan_v2f32(
876+ ; CHECK-NEXT: entry:
877+ ; CHECK-NEXT: ret <2 x float> [[A:%.*]]
878+ ;
879+ entry:
880+ %r = tail call <2 x float > @llvm.maxnum.v2f32 (<2 x float > %a , <2 x float > <float 0x7FF8000000000000 , float 0x7FF8000000000000 >)
881+ ret <2 x float > %r
882+ }
883+ define <2 x float > @maxnum_const_mixednan_v2f32 (<2 x float > %a ) {
884+ ; CHECK-LABEL: @maxnum_const_mixednan_v2f32(
885+ ; CHECK-NEXT: entry:
886+ ; CHECK-NEXT: [[R:%.*]] = tail call <2 x float> @llvm.maxnum.v2f32(<2 x float> [[A:%.*]], <2 x float> <float 0x7FF8000000000000, float 0x7FF4000000000000>)
887+ ; CHECK-NEXT: ret <2 x float> [[R]]
888+ ;
889+ entry:
890+ %r = tail call <2 x float > @llvm.maxnum.v2f32 (<2 x float > %a , <2 x float > <float 0x7FF8000000000000 , float 0x7FF4000000000000 >)
891+ ret <2 x float > %r
892+ }
893+
833894define <2 x float > @minnum (<2 x float > %a , <2 x float > %b ) {
834895; CHECK-LABEL: @minnum(
835896; CHECK-NEXT: [[X:%.*]] = call fast <2 x float> @llvm.minnum.v2f32(<2 x float> [[A:%.*]], <2 x float> [[B:%.*]])
0 commit comments