1986 Commits

Author SHA1 Message Date
Trevor Gross
4a1dc96652 Rename the i686 module to x86
This module is used for both i686 and x86-64.
2025-05-03 14:17:49 -04:00
Trevor Gross
2705f686b5 update-api-list: Match subdirectories within arch 2025-05-03 14:17:49 -04:00
Trevor Gross
1c5f8cc72d fmaf: Add a test case from a MinGW failure
This is a known problem in the MinGW fmaf implementation, identified at
[1].  Make sure our implementation passes this edge case.

[1]: https://github.com/rust-lang/rust/issues/140515
2025-05-01 21:24:34 -04:00
Trevor Gross
4c2659f9ce builtins-test: Remove no_mangle from eh_personality
Rustc now mangles these symbols on its own, so `no_mangle` is rejected
as an error.
2025-05-01 15:03:07 -04:00
Trevor Gross
caf337d467 Refactor the fma modules
Move implementations to `generic/` like the other functions. This also
allows us to combine the `fma` and `fma_wide` modules.
2025-04-29 19:09:50 -04:00
Trevor Gross
6d83a3226f Move fma implementations to mod generic
This will not build correctly, the move is done as a separate step from
the rest of refactoring so git's history is cleaner.
2025-04-29 19:09:50 -04:00
Trevor Gross
8d789ea8f1 Resolve unnecessary_transmutes lints
These appeared in a later nightly. In compiler-builtins we can apply the
suggestion, but in `libm` we need to ignore them since `fx::from_bits`
is not `const` at the MSRV.

