Trevor Gross be35d37d8b
Use the compiler to determine whether or not to enable f16 and f128
Currently we whether or not to build and test `f16` and `f128` support
mostly based on the target triple. This isn't always accurate, however,
since support also varies by backend and the backend version.

Since recently, `rustc` is aware of this with the unstable config option
`target_has_reliable_{f16,f128}`, which better represents when the types
are actually expected to be available and usable. Switch our
compiler-builtins and libm configuration to use this by probing `rustc`
for the target's settings.

A few small `cfg` fixes are needed with this.
2025-07-02 01:18:54 -05:00
..
2025-06-13 17:35:21 +00:00

libm

A Rust implementations of the C math library.

Usage

libm provides fallback implementations for Rust's float math functions in core, and the core_float_math feature. If what is available suits your needs, there is no need to add libm as a dependency.

If more functionality is needed, this crate can also be used directly:

[dependencies]
libm = "0.2.11"

Contributing

Please check CONTRIBUTING.md

Minimum Rust version policy

This crate supports rustc 1.63 and newer.

License

Usage is under the MIT license, available at https://opensource.org/license/mit.

Contribution

Contributions are licensed under both the MIT license and the Apache License, Version 2.0, available at https://www.apache.org/licenses/LICENSE-2.0. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as mentioned, without any additional terms or conditions.

See LICENSE.txt for full details.