Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/docker/i586-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ FROM ubuntu:24.04

RUN apt-get update && \
apt-get install -y --no-install-recommends \
gcc-multilib libc6-dev ca-certificates
gcc-multilib m4 make libc6-dev ca-certificates
2 changes: 1 addition & 1 deletion ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ case "$target" in
# FIXME(ci): we should be able to enable aarch64 Linux here once GHA
# support rolls out.
x86_64*) extra_flags="$extra_flags --features libm-test/test-multiprecision" ;;
# i686 works fine, i586 does not
i686*) extra_flags="$extra_flags --features libm-test/test-multiprecision" ;;
i586*) extra_flags="$extra_flags --features libm-test/test-multiprecision --features gmp-mpfr-sys/force-cross" ;;
# Apple aarch64 is native
aarch64*apple*) extra_flags="$extra_flags --features libm-test/test-multiprecision" ;;
esac
Expand Down
3 changes: 2 additions & 1 deletion crates/libm-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ unstable-float = ["libm/unstable-float", "rug?/nightly-float"]

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

# Build our own musl for testing and benchmarks
build-musl = ["dep:musl-math-sys"]
Expand All @@ -26,6 +26,7 @@ short-benchmarks = []
[dependencies]
anyhow = "1.0.90"
az = { version = "1.2.1", optional = true }
gmp-mpfr-sys = { version = "1.6.4", optional = true, default-features = false, features = ["mpfr"] }
indicatif = { version = "0.17.9", default-features = false }
libm = { path = "../..", features = ["unstable-public-internals"] }
libm-macros = { path = "../libm-macros" }
Expand Down
5 changes: 4 additions & 1 deletion crates/libm-test/src/precision.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,14 @@ pub fn default_ulp(ctx: &CheckCtx) -> u32 {
// In some cases, our implementation is less accurate than musl on i586.
if cfg!(x86_no_sse) {
match ctx.fn_ident {
// FIXME(#401): these need to be correctly rounded but are not.
Id::Fmaf => ulp = 1,
Id::Fdim => ulp = 1,

Id::Asinh => ulp = 3,
Id::Asinhf => ulp = 3,
Id::Exp10 | Id::Exp10f => ulp = 1_000_000,
Id::Exp2 | Id::Exp2f => ulp = 10_000_000,
Id::Fmaf => ulp = 1,
Id::Log1p | Id::Log1pf => ulp = 2,
Id::Rint => ulp = 100_000,
Id::Round => ulp = 1,
Expand Down