@@ -58,12 +58,6 @@ impl MaybeOverride<(f32,)> for SpecialCase {
58
58
ctx : & CheckCtx ,
59
59
) -> Option < TestResult > {
60
60
if ctx. basis == CheckBasis :: Musl {
61
- if ctx. fname == "acoshf" && input. 0 < -1.0 {
62
- // acoshf is undefined for x <= 1.0, but we return a random result at lower
63
- // values.
64
- return XFAIL ;
65
- }
66
-
67
61
if ctx. fname == "sincosf" {
68
62
let factor_frac_pi_2 = input. 0 . abs ( ) / f32:: consts:: FRAC_PI_2 ;
69
63
if ( factor_frac_pi_2 - factor_frac_pi_2. round ( ) ) . abs ( ) < 1e-2 {
@@ -82,11 +76,17 @@ impl MaybeOverride<(f32,)> for SpecialCase {
82
76
// doesn't seem to happen on x86
83
77
return XFAIL ;
84
78
}
79
+ }
85
80
86
- if ctx. fname == "lgammaf" || ctx. fname == "lgammaf_r" && input. 0 < 0.0 {
87
- // loggamma should not be defined for x < 0, yet we both return results
88
- return XFAIL ;
89
- }
81
+ if ctx. fname == "acoshf" && input. 0 < -1.0 {
82
+ // acoshf is undefined for x <= 1.0, but we return a random result at lower
83
+ // values.
84
+ return XFAIL ;
85
+ }
86
+
87
+ if ctx. fname == "lgammaf" || ctx. fname == "lgammaf_r" && input. 0 < 0.0 {
88
+ // loggamma should not be defined for x < 0, yet we both return results
89
+ return XFAIL ;
90
90
}
91
91
92
92
maybe_check_nan_bits ( actual, expected, ctx)
@@ -136,11 +136,17 @@ impl MaybeOverride<(f64,)> for SpecialCase {
136
136
// musl returns -0.0, we return +0.0
137
137
return XFAIL ;
138
138
}
139
+ }
139
140
140
- if ctx. fname == "lgamma" || ctx. fname == "lgamma_r" && input. 0 < 0.0 {
141
- // loggamma should not be defined for x < 0, yet we both return results
142
- return XFAIL ;
143
- }
141
+ if ctx. fname == "acosh" && input. 0 < 1.0 {
142
+ // The function is undefined for the inputs, musl and our libm both return
143
+ // random results.
144
+ return XFAIL ;
145
+ }
146
+
147
+ if ctx. fname == "lgamma" || ctx. fname == "lgamma_r" && input. 0 < 0.0 {
148
+ // loggamma should not be defined for x < 0, yet we both return results
149
+ return XFAIL ;
144
150
}
145
151
146
152
maybe_check_nan_bits ( actual, expected, ctx)
@@ -188,7 +194,7 @@ impl MaybeOverride<(f32, f32)> for SpecialCase {
188
194
_ulp : & mut u32 ,
189
195
ctx : & CheckCtx ,
190
196
) -> Option < TestResult > {
191
- maybe_skip_min_max_nan ( input, expected, ctx)
197
+ maybe_skip_binop_nan ( input, expected, ctx)
192
198
}
193
199
}
194
200
impl MaybeOverride < ( f64 , f64 ) > for SpecialCase {
@@ -199,24 +205,35 @@ impl MaybeOverride<(f64, f64)> for SpecialCase {
199
205
_ulp : & mut u32 ,
200
206
ctx : & CheckCtx ,
201
207
) -> Option < TestResult > {
202
- maybe_skip_min_max_nan ( input, expected, ctx)
208
+ maybe_skip_binop_nan ( input, expected, ctx)
203
209
}
204
210
}
205
211
206
212
/// Musl propagates NaNs if one is provided as the input, but we return the other input.
207
213
// F1 and F2 are always the same type, this is just to please generics
208
- fn maybe_skip_min_max_nan < F1 : Float , F2 : Float > (
214
+ fn maybe_skip_binop_nan < F1 : Float , F2 : Float > (
209
215
input : ( F1 , F1 ) ,
210
216
expected : F2 ,
211
217
ctx : & CheckCtx ,
212
218
) -> Option < TestResult > {
213
- if ( ctx. canonical_name == "fmax" || ctx. canonical_name == "fmin" )
214
- && ( input. 0 . is_nan ( ) || input. 1 . is_nan ( ) )
215
- && expected. is_nan ( )
216
- {
217
- return XFAIL ;
218
- } else {
219
- None
219
+ match ctx. basis {
220
+ CheckBasis :: Musl => {
221
+ if ( ctx. canonical_name == "fmax" || ctx. canonical_name == "fmin" )
222
+ && ( input. 0 . is_nan ( ) || input. 1 . is_nan ( ) )
223
+ && expected. is_nan ( )
224
+ {
225
+ XFAIL
226
+ } else {
227
+ None
228
+ }
229
+ }
230
+ CheckBasis :: MultiPrecision => {
231
+ if ctx. canonical_name == "copysign" && input. 1 . is_nan ( ) {
232
+ SKIP
233
+ } else {
234
+ None
235
+ }
236
+ }
220
237
}
221
238
}
222
239
0 commit comments