-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Rollup of 9 pull requests #128767
Rollup of 9 pull requests #128767
Conversation
Since LLVM <https://reviews.llvm.org/D99439> (4c7f820, "Update @llvm.powi to handle different int sizes for the exponent"), the size of the integer can be specified for the `powi` intrinsic. Make use of this so it is more obvious that integer size is consistent across all float types. This feature is available since LLVM 13 (October 2021). Based on bootstrap we currently support >= 17.0, so there should be no support problems.
These already exist in the compiler. Expose them in core so we can add their library functions.
This adds missing functions for math operations on the new float types. Platform support is pretty spotty at this point, since even platforms with generally good support can be missing math functions. `std/build.rs` is updated to reflect this.
`min`, `max`, and similar functions require external math routines. Add these under the same gates as `std` math functions (`reliable_f16_math` and `reliable_f128_math`).
Clarify what makes some operations not safe, and correct comment in the default branch ("not safe" -> "safe").
Due to a LLVM bug, `f128` math functions link successfully but LLVM chooses the wrong symbols (`long double` symbols rather than those for binary128). Since this is a notable problem that may surprise a number of users, add a note about it. Link: llvm/llvm-project#44744
This is simply a matter of using the right argument for lld-link.
…res, r=Amanieu Add implied target features to target_feature attribute See [zulip](https://rust-lang.zulipchat.com/#narrow/stream/208962-t-libs.2Fstdarch/topic/Why.20would.20target-feature.20include.20implied.20features.3F) for some context. Adds implied target features, e.g. `#[target_feature(enable = "avx2")]` acts like `#[target_feature(enable = "avx2,avx,sse4.2,sse4.1...")]`. Fixes rust-lang#128125, fixes rust-lang#128426 The implied feature sets are taken from [the rust reference](https://doc.rust-lang.org/reference/attributes/codegen.html?highlight=target-fea#x86-or-x86_64), there are certainly more features and targets to add. Please feel free to reassign this to whoever should review it. r? ``@Amanieu``
…isibility, r=bjorn3 add test for symbol visibility of `#[naked]` functions tracking issue: rust-lang#90957 This test is extracted from rust-lang#128004 That PR attempts to generated naked functions as an extern function declaration, combined with a global asm block that provides the implementation for that declaration. In order to link declaration and definition together, some flavor of external linking must be used: LLVM will error for other linkage types. Specifically the allowed options are `#[linkage = "external"]` and `#[linkage = "extern_weak"]`. That is kind of an implementation detail though: to the user, a naked function should just behave like a normal function. Hence it should be visible to the linker under the same circumstances as a normal, vanilla function and have the same attributes (Weak, External). Getting this behavior right will require some care, so I think it's a good idea to lock it in now, before making any changes, to make sure we don't regress. Are there any interesting cases that I missed here? E.g. is checking on different architectures worth it? I don't think the other binary types (rlib etc) are relevant here, but may be missing something. r? `@bjorn3`
Add `f16` and `f128` math functions This adds intrinsics and math functions for `f16` and `f128` floating point types. Support is quite limited and some things are broken so tests don't run on many platforms, but this provides a starting point.
run-make: enable msvc for `link-dedup` This is just a case of differing style of linker arguments. I also cleaned up a bit where we were running the same command three times in a row. Instead I reused the output. One thing that confused me is why we were testing for the same lib three times in a row but not two. After figuring that out I added a note to hopefully save future readers some confusion. try-job: x86_64-msvc try-job: i686-msvc
…youxu Enable msvc for link-args-order I could not see any reason in rust-lang#70665 why this test needs to specifically use `ld`. Maybe to provide a consistent linker input line? In any case, the test does work for the MSVC linker. try-job: i686-msvc try-job: x86_64-msvc
run-make: Enable msvc for `no-duplicate-libs` and `zero-extend-abi-param-passing` The common thing between these two tests is to use `#[link(..., kind="static")]` so that it doesn't try to do a DLL import. `zero-extend-abi-param-passing` also needs to have an optimized static library but there's only helper function for a non-optimized version. Rather than copy/pasting the code (and adding the optimization flag) I reused the same code so that it more easily be kept in sync. try-job: i686-msvc try-job: x86_64-msvc
Enable msvc for run-make/rust-lld This is simply a matter of using the right argument for lld-link. As a bonus, I also fixed a typo. try-job: i686-msvc try-job: x86_64-msvc
…e-simdple, r=jieyouxu Migrate `simd-ffi` `run-make` test to rmake Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). try-job: x86_64-msvc try-job: x86_64-mingw try-job: i686-msvc try-job: armhf-gnu try-job: test-various try-job: aarch64-apple try-job: x86_64-gnu-llvm-17
@bors r+ rollup=never p=9 |
🔒 Merge conflict This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again. How do I rebase?Assuming
You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial. Please avoid the "Resolve conflicts" button on GitHub. It uses Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Error message
|
@bors r- retry |
☔ The latest upstream changes (presumably #128761) made this pull request unmergeable. Please resolve the merge conflicts. |
Successful merges:
raw-dylib-alt-calling-convention
,raw-dylib-c
andredundant-libs
run-make
tests to rmake #128107 (Migrateraw-dylib-alt-calling-convention
,raw-dylib-c
andredundant-libs
run-make
tests to rmake)#[naked]
functions #128362 (add test for symbol visibility of#[naked]
functions)f16
andf128
math functions #128417 (Addf16
andf128
math functions)link-dedup
#128638 (run-make: enable msvc forlink-dedup
)no-duplicate-libs
andzero-extend-abi-param-passing
#128649 (run-make: Enable msvc forno-duplicate-libs
andzero-extend-abi-param-passing
)simd-ffi
run-make
test to rmake #128700 (Migratesimd-ffi
run-make
test to rmake)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup