Skip to content

Commit 5a02a34

Browse files
committed
Add even more subnormal testing
1 parent b778353 commit 5a02a34

File tree

1 file changed

+154
-2
lines changed

1 file changed

+154
-2
lines changed

llvm/test/Transforms/InstSimplify/const-fold-nvvm-fmin-fmax.ll

Lines changed: 154 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,82 @@ define float @test_fmax_1_25_neg_2_xorsign_abs_f() {
7979
ret float %res
8080
}
8181

82+
;###############################################################
83+
;# FMax(+Subnormal, -Subnormal) #
84+
;###############################################################
85+
86+
define double @test_fmax_pos_subnorm_neg_subnorm_d() {
87+
; CHECK-LABEL: define double @test_fmax_pos_subnorm_neg_subnorm_d() {
88+
; CHECK-NEXT: ret double 0x380FFFFFC0000000
89+
;
90+
%res = call double @llvm.nvvm.fmax.d(double 0x380FFFFFC0000000, double 0xB80FFFFFC0000000)
91+
ret double %res
92+
}
93+
94+
define float @test_fmax_pos_subnorm_neg_subnorm_f() {
95+
; CHECK-LABEL: define float @test_fmax_pos_subnorm_neg_subnorm_f() {
96+
; CHECK-NEXT: ret float 0x380FFFFFC0000000
97+
;
98+
%res = call float @llvm.nvvm.fmax.f(float 0x380FFFFFC0000000, float 0xB80FFFFFC0000000)
99+
ret float %res
100+
}
101+
102+
define float @test_fmax_pos_subnorm_neg_subnorm_ftz_f() {
103+
; CHECK-LABEL: define float @test_fmax_pos_subnorm_neg_subnorm_ftz_f() {
104+
; CHECK-NEXT: ret float 0.000000e+00
105+
;
106+
%res = call float @llvm.nvvm.fmax.ftz.f(float 0x380FFFFFC0000000, float 0xB80FFFFFC0000000)
107+
ret float %res
108+
}
109+
110+
define float @test_fmax_pos_subnorm_neg_subnorm_ftz_nan_f() {
111+
; CHECK-LABEL: define float @test_fmax_pos_subnorm_neg_subnorm_ftz_nan_f() {
112+
; CHECK-NEXT: ret float 0.000000e+00
113+
;
114+
%res = call float @llvm.nvvm.fmax.ftz.nan.f(float 0x380FFFFFC0000000, float 0xB80FFFFFC0000000)
115+
ret float %res
116+
}
117+
118+
define float @test_fmax_pos_subnorm_neg_subnorm_ftz_nan_xorsign_abs_f() {
119+
; CHECK-LABEL: define float @test_fmax_pos_subnorm_neg_subnorm_ftz_nan_xorsign_abs_f() {
120+
; CHECK-NEXT: ret float -0.000000e+00
121+
;
122+
%res = call float @llvm.nvvm.fmax.ftz.nan.xorsign.abs.f(float 0x380FFFFFC0000000, float 0xB80FFFFFC0000000)
123+
ret float %res
124+
}
125+
126+
define float @test_fmax_pos_subnorm_neg_subnorm_ftz_xorsign_abs_f() {
127+
; CHECK-LABEL: define float @test_fmax_pos_subnorm_neg_subnorm_ftz_xorsign_abs_f() {
128+
; CHECK-NEXT: ret float -0.000000e+00
129+
;
130+
%res = call float @llvm.nvvm.fmax.ftz.xorsign.abs.f(float 0x380FFFFFC0000000, float 0xB80FFFFFC0000000)
131+
ret float %res
132+
}
133+
134+
define float @test_fmax_pos_subnorm_neg_subnorm_nan_f() {
135+
; CHECK-LABEL: define float @test_fmax_pos_subnorm_neg_subnorm_nan_f() {
136+
; CHECK-NEXT: ret float 0x380FFFFFC0000000
137+
;
138+
%res = call float @llvm.nvvm.fmax.nan.f(float 0x380FFFFFC0000000, float 0xB80FFFFFC0000000)
139+
ret float %res
140+
}
141+
142+
define float @test_fmax_pos_subnorm_neg_subnorm_nan_xorsign_abs_f() {
143+
; CHECK-LABEL: define float @test_fmax_pos_subnorm_neg_subnorm_nan_xorsign_abs_f() {
144+
; CHECK-NEXT: ret float 0xB80FFFFFC0000000
145+
;
146+
%res = call float @llvm.nvvm.fmax.nan.xorsign.abs.f(float 0x380FFFFFC0000000, float 0xB80FFFFFC0000000)
147+
ret float %res
148+
}
149+
150+
define float @test_fmax_pos_subnorm_neg_subnorm_xorsign_abs_f() {
151+
; CHECK-LABEL: define float @test_fmax_pos_subnorm_neg_subnorm_xorsign_abs_f() {
152+
; CHECK-NEXT: ret float 0xB80FFFFFC0000000
153+
;
154+
%res = call float @llvm.nvvm.fmax.xorsign.abs.f(float 0x380FFFFFC0000000, float 0xB80FFFFFC0000000)
155+
ret float %res
156+
}
157+
82158
;###############################################################
83159
;# FMax(+Subnormal, NaN) #
84160
;###############################################################
@@ -156,7 +232,7 @@ define float @test_fmax_pos_subnorm_nan_xorsign_abs_f() {
156232
}
157233

158234
;###############################################################
159-
;# FMax(subnorm, undef) #
235+
;# FMax(+Subnormal, undef) #
160236
;###############################################################
161237

162238
define double @test_fmax_subnorm_undef_d() {
@@ -384,6 +460,82 @@ define float @test_fmin_1_25_neg_2_xorsign_abs_f() {
384460
ret float %res
385461
}
386462

463+
;###############################################################
464+
;# FMin(+Subnormal, -Subnormal) #
465+
;###############################################################
466+
467+
define double @test_fmin_pos_subnorm_neg_subnorm_d() {
468+
; CHECK-LABEL: define double @test_fmin_pos_subnorm_neg_subnorm_d() {
469+
; CHECK-NEXT: ret double 0xB80FFFFFC0000000
470+
;
471+
%res = call double @llvm.nvvm.fmin.d(double 0x380FFFFFC0000000, double 0xB80FFFFFC0000000)
472+
ret double %res
473+
}
474+
475+
define float @test_fmin_pos_subnorm_neg_subnorm_f() {
476+
; CHECK-LABEL: define float @test_fmin_pos_subnorm_neg_subnorm_f() {
477+
; CHECK-NEXT: ret float 0xB80FFFFFC0000000
478+
;
479+
%res = call float @llvm.nvvm.fmin.f(float 0x380FFFFFC0000000, float 0xB80FFFFFC0000000)
480+
ret float %res
481+
}
482+
483+
define float @test_fmin_pos_subnorm_neg_subnorm_ftz_f() {
484+
; CHECK-LABEL: define float @test_fmin_pos_subnorm_neg_subnorm_ftz_f() {
485+
; CHECK-NEXT: ret float -0.000000e+00
486+
;
487+
%res = call float @llvm.nvvm.fmin.ftz.f(float 0x380FFFFFC0000000, float 0xB80FFFFFC0000000)
488+
ret float %res
489+
}
490+
491+
define float @test_fmin_pos_subnorm_neg_subnorm_ftz_nan_f() {
492+
; CHECK-LABEL: define float @test_fmin_pos_subnorm_neg_subnorm_ftz_nan_f() {
493+
; CHECK-NEXT: ret float -0.000000e+00
494+
;
495+
%res = call float @llvm.nvvm.fmin.ftz.nan.f(float 0x380FFFFFC0000000, float 0xB80FFFFFC0000000)
496+
ret float %res
497+
}
498+
499+
define float @test_fmin_pos_subnorm_neg_subnorm_ftz_nan_xorsign_abs_f() {
500+
; CHECK-LABEL: define float @test_fmin_pos_subnorm_neg_subnorm_ftz_nan_xorsign_abs_f() {
501+
; CHECK-NEXT: ret float -0.000000e+00
502+
;
503+
%res = call float @llvm.nvvm.fmin.ftz.nan.xorsign.abs.f(float 0x380FFFFFC0000000, float 0xB80FFFFFC0000000)
504+
ret float %res
505+
}
506+
507+
define float @test_fmin_pos_subnorm_neg_subnorm_ftz_xorsign_abs_f() {
508+
; CHECK-LABEL: define float @test_fmin_pos_subnorm_neg_subnorm_ftz_xorsign_abs_f() {
509+
; CHECK-NEXT: ret float -0.000000e+00
510+
;
511+
%res = call float @llvm.nvvm.fmin.ftz.xorsign.abs.f(float 0x380FFFFFC0000000, float 0xB80FFFFFC0000000)
512+
ret float %res
513+
}
514+
515+
define float @test_fmin_pos_subnorm_neg_subnorm_nan_f() {
516+
; CHECK-LABEL: define float @test_fmin_pos_subnorm_neg_subnorm_nan_f() {
517+
; CHECK-NEXT: ret float 0xB80FFFFFC0000000
518+
;
519+
%res = call float @llvm.nvvm.fmin.nan.f(float 0x380FFFFFC0000000, float 0xB80FFFFFC0000000)
520+
ret float %res
521+
}
522+
523+
define float @test_fmin_pos_subnorm_neg_subnorm_nan_xorsign_abs_f() {
524+
; CHECK-LABEL: define float @test_fmin_pos_subnorm_neg_subnorm_nan_xorsign_abs_f() {
525+
; CHECK-NEXT: ret float 0xB80FFFFFC0000000
526+
;
527+
%res = call float @llvm.nvvm.fmin.nan.xorsign.abs.f(float 0x380FFFFFC0000000, float 0xB80FFFFFC0000000)
528+
ret float %res
529+
}
530+
531+
define float @test_fmin_pos_subnorm_neg_subnorm_xorsign_abs_f() {
532+
; CHECK-LABEL: define float @test_fmin_pos_subnorm_neg_subnorm_xorsign_abs_f() {
533+
; CHECK-NEXT: ret float 0xB80FFFFFC0000000
534+
;
535+
%res = call float @llvm.nvvm.fmin.xorsign.abs.f(float 0x380FFFFFC0000000, float 0xB80FFFFFC0000000)
536+
ret float %res
537+
}
538+
387539
;###############################################################
388540
;# FMin(+Subnormal, NaN) #
389541
;###############################################################
@@ -461,7 +613,7 @@ define float @test_fmin_pos_subnorm_nan_xorsign_abs_f() {
461613
}
462614

463615
;###############################################################
464-
;# FMin(subnorm, undef) #
616+
;# FMin(+Subnormal, undef) #
465617
;###############################################################
466618

467619
define double @test_fmin_subnorm_undef_d() {

0 commit comments

Comments
 (0)