199 Commits

Author SHA1 Message Date
Trevor Gross
f5c9403551 Upgrade iai-callgrind to 0.15
Pick up the latest version of iai-callgrind, which includes some output
improvements.

Changelog: https://github.com/iai-callgrind/iai-callgrind/releases
2025-07-10 18:47:26 -04:00
Trevor Gross
e164811f5d symcheck: Make target a positional argument
This makes it more obvious what we intend to check rather than looking
for `--target`.
2025-07-04 17:44:54 -05:00
Trevor Gross
b5fafd9816 ci: Fix a typo that was causing a command failure 2025-06-10 07:02:57 +00:00
Trevor Gross
e1e3cc24a2 Replace the musl submodule with a download script
The submodule was causing issues in rust-lang/rust, so eliminiate it
here. `build-musl` is also removed from `libm-test`'s default features
so the crate doesn't need to be built by default.
2025-06-04 17:20:43 +00:00
Trevor Gross
ba7cdb6814 ci: Refactor benchmark regression checks
iai-callgrind now correctly exits with error if regressions were found
[1], so we no longer need to check for regressions manually. Remove this
check and instead exit based on the exit status of the benchmark run.

[1] https://github.com/iai-callgrind/iai-callgrind/issues/337
2025-06-02 21:29:46 +00:00
Trevor Gross
4d325e8b2c ci: Allow for multiple icount benchmarks in the same run
We don't actually need this for now, but eventually it would be nice to
run icount benchmarks on multiple targets. Start tagging artifact names
with the architecture, and allow passing `--tag` to `ci-util.py` in
order to retrieve the correct one.
2025-05-29 21:58:21 +00:00
Trevor Gross
c136fb7734 Run builtins-test-intrinsics when possible
Currently we only build this, but it is possible to run the binary.
Change the CI script to do so here.
2025-05-29 18:46:06 +00:00
Trevor Gross
a63f4826cf Replace the nm symbol check with a Rust implementation
This should be less error-prone and adaptable than the `nm` version, and
have better cross-platform support without needing LLVM `nm` installed.
2025-05-29 15:38:10 +00:00
Trevor Gross
339793d62b ci: Mention ci: skip-extensive in the error message 2025-05-05 02:31: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
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
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
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
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
b0d6024f20 ci: Update ci/run-docker.sh to match libm
Prepare for having the repositories combined by ensuring EMULATED,
RUST_BACKTRACE, and CI are set or forwarded as applicable. Also
re-indent the file to four spaces and do some reorganization.
2025-04-19 01:04:33 -04:00
Trevor Gross
01c5888246 ci: Make CI configuration more similar to libm
Apply a handful of changes to reduce the diff between the two:

