@@ -83,7 +83,7 @@ define float @clamp_float_fast_unordered_strict_maxmin(float %x) {
83
83
; (X <= C1) ? C1 : MIN(X, C2)
84
84
define float @clamp_float_fast_unordered_nonstrict_maxmin (float %x ) {
85
85
; CHECK-LABEL: @clamp_float_fast_unordered_nonstrict_maxmin(
86
- ; CHECK-NEXT: [[MIN:%.*]] = call fast float @llvm.minnum.f32(float [[X:%.*]], float 2.550000e+02)
86
+ ; CHECK-NEXT: [[MIN:%.*]] = call fast float @llvm.minnum.f32(float [[X:%.*]], float 2.550000e+02)
87
87
; CHECK-NEXT: [[CMP1:%.*]] = fcmp fast ule float [[X]], 1.000000e+00
88
88
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 1.000000e+00, float [[MIN]]
89
89
; CHECK-NEXT: ret float [[R]]
@@ -98,7 +98,7 @@ define float @clamp_float_fast_unordered_nonstrict_maxmin(float %x) {
98
98
; (X > C1) ? C1 : MAX(X, C2)
99
99
define float @clamp_float_fast_unordered_strict_minmax (float %x ) {
100
100
; CHECK-LABEL: @clamp_float_fast_unordered_strict_minmax(
101
- ; CHECK-NEXT: [[MAX:%.*]] = call fast float @llvm.maxnum.f32(float [[X:%.*]], float 1.000000e+00)
101
+ ; CHECK-NEXT: [[MAX:%.*]] = call fast float @llvm.maxnum.f32(float [[X:%.*]], float 1.000000e+00)
102
102
; CHECK-NEXT: [[CMP1:%.*]] = fcmp fast ugt float [[X]], 2.550000e+02
103
103
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 2.550000e+02, float [[MAX]]
104
104
; CHECK-NEXT: ret float [[R]]
@@ -113,7 +113,7 @@ define float @clamp_float_fast_unordered_strict_minmax(float %x) {
113
113
; (X >= C1) ? C1 : MAX(X, C2)
114
114
define float @clamp_float_fast_unordered_nonstrict_minmax (float %x ) {
115
115
; CHECK-LABEL: @clamp_float_fast_unordered_nonstrict_minmax(
116
- ; CHECK-NEXT: [[MAX:%.*]] = call fast float @llvm.maxnum.f32(float [[X:%.*]], float 1.000000e+00)
116
+ ; CHECK-NEXT: [[MAX:%.*]] = call fast float @llvm.maxnum.f32(float [[X:%.*]], float 1.000000e+00)
117
117
; CHECK-NEXT: [[CMP1:%.*]] = fcmp fast uge float [[X]], 2.550000e+02
118
118
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 2.550000e+02, float [[MAX]]
119
119
; CHECK-NEXT: ret float [[R]]
@@ -147,7 +147,7 @@ define float @clamp_test_1(float %x) {
147
147
; Like @clamp_test_1 but HighConst < LowConst
148
148
define float @clamp_negative_wrong_const (float %x ) {
149
149
; CHECK-LABEL: @clamp_negative_wrong_const(
150
- ; CHECK-NEXT: [[INNER_SEL:%.*]] = call fast float @llvm.minnum.f32(float [[X:%.*]], float 2.550000e+02)
150
+ ; CHECK-NEXT: [[INNER_SEL:%.*]] = call fast float @llvm.minnum.f32(float [[X:%.*]], float 2.550000e+02)
151
151
; CHECK-NEXT: [[OUTER_CMP:%.*]] = fcmp fast ugt float [[X]], 5.120000e+02
152
152
; CHECK-NEXT: [[R:%.*]] = select i1 [[OUTER_CMP]], float [[INNER_SEL]], float 5.120000e+02
153
153
; CHECK-NEXT: ret float [[R]]
@@ -162,7 +162,7 @@ define float @clamp_negative_wrong_const(float %x) {
162
162
; Like @clamp_test_1 but both are min
163
163
define float @clamp_negative_same_op (float %x ) {
164
164
; CHECK-LABEL: @clamp_negative_same_op(
165
- ; CHECK-NEXT: [[INNER_SEL:%.*]] = call fast float @llvm.minnum.f32(float [[X:%.*]], float 2.550000e+02)
165
+ ; CHECK-NEXT: [[INNER_SEL:%.*]] = call fast float @llvm.minnum.f32(float [[X:%.*]], float 2.550000e+02)
166
166
; CHECK-NEXT: [[OUTER_CMP:%.*]] = fcmp fast ult float [[X]], 1.000000e+00
167
167
; CHECK-NEXT: [[R:%.*]] = select i1 [[OUTER_CMP]], float [[INNER_SEL]], float 1.000000e+00
168
168
; CHECK-NEXT: ret float [[R]]
@@ -500,9 +500,9 @@ define float @ui64_clamp_and_cast_to_float(i64 %x) {
500
500
501
501
define float @mixed_clamp_to_float_1 (i32 %x ) {
502
502
; CHECK-LABEL: @mixed_clamp_to_float_1(
503
- ; CHECK-NEXT: [[SI_MIN :%.*]] = call i32 @llvm.smin .i32(i32 [[X :%.*]], i32 255 )
504
- ; CHECK-NEXT: [[R1 :%.*]] = call i32 @llvm.smax .i32(i32 [[SI_MIN ]], i32 1 )
505
- ; CHECK-NEXT: [[R:%.*]] = uitofp nneg i32 [[R1 ]] to float
503
+ ; CHECK-NEXT: [[R1 :%.*]] = call i32 @llvm.smax .i32(i32 [[SI_MIN :%.*]], i32 1 )
504
+ ; CHECK-NEXT: [[R2 :%.*]] = call i32 @llvm.smin .i32(i32 [[R1 ]], i32 255 )
505
+ ; CHECK-NEXT: [[R:%.*]] = uitofp nneg i32 [[R2 ]] to float
506
506
; CHECK-NEXT: ret float [[R]]
507
507
;
508
508
%si_min_cmp = icmp sgt i32 %x , 255
@@ -535,9 +535,9 @@ define i32 @mixed_clamp_to_i32_1(float %x) {
535
535
536
536
define float @mixed_clamp_to_float_2 (i32 %x ) {
537
537
; CHECK-LABEL: @mixed_clamp_to_float_2(
538
- ; CHECK-NEXT: [[SI_MIN :%.*]] = call i32 @llvm.smin .i32(i32 [[X :%.*]], i32 255 )
539
- ; CHECK-NEXT: [[R1 :%.*]] = call i32 @llvm.smax .i32(i32 [[SI_MIN ]], i32 1 )
540
- ; CHECK-NEXT: [[R:%.*]] = uitofp nneg i32 [[R1 ]] to float
538
+ ; CHECK-NEXT: [[R1 :%.*]] = call i32 @llvm.smax .i32(i32 [[SI_MIN :%.*]], i32 1 )
539
+ ; CHECK-NEXT: [[R2 :%.*]] = call i32 @llvm.smin .i32(i32 [[R1 ]], i32 255 )
540
+ ; CHECK-NEXT: [[R:%.*]] = uitofp nneg i32 [[R2 ]] to float
541
541
; CHECK-NEXT: ret float [[R]]
542
542
;
543
543
%si_min_cmp = icmp sgt i32 %x , 255
@@ -568,9 +568,9 @@ define i32 @mixed_clamp_to_i32_2(float %x) {
568
568
569
569
define <2 x float > @mixed_clamp_to_float_vec (<2 x i32 > %x ) {
570
570
; CHECK-LABEL: @mixed_clamp_to_float_vec(
571
- ; CHECK-NEXT: [[SI_MIN :%.*]] = call <2 x i32> @llvm.smin .v2i32(<2 x i32> [[X :%.*]], <2 x i32> splat (i32 255 ))
572
- ; CHECK-NEXT: [[R1 :%.*]] = call <2 x i32> @llvm.smax .v2i32(<2 x i32> [[SI_MIN ]], <2 x i32> splat (i32 1 ))
573
- ; CHECK-NEXT: [[R:%.*]] = uitofp nneg <2 x i32> [[R1 ]] to <2 x float>
571
+ ; CHECK-NEXT: [[R1 :%.*]] = call <2 x i32> @llvm.smax .v2i32(<2 x i32> [[SI_MIN :%.*]], <2 x i32> splat (i32 1 ))
572
+ ; CHECK-NEXT: [[R2 :%.*]] = call <2 x i32> @llvm.smin .v2i32(<2 x i32> [[R1 ]], <2 x i32> splat (i32 255 ))
573
+ ; CHECK-NEXT: [[R:%.*]] = uitofp nneg <2 x i32> [[R2 ]] to <2 x float>
574
574
; CHECK-NEXT: ret <2 x float> [[R]]
575
575
;
576
576
%si_min_cmp = icmp sgt <2 x i32 > %x , <i32 255 , i32 255 >
0 commit comments