Skip to content

Libm reorganization #831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 19, 2025
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 compiler-builtins/src/math.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#[allow(dead_code)]
#[allow(unused_imports)]
#[allow(clippy::all)]
#[path = "../../libm/libm/src/math/mod.rs"]
#[path = "../../libm/src/math/mod.rs"]
pub(crate) mod libm;

macro_rules! libm_intrinsics {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions etc/libm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[workspace]
resolver = "2"
members = [
"libm",
"crates/libm-macros",
"crates/libm-test",
"crates/musl-math-sys",
"crates/util",
]
default-members = [
"libm",
"crates/libm-macros",
"crates/libm-test"
]
exclude = [
# Requires `panic = abort` so can't be a member of the workspace
"crates/compiler-builtins-smoke-test",
]

# The default release profile is unchanged.

# Release mode with debug assertions
[profile.release-checked]
inherits = "release"
debug-assertions = true
overflow-checks = true

# Release with maximum optimizations, which is very slow to build. This is also
# what is needed to check `no-panic`.
[profile.release-opt]
inherits = "release"
codegen-units = 1
lto = "fat"

[profile.bench]
# Required for iai-callgrind
debug = true
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
86 changes: 49 additions & 37 deletions libm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,37 +1,49 @@
[workspace]
resolver = "2"
members = [
"libm",
"crates/libm-macros",
"crates/libm-test",
"crates/musl-math-sys",
"crates/util",
]
default-members = [
"libm",
"crates/libm-macros",
"crates/libm-test"
]
exclude = [
# Requires `panic = abort` so can't be a member of the workspace
"crates/compiler-builtins-smoke-test",
]

# The default release profile is unchanged.

# Release mode with debug assertions
[profile.release-checked]
inherits = "release"
debug-assertions = true
overflow-checks = true

# Release with maximum optimizations, which is very slow to build. This is also
# what is needed to check `no-panic`.
[profile.release-opt]
inherits = "release"
codegen-units = 1
lto = "fat"

[profile.bench]
# Required for iai-callgrind
debug = true
[package]
authors = ["Jorge Aparicio <[email protected]>"]
categories = ["no-std"]
description = "libm in pure Rust"
documentation = "https://docs.rs/libm"
keywords = ["libm", "math"]
license = "MIT"
name = "libm"
readme = "README.md"
repository = "https://github.com/rust-lang/libm"
version = "0.2.11"
edition = "2021"
rust-version = "1.63"

[features]
default = ["arch"]

# Enable architecture-specific features such as SIMD or assembly routines.
arch = []

# This tells the compiler to assume that a Nightly toolchain is being used and
# that it should activate any useful Nightly things accordingly.
unstable = ["unstable-intrinsics", "unstable-float"]

# Enable calls to functions in `core::intrinsics`
unstable-intrinsics = []

# Make some internal things public for testing.
unstable-public-internals = []

# Enable the nightly-only `f16` and `f128`.
unstable-float = []

# Used to prevent using any intrinsics or arch-specific code.
#
# HACK: this is a negative feature which is generally a bad idea in Cargo, but
# we need it to be able to forbid other features when this crate is used in
# Rust dependencies. Setting this overrides all features that may enable
# hard float operations.
force-soft-floats = []

[dev-dependencies]
no-panic = "0.1.35"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
# compiler-builtins sets this feature, but we use it in `libm`
'cfg(feature, values("compiler-builtins"))',
] }
File renamed without changes.
File renamed without changes.
38 changes: 0 additions & 38 deletions libm/crates/compiler-builtins-smoke-test/Cargo.toml

This file was deleted.

8 changes: 0 additions & 8 deletions libm/crates/compiler-builtins-smoke-test/build.rs

This file was deleted.

17 changes: 0 additions & 17 deletions libm/crates/compiler-builtins-smoke-test/src/lib.rs

This file was deleted.

182 changes: 0 additions & 182 deletions libm/crates/compiler-builtins-smoke-test/src/math.rs

This file was deleted.

1 change: 0 additions & 1 deletion libm/crates/musl-math-sys/musl
Submodule musl deleted from 61399d
Loading