`clippy::uninlined_format_args` also seems to have gotten stricter, so
fix those here.
2025-04-29 18:15:02 -04:00
Trevor Gross
975617e8d4 Warn on unsafe_op_in_unsafe_fn by default
Edition 2024 requires that we avoid this. There is a lot of code that
will need to be adjusted, so start the process here with a warning that
will show up in CI.
2025-04-23 15:27:05 -04:00
Trevor Gross
99202af075 libm-macros: Allow a way to bulk match f16 and f128 functions
These are never available in musl, so introduce easier ways to skip them
rather than needing to exclude f16/f128 functions in three different
places.
2025-04-23 15:04:51 -04:00
Trevor Gross
1dd39e27f0 libm-macros: Start tracking which functions are public
It would be nice to reuse some of the macro structure for internal
functions, like `rem_pio2`. To facilitate this, add a `public` field and
make it available in the macro's API.
2025-04-23 03:48:02 -04:00
Trevor Gross
b6db36061e musl: Update submodule
Update the musl submodule to c47ad25ea3 ("iconv: harden UTF-8 output
code path against input decoder bugs").
2025-04-22 17:09:18 -04:00
Trevor Gross
5028ecd025 chore: Release libm v0.2.13 2025-04-22 04:44:00 -04:00
Trevor Gross
d30dde73b3 fix: Switch to resolver v2
The published crates fail to build with an edition less than 2024
because they are packaged with `resolver = "3"`, which is a 2024-only
option. Revert back to resolver v2 to drop this requirement.

Fixes: https://github.com/rust-lang/compiler-builtins/issues/883
2025-04-22 04:00:49 -04:00
Trevor Gross
aec649faae chore: Combine CHANGELOG files for compiler-builtins
This unintentionally got split when compiler-builtins was moved to a
subdirectory.
2025-04-22 01:34:46 -04:00
github-actions[bot]
1fa9d0fce3 chore: release builtins 0.1.156 and libm 0.2.12 2025-04-22 01:34:46 -04:00
quaternic
e075e9fbde Reimplement the generic fmod 2025-04-22 00:53:56 -04:00
Trevor Gross
a8652953e4 Rename the public-test-deps feature to unstable-public-internals
`compiler-builtins` uses `public-test-deps`, `libm` uses
`unstable-public-internals`. Consolidate these under the `libm` name.

Once compiler-builtins is no longer published, this feature can probably
be dropped.

Also switch to `dep:` syntax for features that enable dependencies.
2025-04-21 23:24:52 -04:00
Trevor Gross
13b94cf89f ci: Fix extensive tests
Move this to a script and ensure only `libm-test` gets built to avoid
default feature issues with `compiler-builtins`.
2025-04-21 22:50:42 -04:00
Trevor Gross
913796c1c5 Fix compiler-builtins publish
compiler-builtins currently wouldn't publish correctly because of a
relative path to `libm` that doesn't get included in the package. Fix
this by simlinking `libm` to within the `compiler-builtins` directory.

Also symlink LICENSE.txt which lets us drop the `include` array in
Cargo.toml. LICENSE.txt and compiler-rt were not being included anyway,
since Cargo silently drops items that are not within the crate
directory.
2025-04-21 06:16:12 -04:00
Trevor Gross
94448a6ff6 Update README and CONTRIBUTING for the new repository layout 2025-04-21 06:16:12 -04:00
Trevor Gross
8ce02e8ef5 Move README.md to compiler-builtins, CONTRIBUTING.md to root
Do this in a commit so git tracks the move; a new README will be
introduced in the root, and CONTRIBUTING will be updated to apply to
both crates.
2025-04-21 06:16:12 -04:00
Trevor Gross
013a83acdd Update licensing information after repository refactoring
In order to disambiguate things now that libm is part of the
compiler-builtins repository, do the following:

* Mention libm in LICENSE.txt
* Clarify the default license for crates other than libm and
  compiler-builtins
* Add an explicit license field to Cargo.toml for all other crates
2025-04-21 06:16:12 -04:00
Patryk Wychowaniec
e0d07241d0 avr: Provide abort() 2025-04-21 03:02:24 -04:00
Trevor Gross
97ddaca356 Remove unsafe from naked_asm! blocks
This was changed in a recent nightly so the unsafety is only in the
attribute, `#[unsafe(naked)]`.
2025-04-21 02:45:06 -04:00
Trevor Gross
cf13785636 ci: Fix release-plz configuration 2025-04-20 14:50:27 -04:00
Trevor Gross
4e8eea696d Add panic-handler to the workspace
This crate does not interact with features so there isn't any reason it
can't become part of the workspace.
2025-04-20 05:33:19 -04:00
Trevor Gross
66be06a1a7 ci: Remove the old libm workflow file
All jobs are now run as part of `compiler-builtins`.
2025-04-20 05:33:19 -04:00
Trevor Gross
97e4729525 ci: Configure release-plz to run semver checks on libm 2025-04-20 05:33:19 -04:00
Trevor Gross
46bbc3dd88 ci: Clean up workflow file and docker script 2025-04-20 05:33:19 -04:00
Trevor Gross
13bf5f5bb4 ci: Use lowercase for bash locals, fix shellcheck 2025-04-20 05:33:19 -04:00
Trevor Gross
ee431374eb ci: Add a timeout for all jobs 2025-04-20 04:39:06 -04:00
Trevor Gross
8902f740da ci: Skip testing libm in PRs if it did not change
Many contributions to compiler-builtins don't have any need to touch
libm, and could get by with the few minutes of CI for compiler-builtins
rather than the ~30 minutes for libm. We already have some scripts that
handle changed file detection, so expand its use to skip libm CI if it
doesn't need to run.
2025-04-20 04:24:24 -04:00
Trevor Gross
a829d916b5 ci: Add /cargo/bin to the path in Docker
This makes it possible to use nextest within the container.
2025-04-20 04:11:53 -04:00
Trevor Gross
22f44df8bd Set the musl submodule to 61399d4b ("loongarch64: add TLSDESC support")
Set the submodule to the same version we had been using in
rust-lang/libm. This is a downgrade from the current version but it
avoids some new deviations that show up, which can be corrected later.
2025-04-20 03:22:27 -04:00
Trevor Gross
9c96f245b8 ci: Enable testing of libm crates
Update `run.sh` to start testing `libm`. Currently this is somewhat
inefficient because `builtins-test` gets run more than once on some
targets; this can be cleaned up later.
2025-04-20 03:22:27 -04:00
Trevor Gross
d0e0134dc5 ci: Add extensive tests from rust-lang/libm 2025-04-20 02:33:17 -04:00
Trevor Gross
9919218493 ci: Add a libm MSRV check
Add the job from rust-lang/libm
2025-04-20 02:23:28 -04:00
Trevor Gross
d02b25fd6e Fix the libm-test logfile path
This was broken since the crate's location relative to the target
directory had changed.
2025-04-20 00:58:50 -04:00
Trevor Gross
0d0d317242 Enable icount benchmarks in CI 2025-04-20 00:58:50 -04:00
Trevor Gross
141c7b06c4 Add remaining libm crates to the workspace
These are still not yet covered in CI since we always name explicit
packages there, but all crates are now part of the workspace.
2025-04-19 23:20:13 -04:00
Trevor Gross
a48de6950c Move builtins-test-intrinsics out of the workspace
This crate doesn't need to be a default member since it requires the
opposite settings from everything else. Exclude it from the workspace
and run it only when explicitly requested.

This also makes `cargo t --no-default-features` work without additional
qualifiers. `--no-default-features` still needs to be passed to ensure
`#![compiler_builtins]` does not get set.

compiler-builtins needs doctests disabled in order for everything to
work correctly, since this causes an error running rustdoc that is
unrelated to features (our `compiler_builtins` is getting into the crate
graph before that from the sysroot, but `#![compiler_builtins]` is not
set).

We can also remove `test = false` and `doctest = false` in
`builtins-test` since these no longer cause issues. This is unlikely to
be used but it is better to not quietly skip if anything ever gets added
by accident.
2025-04-19 22:30:58 -04:00
Trevor Gross
c35cccd676 Move the libm .editorconfig to root 2025-04-19 20:42:40 -04:00
Trevor Gross
9b8065decb Combine the libm .gitignore 2025-04-19 20:42:40 -04:00
Trevor Gross
98acedc914 Remove libm CI dockerfiles
These are identical to what already exists in compiler-builtins except
for some base image changes, so we can eliminate the duplicates.
2025-04-19 20:42:40 -04:00
Trevor Gross
8d70be87e6 Run cargo fmt on all projects
Apply the same formatting rules to both `libm` and `compiler-builtins`.
2025-04-19 19:05:49 -04:00
Trevor Gross
569b40209d Add a .rustfmt.toml with style edition 2024
Use the 2024 style edition for all crates and enable import sorting.
2024 already applies some smaller heuristics that look good in
compiler-builtins, I have dropped `use_small_heuristics` that was set in
`libm` because it seems to negatively affect the readibility of anything
working with numbers (e.g. collapsing multiple small `if` expressions
into a single line).
2025-04-19 19:05:49 -04:00
Trevor Gross
66fa4fd265 Add libm and libm-macros to the workspace
These should build and test correctly. `libm-test` and others that
depend on it are excluded since the necessary CI is not yet set up.
2025-04-19 19:05:49 -04:00
Trevor Gross
cab8700e84 libm: Fix crate compilation
Update paths and submodules to fix `libm-test` and `util` building so we
will be able to add them to the workspace.
2025-04-19 18:23:45 -04:00
Trevor Gross
ca5c4ed8d7 Fix the release-plz job 2025-04-19 17:31:43 -04:00
Trevor Gross
8b8bd8a0fd libm: Flatten the libm/libm directory 2025-04-19 17:20:24 -04:00