Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 0164e93

Browse files
committed
Loosen precision on i586 based on new tests
1 parent 5e0c840 commit 0164e93

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

crates/libm-test/src/precision.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ pub fn default_ulp(ctx: &CheckCtx) -> u32 {
106106
match ctx.fn_ident {
107107
Id::Asinh => ulp = 3,
108108
Id::Asinhf => ulp = 3,
109+
Id::Exp10 | Id::Exp10f => ulp = 1_000_000,
110+
Id::Exp2 | Id::Exp2f => ulp = 10_000_000,
111+
Id::Fmaf => ulp = 1,
109112
Id::Log1p | Id::Log1pf => ulp = 2,
113+
Id::Rint => ulp = 100_000,
110114
Id::Round => ulp = 1,
111115
Id::Tan => ulp = 2,
112116
_ => (),
@@ -271,15 +275,23 @@ impl MaybeOverride<(f64,)> for SpecialCase {
271275
}
272276

273277
if (ctx.fn_ident == Identifier::Ceil || ctx.fn_ident == Identifier::Floor)
278+
&& cfg!(x86_no_sse)
274279
&& expected.eq_repr(F::NEG_ZERO)
275280
&& actual.eq_repr(F::ZERO)
276-
&& cfg!(x86_no_sse)
277281
{
278282
// FIXME: the x87 implementations do not keep the distinction between -0.0 and 0.0.
279283
// See https://github.com/rust-lang/libm/pull/404#issuecomment-2572399955
280284
return XFAIL;
281285
}
282286

287+
if (ctx.fn_ident == Identifier::Exp10 || ctx.fn_ident == Identifier::Exp2)
288+
&& cfg!(x86_no_sse)
289+
{
290+
// FIXME: i586 has very imprecise results with ULP > u32::MAX for these
291+
// operations so we can't reasonably provide a limit.
292+
return XFAIL;
293+
}
294+
283295
maybe_check_nan_bits(actual, expected, ctx)
284296
}
285297

0 commit comments

Comments
 (0)