Skip to content

Merge compiler-builtins as a Josh subtree #141229

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 2,504 commits into from
Jun 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2504 commits
Select commit Hold shift + click to select a range
df5ac49
Merge pull request rust-lang/libm#466 from tgross35/generic-fmin-fmax
tgross35 Jan 24, 2025
08eda86
Add a generic version of `fmod`
tgross35 Jan 24, 2025
67218cb
Add `fmodf16` using the generic implementation
tgross35 Jan 24, 2025
ddffab3
Merge pull request rust-lang/libm#469 from tgross35/generic-mod
tgross35 Jan 24, 2025
9d38c93
Increase or set CI timeouts
tgross35 Jan 24, 2025
b863308
Add way to override the number of iterations for specific tests
tgross35 Jan 24, 2025
71200bc
Add `fmodf128`
tgross35 Jan 24, 2025
3524632
Merge pull request rust-lang/libm#470 from tgross35/f128-fmod
tgross35 Jan 24, 2025
173a48c
Enable missing icount benchmarks
tgross35 Jan 24, 2025
7c6c0c1
Upgrade all dependencies to the latest version
tgross35 Jan 25, 2025
62f0fd4
Use `az` exported from Rug
tgross35 Jan 25, 2025
edd1289
Use `frexp` from Rug
tgross35 Jan 25, 2025
b9bd107
Use `remquo` from Rug
tgross35 Jan 25, 2025
9c6548e
Merge pull request rust-lang/libm#477 from tgross35/upgrade-dependencies
tgross35 Jan 25, 2025
4a98907
Remove remnants of the `checked` feature
tgross35 Jan 25, 2025
f0b932e
Rework the available Cargo profiles
tgross35 Jan 25, 2025
90c76ad
Ignore specific `atan2` and `sin` tests on i586
tgross35 Jan 27, 2025
64e0a0a
Remove use of the `start` feature
tgross35 Jan 27, 2025
98fd72b
Merge pull request rust-lang/libm#479 from tgross35/cargo-profile-upd…
tgross35 Jan 28, 2025
4e1b885
Add a version to some FIXMEs that will be resolved in LLVM 20
tgross35 Jan 24, 2025
259e544
Switch musl from a script download to a submodule
tgross35 Jan 27, 2025
176d22d
Temporarily pin `indicatif` to 0.17.9
tgross35 Jan 28, 2025
ececfab
Don't build out of line atomics support code for uefi
nikic Jan 28, 2025
396725e
Revert "Temporarily pin `indicatif` to 0.17.9"
tgross35 Jan 28, 2025
99c1080
Support parsing NaN and infinities from the `hf*` functions
tgross35 Jan 28, 2025
f767b58
Introduce a wrapper type for IEEE hex float formatting
tgross35 Jan 28, 2025
e283c25
Util: also print the hex float format for outputs
tgross35 Jan 28, 2025
9d62bd0
Merge pull request rust-lang/libm#483 from tgross35/hex-print
tgross35 Jan 30, 2025
7d67414
Specify license as just MIT
Manishearth Jan 30, 2025
8db5ff7
Rename `EXP_MAX` to `EXP_SAT`
tgross35 Jan 31, 2025
5a5a5a3
Indentation fix to please clippy
GrigorenkoPV Jan 31, 2025
57572a5
Revert "Eliminate the use of `public_test_dep!`"
tgross35 Feb 4, 2025
dbd3032
chore: release v0.1.145
github-actions[bot] Feb 4, 2025
9cba04b
Merge pull request #751 from rust-lang/release-plz-2025-01-28T02-10-10Z
tgross35 Feb 4, 2025
98bee05
Fix hex float trait recursion problem
tgross35 Jan 30, 2025
cc2874c
Add `scalbnf16`, `scalbnf128`, `ldexpf16`, and `ldexpf128`
tgross35 Jan 3, 2025
0e6d93f
Merge pull request rust-lang/libm#391 from rust-lang/tgross35/f16-f12…
tgross35 Feb 5, 2025
cc1a55a
Add a check in the `shared.rs` that the function list is sorted
tgross35 Feb 5, 2025
f7765fa
Do not add `libm_helper.rs` to the sources list
tgross35 Feb 5, 2025
eee632e
Add checks via annotation that lists are sorted or exhaustive
tgross35 Feb 5, 2025
466cd81
Merge pull request rust-lang/libm#489 from tgross35/sort-everything
tgross35 Feb 5, 2025
9458abd
Start converting `fma` to a generic function
tgross35 Jan 23, 2025
e01ce5d
Commonize the signature for all instances of `get_test_cases`
tgross35 Feb 5, 2025
3fbe59f
Print the hex float format upon failure
tgross35 Feb 6, 2025
2398924
fma: Ensure zero has the correct sign
tgross35 Feb 6, 2025
ada2d9a
Switch `musl` to track `master`
tgross35 Feb 6, 2025
f070e65
Merge pull request rust-lang/libm#493 from tgross35/fma-sign
tgross35 Feb 6, 2025
4bf116f
Add an integration test that verifies a list of cases
tgross35 Feb 6, 2025
7f3bd59
Expose erf{,c}{,f} from libm
GrigorenkoPV Jan 31, 2025
84cb50e
chore: release v0.1.146
github-actions[bot] Feb 6, 2025
3aa4da2
Improve tidy output
tgross35 Feb 6, 2025
bbdcc7e
Make it possible to use `hf32!` and similar macros outside of `libm`
tgross35 Feb 6, 2025
9223d60
Add `fmaf128`
tgross35 Feb 5, 2025
aac4901
Add better edge case testing for `scalbn`
tgross35 Feb 7, 2025
69ebd75
Run standard tests before running integration tests
tgross35 Feb 7, 2025
f028611
Check more subnormal values during edge cases tests
tgross35 Feb 7, 2025
d35a443
fmaf128: fix exponent calculation for subnormals
tgross35 Feb 7, 2025
bd0c2cb
Merge pull request rust-lang/libm#497 from tgross35/edge-case-max-sub…
tgross35 Feb 7, 2025
3e2de21
Remove or reduce the scope of `allow(unused)` where possible
tgross35 Feb 7, 2025
aa4ae48
Convert `fmaf` to a generic implementation
tgross35 Feb 7, 2025
9169216
Uncomment some hex float tests that should work now
tgross35 Feb 7, 2025
f45cc66
Work arouind iai-callgrind apt failures
tgross35 Feb 7, 2025
f1afc26
Add an enum representation of rounding mode
tgross35 Jan 25, 2025
2fa2b10
Port the CORE-MATH version of `cbrt`
tgross35 Oct 25, 2024
35c201c
Decrease the allowed error for `cbrt`
tgross35 Jan 25, 2025
e35c5c8
Merge pull request rust-lang/libm#475 from tgross35/core-cbrt
tgross35 Feb 7, 2025
0a43f24
Add simple icount benchmarks for `u256` operations
tgross35 Feb 8, 2025
900b61f
Change how operators are `black_box`ed
tgross35 Feb 8, 2025
017f103
Replace an `assert!` with `debug_assert!` in `u256::shr`
tgross35 Feb 8, 2025
1efdc96
Increase the tolerance for `jn` and `yn`
tgross35 Feb 10, 2025
b7fdce0
ci: Pin the nightly toolchain for i686-pc-windows-gnu
tgross35 Feb 9, 2025
2f0685a
Implement `u256` with two `u128`s rather than `u64`
tgross35 Feb 8, 2025
35f5731
Introduce a trait constant for the minimum positive normal value
tgross35 Feb 10, 2025
105cd79
Migrate away from nonfunctional `fenv` stubs
tgross35 Feb 10, 2025
e94e987
Eliminate the use of `force_eval!` in `ceil`, `floor`, and `trunc`
tgross35 Feb 10, 2025
8e7c83e
Merge pull request rust-lang/libm#510 from tgross35/replace-fenv
tgross35 Feb 10, 2025
a6dd798
Small refactor of bigint tests
tgross35 Feb 10, 2025
86ee1f9
Combine `fmin{,f,f16,f128}` and `fmax{,f,f16,128}` into a single file
tgross35 Feb 10, 2025
6697313
Add `fminimum`, `fmaximum`, `fminimum_num`, and `fmaximum_num`
tgross35 Feb 10, 2025
e79fb05
Increase allowed offset from infinity for ynf
tgross35 Feb 10, 2025
2a3ef8b
Fix parsing of negative hex float literals in util
tgross35 Feb 11, 2025
53a0550
Add `roundeven{,f,f16,f128}`
tgross35 Feb 11, 2025
7db47c7
Check exact values for specified cases
tgross35 Feb 11, 2025
aa26cab
Rename `Float::exp` to `Float::ex`
tgross35 Feb 11, 2025
e106d63
Add a way to print inputs on failure
tgross35 Feb 12, 2025
dea2ed3
Scale test iteration count at a later point
tgross35 Feb 12, 2025
212d463
fma refactor 1/3: remove math/fma.rs
tgross35 Feb 12, 2025
bcbdb0b
fma refactor 2/3: move math/generic/fma.rs to math/fma.rs
tgross35 Feb 12, 2025
720ba18
fma refactor 3/3: combine `fma` public API with its implementation
tgross35 Feb 12, 2025
c01153d
Make `fma` a trait method on `Float`
tgross35 Feb 12, 2025
5d5674a
Merge pull request rust-lang/libm#520 from tgross35/fma-restructure
tgross35 Feb 12, 2025
bd41642
Use `git ls-files` rather than manually globbing for tidy
tgross35 Feb 12, 2025
37da10e
ci: Update actions/cache to v4
tgross35 Feb 18, 2025
4517c7e
ci: Pin the nightly toolchain for i686-pc-windows-gnu
tgross35 Feb 18, 2025
bade629
ci: Pin the nightly toolchain for aarch64-unknown-linux-gnu
tgross35 Feb 19, 2025
2b6de7a
remove win64_128bit_abi_hack
RalfJung Feb 18, 2025
f851256
chore: release v0.1.147
github-actions[bot] Feb 19, 2025
54e7ff1
Revert "ci: Pin the nightly toolchain for i686-pc-windows-gnu"
tgross35 Feb 23, 2025
c32bc83
ci: Pin the nightly toolchain for aarch64 jobs
tgross35 Feb 24, 2025
ba8f072
Make the compiler-builtins test more accurately mirror compiler-builtins
tgross35 Feb 24, 2025
f42c963
Eliminate the use of `public_test_dep!` for a third time
tgross35 Jan 15, 2025
49224fb
Enable `f16` for MIPS
Feb 18, 2025
9021b28
Resolve monomorphization errors in `compiler-builtins`
tgross35 Feb 24, 2025
3f6b08a
Ignore unused variables when `compiler-builtins` is set
tgross35 Feb 24, 2025
2615971
Configure out remaining formatting when `compiler-builtins` is set
tgross35 Feb 24, 2025
1774882
Gate another assertion behind `compiler-builtins`
tgross35 Feb 24, 2025
7055198
Update the `libm` submodule
tgross35 Feb 23, 2025
95a5ad5
chore: release v0.1.148
github-actions[bot] Feb 24, 2025
55bbda8
Make a subset of `libm` symbols weakly available on all platforms
tgross35 Feb 13, 2025
45c4a1d
chore: release v0.1.149
github-actions[bot] Feb 25, 2025
60ea581
Update LLVM downloads to 20.1-2025-02-13
tgross35 Feb 26, 2025
afea1c0
Disable `f16` on AArch64 without the `neon` feature
tgross35 Mar 1, 2025
4b664fd
chore: release v0.1.150
github-actions[bot] Mar 1, 2025
41f1ad2
Remove outdated information from the readme
tgross35 Mar 2, 2025
2de09ac
Add __extendhfdf2 and add __truncdfhf2 test
tgross35 Mar 4, 2025
340d3d4
Simplify test crate build features
tgross35 Mar 4, 2025
968a7d0
Add a test config for __gnu_h2f_ieee and __gnu_f2h_ieee
tgross35 Mar 4, 2025
e4c1eb8
Revert "ci: Pin the nightly toolchain for aarch64-unknown-linux-gnu"
tgross35 Mar 5, 2025
890cd1e
Enable `f16` for LoongArch (#770)
heiher Mar 5, 2025
f5f09d2
Add cygwin support
Berrysoft Feb 28, 2025
795fa2f
chore: release v0.1.151
github-actions[bot] Mar 5, 2025
4735ded
Revert "Add a test config for __gnu_h2f_ieee and __gnu_f2h_ieee"
tgross35 Mar 5, 2025
2d8c362
Migrate `testcrate` and `panic-handler` to edition 2024
tgross35 Mar 6, 2025
1112886
Use the v2 resolver in the workspace
tgross35 Mar 6, 2025
1fb5e1a
Replace some uses of `sign` with `sig`
tgross35 Mar 8, 2025
192206b
Revert "Disable some PPC64 tests which are failing due to an LLVM(?) …
Gelbpunkt Mar 17, 2025
6d35313
Revert "Disable broken powerpc64 test due to https://github.com/rust-…
Gelbpunkt Mar 17, 2025
590a564
remove element_unordered_atomic intrinsics
RalfJung Mar 12, 2025
a179959
Move `examples/intrinsics.rs` to its own crate
tgross35 Mar 18, 2025
afa3eed
Mark `builtins-test-intrinsics` as `publish = false`
tgross35 Mar 18, 2025
f8b03df
Add a script for downloading compiler-rt
tgross35 Mar 18, 2025
014f530
nightlies without clippy are not a thing any more
RalfJung Mar 18, 2025
7257596
Upgrade all dependencies to the latest
tgross35 Mar 18, 2025
3167cbb
Temporarily disable the test call to `rust_begin_unwind`
tgross35 Mar 19, 2025
683485c
Switch repository layout to use a virtual manifest
tgross35 Mar 19, 2025
fc1b87d
Remove use of `atomic_load_unordered` and undefined behaviour from `a…
beetrees Mar 12, 2025
a0d40f2
chore: release v0.1.152
github-actions[bot] Mar 20, 2025
f0f9cfa
Add benchmarks using `iai-callgrind`
tgross35 Mar 20, 2025
7b674e5
Clean up icount benchmarks
tgross35 Mar 22, 2025
5cf9938
copy_misaligned_words: avoid out-of-bounds accesses (#799)
RalfJung Mar 22, 2025
30c1280
avr: Skip No More!
Patryk27 Mar 23, 2025
9b8ccf6
Revert "Disable `f16` on AArch64 without the `neon` feature"
tgross35 Apr 2, 2025
87595c5
Remove a mention of `force-soft-float` in `build.rs`
tgross35 Apr 9, 2025
4e5cbbe
Replace calls to `core::arch` intrinsics with assembly
tgross35 Apr 9, 2025
375cb54
Resolve small errors identified by recent clippy
tgross35 Apr 9, 2025
28b6df8
Add assembly version of simple operations on aarch64
tgross35 Jan 23, 2025
571a3dc
Update the `libm` submodule
tgross35 Apr 9, 2025
73a0444
chore: release v0.1.153
github-actions[bot] Apr 9, 2025
b955cc6
Implement rounding for the hex float parsing and prepare to improve e…
quaternic Apr 15, 2025
b8083bd
turn #[naked] into an unsafe attribute
folkertdev Apr 13, 2025
377b08c
chore: release v0.1.154
github-actions[bot] Apr 16, 2025
14ab245
fmod: Add regression tests for subnormal issue
tgross35 Apr 15, 2025
e4d716c
fmod: Correct the normalization of subnormals
tgross35 Apr 16, 2025
7fb882c
avr: __udivmod(h|q)i4
tones111 Apr 12, 2025
9272584
Replace the `bl!` macro with `asm_sym`
tgross35 Apr 17, 2025
ec74a38
use `#[cfg(bootstrap)]` for rustc sync
folkertdev Apr 17, 2025
3ea9f84
chore: release v0.1.155
github-actions[bot] Apr 17, 2025
f88b7c8
Add `NEG_NAN` to `Float`
tgross35 Apr 18, 2025
579627d
Make `assert_biteq!` not rely on having `Int` in scope
tgross35 Apr 18, 2025
a15c8c9
Combine the source files for more generic implementations
tgross35 Apr 18, 2025
014c3e4
ci: Cancel jobs when a new push happens
tgross35 Apr 18, 2025
cad0d6f
ci: Allow skipping extensive tests with `ci: skip-extensive`
tgross35 Apr 18, 2025
a0e5a7a
ci: Require `ci: allow-many-extensive` if a threshold is exceeded
tgross35 Apr 18, 2025
1cb1777
ci: Increase the timeout for extensive tests
tgross35 Apr 18, 2025
2585a57
Ensure configure.rs changes trigger rebuilds
tgross35 Apr 18, 2025
2db05de
ci: Account for `PR_NUMBER` being set to an empty string
tgross35 Apr 18, 2025
8da1290
Ensure all public functions are marked `no_panic`
tgross35 Apr 18, 2025
3cecf22
Combine the source files for `fmod`
tgross35 Apr 18, 2025
88dcaf2
Mark generic functions `#[inline]`
tgross35 Apr 18, 2025
7077daa
refactor: Move the `libm` crate to a subdirectory
tgross35 Apr 9, 2025
3a0b9c9
refactor: Introduce a virtual manifest
tgross35 Apr 9, 2025
cd7c76a
Migrate all crates except `libm` to edition 2024
tgross35 Mar 19, 2025
92b1e84
Rename `testcrate` to `builtins-test`
tgross35 Mar 18, 2025
01c5888
ci: Make CI configuration more similar to `libm`
tgross35 Apr 19, 2025
b0d6024
ci: Update `ci/run-docker.sh` to match libm
tgross35 Apr 19, 2025
1947f32
Remove the libm submodule
tgross35 Apr 18, 2025
e646c73
Merge remote-tracking branch 'libm/merge-into-builtins-prep' into abs…
tgross35 Apr 19, 2025
d794bb3
Update submodules after the `libm` merge
tgross35 Apr 18, 2025
1af955b
Update path to libm after the merge
tgross35 Apr 18, 2025
83a8482
Update .git-blame-ignore-revs after the libm merge
tgross35 Apr 18, 2025
806bb4f
libm: Remove compiler-builtins-smoke-test
tgross35 Apr 19, 2025
911a703
libm: Reorganize into compiler-builtins
tgross35 Apr 19, 2025
8b8bd8a
libm: Flatten the `libm/libm` directory
tgross35 Apr 19, 2025
ca5c4ed
Fix the release-plz job
tgross35 Apr 19, 2025
cab8700
libm: Fix crate compilation
tgross35 Apr 19, 2025
66fa4fd
Add libm and libm-macros to the workspace
tgross35 Apr 19, 2025
569b402
Add a .rustfmt.toml with style edition 2024
tgross35 Apr 19, 2025
8d70be8
Run `cargo fmt` on all projects
tgross35 Apr 19, 2025
98acedc
Remove libm CI dockerfiles
tgross35 Apr 19, 2025
9b8065d
Combine the libm .gitignore
tgross35 Apr 19, 2025
c35cccd
Move the libm .editorconfig to root
tgross35 Apr 19, 2025
a48de69
Move builtins-test-intrinsics out of the workspace
tgross35 Apr 20, 2025
141c7b0
Add remaining `libm` crates to the workspace
tgross35 Apr 20, 2025
0d0d317
Enable icount benchmarks in CI
tgross35 Apr 20, 2025
d02b25f
Fix the libm-test logfile path
tgross35 Apr 20, 2025
9919218
ci: Add a libm MSRV check
tgross35 Apr 20, 2025
d0e0134
ci: Add extensive tests from rust-lang/libm
tgross35 Apr 20, 2025
9c96f24
ci: Enable testing of `libm` crates
tgross35 Apr 20, 2025
22f44df
Set the musl submodule to 61399d4b ("loongarch64: add TLSDESC support")
tgross35 Apr 20, 2025
a829d91
ci: Add `/cargo/bin` to the path in Docker
tgross35 Apr 20, 2025
8902f74
ci: Skip testing libm in PRs if it did not change
tgross35 Apr 20, 2025
ee43137
ci: Add a timeout for all jobs
tgross35 Apr 20, 2025
13bf5f5
ci: Use lowercase for bash locals, fix shellcheck
tgross35 Apr 20, 2025
46bbc3d
ci: Clean up workflow file and docker script
tgross35 Apr 20, 2025
97e4729
ci: Configure release-plz to run semver checks on `libm`
tgross35 Apr 20, 2025
66be06a
ci: Remove the old libm workflow file
tgross35 Apr 20, 2025
4e8eea6
Add panic-handler to the workspace
tgross35 Apr 20, 2025
cf13785
ci: Fix release-plz configuration
tgross35 Apr 20, 2025
97ddaca
Remove `unsafe` from `naked_asm!` blocks
tgross35 Apr 21, 2025
e0d0724
avr: Provide `abort()`
Patryk27 Apr 20, 2025
013a83a
Update licensing information after repository refactoring
tgross35 Apr 21, 2025
8ce02e8
Move README.md to compiler-builtins, CONTRIBUTING.md to root
tgross35 Apr 21, 2025
94448a6
Update README and CONTRIBUTING for the new repository layout
tgross35 Apr 21, 2025
913796c
Fix compiler-builtins publish
tgross35 Apr 21, 2025
13b94cf
ci: Fix extensive tests
tgross35 Apr 22, 2025
a865295
Rename the `public-test-deps` feature to `unstable-public-internals`
tgross35 Apr 22, 2025
e075e9f
Reimplement the generic fmod
quaternic Apr 22, 2025
1fa9d0f
chore: release builtins 0.1.156 and libm 0.2.12
github-actions[bot] Apr 21, 2025
aec649f
chore: Combine CHANGELOG files for compiler-builtins
tgross35 Apr 22, 2025
d30dde7
fix: Switch to resolver v2
tgross35 Apr 22, 2025
5028ecd
chore: Release libm v0.2.13
tgross35 Apr 22, 2025
b6db360
musl: Update submodule
tgross35 Apr 22, 2025
1dd39e2
libm-macros: Start tracking which functions are public
tgross35 Apr 23, 2025
99202af
libm-macros: Allow a way to bulk match f16 and f128 functions
tgross35 Apr 23, 2025
975617e
Warn on `unsafe_op_in_unsafe_fn` by default
tgross35 Mar 19, 2025
8d789ea
Resolve `unnecessary_transmutes` lints
tgross35 Apr 29, 2025
6d83a32
Move `fma` implementations to `mod generic`
tgross35 Apr 29, 2025
caf337d
Refactor the fma modules
tgross35 Apr 29, 2025
4c2659f
builtins-test: Remove `no_mangle` from `eh_personality`
tgross35 May 1, 2025
1c5f8cc
fmaf: Add a test case from a MinGW failure
tgross35 May 2, 2025
2705f68
update-api-list: Match subdirectories within arch
tgross35 May 1, 2025
4a1dc96
Rename the i686 module to x86
tgross35 May 1, 2025
8995ac0
Use runtime feature detection for fma routines on x86
tgross35 Apr 29, 2025
16150eb
chore: release
github-actions[bot] May 3, 2025
5032002
docs: fix typo in Cargo.toml
ELginas Apr 28, 2025
687902c
Replace `super::super` with `crate::support` where possible
tgross35 May 5, 2025
339793d
ci: Mention `ci: skip-extensive` in the error message
tgross35 May 5, 2025
61a14fc
Require `target_has_atomic = "ptr"` for runtime feature detection
tgross35 May 6, 2025
0d63b99
chore: release
github-actions[bot] May 6, 2025
1768cb1
release-plz: Include the libm changelog in compiler-builtins
tgross35 May 6, 2025
c4c7f25
Remove cfg(bootstrap)
Noratrieb May 12, 2025
65663b5
chore(compiler_builtins): release v0.1.159
github-actions[bot] May 12, 2025
d16c82d
Fix `i256::MAX`
TDecking May 8, 2025
abbf8fe
fix an if statement that can be collapsed
folkertdev May 18, 2025
fcb3000
Merge `compiler-builtins` as a Josh subtree
tgross35 May 18, 2025
c801c56
Do not run `rustfmt` on the `compiler-builtins` subtree
tgross35 May 18, 2025
8c15014
triagebot: Add pings and autolabels for the compiler-builtins subtree.
tgross35 May 18, 2025
6acbcee
tidy: Skip pal and `#[test]` checks in compiler-builtins
tgross35 May 18, 2025
d655ff0
clif: Provide better output messages for failed copies
tgross35 May 18, 2025
aff21f6
compiler-builtins: Eliminate symlinks
tgross35 May 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 5 additions & 3 deletions compiler/rustc_codegen_cranelift/build_system/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,13 @@ pub(crate) fn copy_dir_recursively(from: &Path, to: &Path) {
if filename == "." || filename == ".." {
continue;
}
let src = from.join(&filename);
let dst = to.join(&filename);
if entry.metadata().unwrap().is_dir() {
fs::create_dir(to.join(&filename)).unwrap();
copy_dir_recursively(&from.join(&filename), &to.join(&filename));
fs::create_dir(&dst).unwrap_or_else(|e| panic!("failed to create {dst:?}: {e}"));
copy_dir_recursively(&src, &dst);
} else {
fs::copy(from.join(&filename), to.join(&filename)).unwrap();
fs::copy(&src, &dst).unwrap_or_else(|e| panic!("failed to copy {src:?}->{dst:?}: {e}"));
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions library/compiler-builtins/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

[*.yml]
indent_size = 2
6 changes: 6 additions & 0 deletions library/compiler-builtins/.git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Use `git config blame.ignorerevsfile .git-blame-ignore-revs` to make
# `git blame` ignore the following commits.

# Reformat with a new `.rustfmt.toml`
# In rust-lang/libm this was 5882cabb83c30bf7c36023f9a55a80583636b0e8
4bb07a6275cc628ef81c65ac971dc6479963322f
344 changes: 344 additions & 0 deletions library/compiler-builtins/.github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,344 @@
name: CI
on:
push: { branches: [master] }
pull_request:

concurrency:
# Make sure that new pushes cancel running jobs
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
RUSTDOCFLAGS: -Dwarnings
RUSTFLAGS: -Dwarnings
RUST_BACKTRACE: full
BENCHMARK_RUSTC: nightly-2025-01-16 # Pin the toolchain for reproducable results

jobs:
# Determine which tests should be run based on changed files.
calculate_vars:
name: Calculate workflow variables
runs-on: ubuntu-24.04
timeout-minutes: 10
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
outputs:
extensive_matrix: ${{ steps.script.outputs.extensive_matrix }}
may_skip_libm_ci: ${{ steps.script.outputs.may_skip_libm_ci }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 500
- name: Fetch pull request ref
run: git fetch origin "$GITHUB_REF:$GITHUB_REF"
if: github.event_name == 'pull_request'
- run: python3 ci/ci-util.py generate-matrix >> "$GITHUB_OUTPUT"
id: script

test:
name: Build and test
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
os: macos-15
- target: aarch64-unknown-linux-gnu
os: ubuntu-24.04-arm
- target: aarch64-pc-windows-msvc
os: windows-2025
test_verbatim: 1
build_only: 1
- target: arm-unknown-linux-gnueabi
os: ubuntu-24.04
- target: arm-unknown-linux-gnueabihf
os: ubuntu-24.04
- target: armv7-unknown-linux-gnueabihf
os: ubuntu-24.04
- target: i586-unknown-linux-gnu
os: ubuntu-24.04
- target: i686-unknown-linux-gnu
os: ubuntu-24.04
- target: loongarch64-unknown-linux-gnu
os: ubuntu-24.04
- target: powerpc-unknown-linux-gnu
os: ubuntu-24.04
- target: powerpc64-unknown-linux-gnu
os: ubuntu-24.04
- target: powerpc64le-unknown-linux-gnu
os: ubuntu-24.04
- target: riscv64gc-unknown-linux-gnu
os: ubuntu-24.04
- target: thumbv6m-none-eabi
os: ubuntu-24.04
- target: thumbv7em-none-eabi
os: ubuntu-24.04
- target: thumbv7em-none-eabihf
os: ubuntu-24.04
- target: thumbv7m-none-eabi
os: ubuntu-24.04
- target: wasm32-unknown-unknown
os: ubuntu-24.04
- target: x86_64-unknown-linux-gnu
os: ubuntu-24.04
- target: x86_64-apple-darwin
os: macos-13
- target: i686-pc-windows-msvc
os: windows-2025
test_verbatim: 1
- target: x86_64-pc-windows-msvc
os: windows-2025
test_verbatim: 1
- target: i686-pc-windows-gnu
os: windows-2025
channel: nightly-i686-gnu
- target: x86_64-pc-windows-gnu
os: windows-2025
channel: nightly-x86_64-gnu
runs-on: ${{ matrix.os }}
needs: [calculate_vars]
env:
BUILD_ONLY: ${{ matrix.build_only }}
TEST_VERBATIM: ${{ matrix.test_verbatim }}
MAY_SKIP_LIBM_CI: ${{ needs.calculate_vars.outputs.may_skip_libm_ci }}
steps:
- name: Print runner information
run: uname -a
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust (rustup)
shell: bash
run: |
channel="nightly"
# Account for channels that have required components (MinGW)
[ -n "${{ matrix.channel }}" ] && channel="${{ matrix.channel }}"
rustup update "$channel" --no-self-update
rustup default "$channel"
rustup target add "${{ matrix.target }}"
rustup component add llvm-tools-preview
- uses: taiki-e/install-action@nextest
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Cache Docker layers
uses: actions/cache@v4
if: matrix.os == 'ubuntu-24.04'
with:
path: /tmp/.buildx-cache
key: ${{ matrix.target }}-buildx-${{ github.sha }}
restore-keys: ${{ matrix.target }}-buildx-
# Configure buildx to use Docker layer caching
- uses: docker/setup-buildx-action@v3
if: matrix.os == 'ubuntu-24.04'

- name: Cache compiler-rt
id: cache-compiler-rt
uses: actions/cache@v4
with:
path: compiler-rt
key: ${{ runner.os }}-compiler-rt-${{ hashFiles('ci/download-compiler-rt.sh') }}
- name: Download compiler-rt reference sources
if: steps.cache-compiler-rt.outputs.cache-hit != 'true'
run: ./ci/download-compiler-rt.sh
shell: bash
- run: echo "RUST_COMPILER_RT_ROOT=$(realpath ./compiler-rt)" >> "$GITHUB_ENV"
shell: bash

- name: Verify API list
if: matrix.os == 'ubuntu-24.04'
run: python3 etc/update-api-list.py --check

# Non-linux tests just use our raw script
- name: Run locally
if: matrix.os != 'ubuntu-24.04'
shell: bash
run: ./ci/run.sh ${{ matrix.target }}

# Otherwise we use our docker containers to run builds
- name: Run in Docker
if: matrix.os == 'ubuntu-24.04'
run: ./ci/run-docker.sh ${{ matrix.target }}

- name: Print test logs if available
if: always()
run: if [ -f "target/test-log.txt" ]; then cat target/test-log.txt; fi
shell: bash

# Workaround to keep Docker cache smaller
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move Docker cache
if: matrix.os == 'ubuntu-24.04'
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

clippy:
name: Clippy
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
submodules: true
# Unlike rustfmt, stable clippy does not work on code with nightly features.
- name: Install nightly `clippy`
run: |
rustup set profile minimal
rustup default nightly
rustup component add clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace --all-targets

benchmarks:
name: Benchmarks
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@master
with:
submodules: true
- uses: taiki-e/install-action@cargo-binstall

- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install -y valgrind gdb libc6-dbg # Needed for iai-callgrind
rustup update "$BENCHMARK_RUSTC" --no-self-update
rustup default "$BENCHMARK_RUSTC"
# Install the version of iai-callgrind-runner that is specified in Cargo.toml
iai_version="$(cargo metadata --format-version=1 --features icount |
jq -r '.packages[] | select(.name == "iai-callgrind").version')"
cargo binstall -y iai-callgrind-runner --version "$iai_version"
sudo apt-get install valgrind
- uses: Swatinem/rust-cache@v2

- name: Run icount benchmarks
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: ./ci/bench-icount.sh

- name: Upload the benchmark baseline
uses: actions/upload-artifact@v4
with:
name: ${{ env.BASELINE_NAME }}
path: ${{ env.BASELINE_NAME }}.tar.xz

- name: Run wall time benchmarks
run: |
# Always use the same seed for benchmarks. Ideally we should switch to a
# non-random generator.
export LIBM_SEED=benchesbenchesbenchesbencheswoo!
cargo bench --package libm-test \
--no-default-features \
--features short-benchmarks,build-musl,libm/force-soft-floats

- name: Print test logs if available
if: always()
run: if [ -f "target/test-log.txt" ]; then cat target/test-log.txt; fi
shell: bash

miri:
name: Miri
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust (rustup)
run: rustup update nightly --no-self-update && rustup default nightly
shell: bash
- run: rustup component add miri
- run: cargo miri setup
- uses: Swatinem/rust-cache@v2
- run: ./ci/miri.sh

msrv:
name: Check libm MSRV
runs-on: ubuntu-24.04
timeout-minutes: 10
env:
RUSTFLAGS: # No need to check warnings on old MSRV, unset `-Dwarnings`
steps:
- uses: actions/checkout@master
- name: Install Rust
run: |
msrv="$(perl -ne 'print if s/rust-version\s*=\s*"(.*)"/\1/g' libm/Cargo.toml)"
echo "MSRV: $msrv"
rustup update "$msrv" --no-self-update && rustup default "$msrv"
- uses: Swatinem/rust-cache@v2
- run: |
# FIXME(msrv): Remove the workspace Cargo.toml so 1.63 cargo doesn't see
# `edition = "2024"` and get spooked.
rm Cargo.toml
cargo build --manifest-path libm/Cargo.toml

rustfmt:
name: Rustfmt
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install stable `rustfmt`
run: rustup set profile minimal && rustup default stable && rustup component add rustfmt
- run: cargo fmt -- --check

extensive:
name: Extensive tests for ${{ matrix.ty }}
needs:
# Wait on `clippy` so we have some confidence that the crate will build
- clippy
- calculate_vars
runs-on: ubuntu-24.04
timeout-minutes: 240 # 4 hours
strategy:
matrix:
# Use the output from `calculate_vars` to create the matrix
# FIXME: it would be better to run all jobs (i.e. all types) but mark those that
# didn't change as skipped, rather than completely excluding the job. However,
# this is not currently possible https://github.com/actions/runner/issues/1985.
include: ${{ fromJSON(needs.calculate_vars.outputs.extensive_matrix).extensive_matrix }}
env:
TO_TEST: ${{ matrix.to_test }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust
run: |
rustup update nightly --no-self-update
rustup default nightly
- uses: Swatinem/rust-cache@v2
- name: Run extensive tests
run: ./ci/run-extensive.sh
- name: Print test logs if available
run: if [ -f "target/test-log.txt" ]; then cat target/test-log.txt; fi
shell: bash

success:
needs:
- benchmarks
- clippy
- extensive
- miri
- msrv
- rustfmt
- test
runs-on: ubuntu-24.04
timeout-minutes: 10
# GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
# dependencies fails.
if: always() # make sure this is never "skipped"
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: check if any dependency failed
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
Loading
Loading