* Cancel running jobs on new pushes
* Enable log color and backtraces
* Add timeouts
* Specify CI runner versions
* Add an armv7 job
* Replace the name NO_STD with BUILD_ONLY
* Update the extension to the canonical .yaml
* Set AR_ and CC_ environments in docker
* Install requirements to build MPFR
2025-04-18 23:49:29 -04:00
Trevor Gross
92b1e8454d Rename testcrate to builtins-test
The repo will soon have `libm` as a top-level crate, so make it clear
that this is only the test crate for `compiler-builtins`.
2025-04-18 21:14:41 -04:00
Ralf Jung
5cf993880a
copy_misaligned_words: avoid out-of-bounds accesses (#799)
* copy_misaligned_words: avoid out-of-bounds accesses
* add test to make Miri able to detect OOB in memmove
* run Miri on CI
2025-03-22 05:36:40 +00:00
Trevor Gross
683485cda2 Switch repository layout to use a virtual manifest
The current setup has the `Cargo.toml` for `compiler-builtins` at the
repository root, which means all support crates and other files are
located within the package root. This works for now but is not the
cleanest setup since files that should or shouldn't be included in the
package need to be configured in `Cargo.toml`. If we eventually merge
`libm` development into this repository, it would be nice to make this
separation more straightforward.

Begin cleaning things up by moving the crate source to a new
`compiler-builtins` directory and adding a virtual manifest. For now the
`libm` submodule is also moved, but in the future it can likely move
back to the top level (ideally `compiler-builtins/src` would contain a
symlink to `libm/src/math`, but unfortunately it seems like Cargo does
not like something about the submodule + symlink combination).
2025-03-19 00:49:34 -05:00
Trevor Gross
f8b03df54e Add a script for downloading compiler-rt
Rather than needing to copy the version and URL from the CI workflow,
put this into a script that can be directly run locally.
2025-03-18 06:23:30 -05:00
Trevor Gross
a179959e0b Move examples/intrinsics.rs to its own crate
Currently there is an interesting situation with the way features get
enabled; `testcrate` enables `mangled-names`, but the `intrinsics.rs`
example requires this feature be disabled (otherwise the test fails with
missing symbols, as expected). This is also the reason that `testcrate`
is not a default workspace member, meaning `cargo test` doesn't actually
run `testcrate`'s tests; making it a default member would mean that
`compiler-builtins/mangled-names` gets enabled when
`examples/intrinsics.rs` gets built, due to the way features get
unified.

Simplify the situation by making moving the example to its own crate as
`builtins-test-intrinsics`. This also means `testcrate` can become a
default member so it is included in `cargo check` or `cargo test` when
run at the workspace root.

`testcrate` and `builtins-test-intrinsics` still can't be built at the
same time since there isn't a straightforward way to have Cargo build
`compiler-builtins` twice with different features. This is a side effect
of us using non-additive features, but there isn't really a better
option since enabling both mangled and unmangled names would render
`builtins-test-intrinsics` useless.
2025-03-18 05:35:19 -05:00
WANG Rui
ec673535f7 ci: add support for loongarch64-unknown-linux-gnu 2024-11-01 05:48:47 -05:00
Trevor Gross
0c97b10dc0 Add riscv64gc to CI
There is a proposal to promote `riscv64gc-unknown-linux-gnu` to tier 1
[1]. We do not currently test RISC-V in CI; add it here.

[1]: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Imminent.20RFC.20PR.3A.20riscv64gc-unknown-linux-gnu.20to.20Tier-1
2024-10-02 16:35:28 -04:00
Trevor Gross
85cd4c0660 Fix some warnings from shellcheck 2024-09-28 21:24:44 -04:00
Trevor Gross
fdec3b6514 Fix unset variables in the build script
These were preventing building via Docker locally.
2024-06-22 16:15:46 +02:00
Trevor Gross
f2092967cb Update the Ubuntu docker image to the latest version 2024-06-22 05:58:25 -04:00
Trevor Gross
98ddf3c66d Enable cache for Docker images 2024-05-24 23:18:59 +02:00
Trevor Gross
6cd17ff4d2 Add benchmarks for floating point math
This adds comparisons among the compiler-builtins function, system
functions if available, and optionally handwritten assembly.

These also help us identify inconsistencies between this crate and
system functions, which may otherwise go unnoticed if intrinsics get
lowered to inline operations rather than library calls.
2024-05-24 02:49:41 -04:00
Henry Wang
7d60c93165 Only run --features c for verbatim test 2024-05-21 01:09:47 +02:00
theKidOfArcrania
416be726df verbatim tests only need to build 2024-05-21 01:09:47 +02:00
theKidOfArcrania
fd290b1339 Properly escape /C and fix naming 2024-05-21 01:09:47 +02:00
theKidOfArcrania
e3d86a8350 Instead have cmd.exe dump out path 2024-05-21 01:09:47 +02:00
theKidOfArcrania
0000f98d73 Fix backslash 2024-05-21 01:09:47 +02:00
theKidOfArcrania
e246ba5a46 Use cmd.exe 2024-05-21 01:09:47 +02:00
theKidOfArcrania
24cb0c2bcc Fix CI 2024-05-21 01:09:47 +02:00
theKidOfArcrania
3fdef93258 Add tests for UNC paths on windows builds 2024-05-21 01:09:47 +02:00
Trevor Gross
4509315d2f Enable no-fail-fast for more usable test output 2024-05-15 07:19:17 -05:00
Trevor Gross
ccfe0e3808 Deny warnings in CI
There are currently a lot of warnings printed in CI, mostly dead code.
Update CI to deny warnings.
2024-05-11 09:56:55 +02:00
beetrees
229babb1d0 Add builtins for f16/f128 float conversions 2024-05-02 13:49:24 +02:00
Trevor Gross
1b679e5cee Apply some more fixes suggested by Shellcheck 2024-04-19 11:49:23 -04:00
Trevor Gross
a55604fd8c Add a way to run tests on non-linux machines
Allow using the `rust-lang/rust:nightly` docker image to run tests in
cases where the host rust and cargo cannot be used, such as non-linux
hosts.
2024-04-19 11:49:23 -04:00
trevyn
dc1321a5ca Remove duplicate symbol workaround 2024-03-28 14:19:13 +00:00
Amanieu d'Antras
68b5a7a0ad Clean up and rework CI script 2024-03-28 10:17:42 +00:00
trevyn
0808cdeb67 build: Allow building C compiler-rt fallbacks for wasm 2024-01-09 02:11:00 +04:00
Amanieu d'Antras
c51299d63a Fix run-docker.sh so it can be run locally 2022-02-06 09:20:19 +00:00
Joseph Richey
5c294cedc0
Move from an "asm" flag to a "no-asm" feature flag (#386)
* Use a no-asm feature instead of an asm feature

This works better as core/alloc/std have trouble supporting default
featues in this crate.

Signed-off-by: Joe Richey <joerichey@google.com>

* Have no-asm disable arm assembly intrinsics

Signed-off-by: Joe Richey <joerichey@google.com>
2020-11-09 09:24:25 -06:00