about summary refs log tree commit diff
path: root/library/compiler-builtins/builtins-test
AgeCommit message (Collapse)AuthorLines
2025-08-09Add __addhf3, __subhf3, __mulhf3, __{eq,ge,gt,le,lt,ne,unord}hf2Trevor Gross-14/+39
LLVM does not currently emit these, but it is being discussed as an option on platforms where `f32` is not hardware supported. Glibc/libgcc also has the comparison functions [1] already. The generic implementations for addition, subtraction, and multiplication work for f16 without any complications, as do comparisons, so add them here. [1]: https://sourceware.org/git/?p=glibc.git;a=commit;h=6ec6c77867af4ddfec7323e0ac6ede89effca852
2025-08-07Remove instances of `allow(improper_ctypes)`Trevor Gross-1/+0
i128/u128 haven't flagged `improper_ctypes` for a while, and this just made it to stable [1]. Remove the `allow`s as they are no longer needed. [1]: https://blog.rust-lang.org/2025/08/07/Rust-1.89.0/#i128-and-u128-in-extern-c-functions
2025-07-27Remove `no-asm` gating when there is no alternative implementationTrevor Gross-1/+1
Assembly-related configuration was added in 1621c6dbf9eb ("Use `specialized-div-rem` 1.0.0 for division algorithms") to account for Cranelift not yet supporting assembly. This hasn't been relevant for a while, so we no longer need to gate `asm!` behind this configuration. Thus, remove `cfg(not(feature = "no-asm"))` in places where there is no generic fallback. There are other cases, however, where setting the `no-asm` configuration enables testing of generic version of builtins when there are platform- specific implementations available; these cases are left unchanged. This could be improved in the future by exposing both versions for testing rather than using a configuration and running the entire testsuite twice. This is the compiler-builtins portion of https://github.com/rust-lang/rust/pull/144471.
2025-07-24Use `x86_no_sse` configuration in more placesTrevor Gross-9/+8
Emit `x86_no_sse` in the compiler-builtins (and builtins-test) build script, and use it to simplify `all(target_arch = "x86", not(target_fefature = "sse))` configuration.
2025-07-24Enable skipped `f32` and `f64` multiplication testsTrevor Gross-4/+0
The fix has since made it to nightly, so the skips here can be removed.
2025-07-24Enable tests that were skipped on aarch64Trevor Gross-9/+0
The LLVM issue was resolved a while ago, these should no longer be a problem.
2025-07-24Enable tests that were skipped on PowerPCTrevor Gross-48/+17
Most of these were skipped because of a bug with the platform implementation, or some kind of crash unwinding. Since the upgrade to Ubuntu 25.04, these all seem to be resolved with the exception of a bug in the host `__floatundisf` [1]. [1] https://github.com/rust-lang/compiler-builtins/pull/384#issuecomment-740413334
2025-07-10Upgrade `iai-callgrind` to 0.15Trevor Gross-1/+1
Pick up the latest version of iai-callgrind, which includes some output improvements. Changelog: https://github.com/iai-callgrind/iai-callgrind/releases
2025-07-10Upgrade dependencies to the latest versionTrevor Gross-1/+1
This picks up a fix in `rustc_apfloat` [1] that resolves a problem with `fma`. [1]: https://github.com/rust-lang/rustc_apfloat/releases/tag/rustc_apfloat-v0.2.3%2Bllvm-462a31f5a5ab
2025-07-02Use the compiler to determine whether or not to enable `f16` and `f128`Trevor Gross-5/+6
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-06-14Work around out-of-tree testing with a shim crateTrevor Gross-1/+1
Out-of-tree testing is broken with the most recent update from rust-lang/rust because it makes `compiler-builtins` depend on `core` by path, which isn't usually available. In order to enable testing outside of rust-lang/rust, add a new crate `builtins-shim` that uses the same source as `compiler-builtins` but drops the `core` dependency. This has replaced `compiler-builtins` as the workspace member and entrypoint for tests.
2025-06-13Eliminate `build.rs`-generated Aarch64 atomic macros (#951)qinghon-1/+2
Replace `build.rs` Rust generation with macros, using the unstable `${concat(...)}`. Fixes: https://github.com/rust-lang/compiler-builtins/issues/947
2025-06-01Upgrade all dependencies to the latest available versionTrevor Gross-4/+4
In particular, this includes a fix to `iai-callgrind` that will allow us to simplify our benchmark runner.
2025-05-29Change `compiler-builtins` to edition 2024Trevor Gross-3/+6
Do the same for `builtins-test-intrinsics`. Mostly this means updating `extern` to `unsafe extern`, and fixing a few new Clippy lints.
2025-05-29cleanup: Reuse `MinInt` and `Int` from `libm` in `compiler-builtins`Trevor Gross-5/+73
Since the two crates are now in the same repo, it is easier to share code. Begin some deduplication with the integer traits.
2025-05-28Update `CmpResult` to use a pointer-sized return typeTrevor Gross-18/+29
As seen at [1], LLVM uses `long long` on LLP64 (to get a 64-bit integer matching pointer size) and `long` on everything else, with exceptions for AArch64 and AVR. Our current logic always uses an `i32`. This happens to work because LLVM uses 32-bit instructions to check the output on x86-64, but the GCC checks the full 64-bit register so garbage in the upper half leads to incorrect results. Update our return type to be `isize`, with exceptions for AArch64 and AVR. Fixes: https://github.com/rust-lang/compiler-builtins/issues/919 [1]: https://github.com/llvm/llvm-project/blob/0cf3c437c18ed27d9663d87804a9a15ff6874af2/compiler-rt/lib/builtins/fp_compare_impl.inc#L11-L27
2025-05-21Enable `__powitf2` on MSVCbeetrees-2/+0
2025-04-29Resolve `unnecessary_transmutes` lintsTrevor Gross-32/+20
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-21Rename the `public-test-deps` feature to `unstable-public-internals`Trevor Gross-1/+1
`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-21Update licensing information after repository refactoringTrevor Gross-0/+1
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-19Move builtins-test-intrinsics out of the workspaceTrevor Gross-4/+0
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-19Run `cargo fmt` on all projectsTrevor Gross-8/+5
Apply the same formatting rules to both `libm` and `compiler-builtins`.
2025-04-18Rename `testcrate` to `builtins-test`Trevor Gross-0/+5601
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`.