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

Commit 0012969

Browse files
authored
Merge pull request #404 from tgross35/i586-mpfr
Enable MPFR tests on i586
2 parents 9592711 + 1acec06 commit 0012969

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

libm/ci/docker/i586-unknown-linux-gnu/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ FROM ubuntu:24.04
22

33
RUN apt-get update && \
44
apt-get install -y --no-install-recommends \
5-
gcc-multilib libc6-dev ca-certificates
5+
gcc-multilib m4 make libc6-dev ca-certificates

libm/ci/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ case "$target" in
4545
# FIXME(ci): we should be able to enable aarch64 Linux here once GHA
4646
# support rolls out.
4747
x86_64*) extra_flags="$extra_flags --features libm-test/test-multiprecision" ;;
48-
# i686 works fine, i586 does not
4948
i686*) extra_flags="$extra_flags --features libm-test/test-multiprecision" ;;
49+
i586*) extra_flags="$extra_flags --features libm-test/test-multiprecision --features gmp-mpfr-sys/force-cross" ;;
5050
# Apple aarch64 is native
5151
aarch64*apple*) extra_flags="$extra_flags --features libm-test/test-multiprecision" ;;
5252
esac

libm/crates/libm-test/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ unstable-float = ["libm/unstable-float", "rug?/nightly-float"]
1212

1313
# Generate tests which are random inputs and the outputs are calculated with
1414
# musl libc.
15-
test-multiprecision = ["dep:az", "dep:rug"]
15+
test-multiprecision = ["dep:az", "dep:rug", "dep:gmp-mpfr-sys"]
1616

1717
# Build our own musl for testing and benchmarks
1818
build-musl = ["dep:musl-math-sys"]
@@ -26,6 +26,7 @@ short-benchmarks = []
2626
[dependencies]
2727
anyhow = "1.0.90"
2828
az = { version = "1.2.1", optional = true }
29+
gmp-mpfr-sys = { version = "1.6.4", optional = true, default-features = false, features = ["mpfr"] }
2930
indicatif = { version = "0.17.9", default-features = false }
3031
libm = { path = "../..", features = ["unstable-public-internals"] }
3132
libm-macros = { path = "../libm-macros" }

libm/crates/libm-test/src/precision.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,14 @@ pub fn default_ulp(ctx: &CheckCtx) -> u32 {
104104
// In some cases, our implementation is less accurate than musl on i586.
105105
if cfg!(x86_no_sse) {
106106
match ctx.fn_ident {
107+
// FIXME(#401): these need to be correctly rounded but are not.
108+
Id::Fmaf => ulp = 1,
109+
Id::Fdim => ulp = 1,
110+
107111
Id::Asinh => ulp = 3,
108112
Id::Asinhf => ulp = 3,
109113
Id::Exp10 | Id::Exp10f => ulp = 1_000_000,
110114
Id::Exp2 | Id::Exp2f => ulp = 10_000_000,
111-
Id::Fmaf => ulp = 1,
112115
Id::Log1p | Id::Log1pf => ulp = 2,
113116
Id::Rint => ulp = 100_000,
114117
Id::Round => ulp = 1,

0 commit comments

Comments
 (0)