Skip to content
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

vectorcall ABI: require SSE2 #137225

Merged
merged 2 commits into from
Feb 23, 2025
Merged

vectorcall ABI: require SSE2 #137225

merged 2 commits into from
Feb 23, 2025

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Feb 18, 2025

According to the official docs at https://learn.microsoft.com/en-us/cpp/cpp/vectorcall, SSE2 is required for this ABI. Add a check that enforces this.

I put this together with the other checks ensuring the target features required for a function are present... however, since the ABI is known pre-monomorphization, it would be possible to do this check earlier, which would have the advantage of checking even in cargo check. It would have the disadvantage of spreading this code in yet more places.

The first commit just does a little refactoring of the mono-time ABI check to make it easier to add the new check.

Cc @workingjubilee

try-job: dist-i586-gnu-i586-i686-musl

@rustbot
Copy link
Collaborator

rustbot commented Feb 18, 2025

r? @nnethercote

rustbot has assigned @nnethercote.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 18, 2025
@nnethercote
Copy link
Contributor

The code looks good at a nuts-and-bolts level, modulo the is_call naming nits.

I don't know anything about when the check should occur, or other such higher level things, so I will pass the baton for that:

r? @workingjubilee

@rustbot
Copy link
Collaborator

rustbot commented Feb 19, 2025

Could not assign reviewer from: workingjubilee.
User(s) workingjubilee are either the PR author, already assigned, or on vacation. Please use r? to specify someone else to assign.

@nnethercote
Copy link
Contributor

Could not assign reviewer from: workingjubilee.

Eh, putting the checks next to existing checks seems good enough. Moving it earlier can be possible future work. r=me with the nits fixed.

@RalfJung
Copy link
Member Author

@bors r=nnethercote

@bors
Copy link
Contributor

bors commented Feb 19, 2025

📌 Commit cd9b5c1 has been approved by nnethercote

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 19, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 19, 2025
vectorcall ABI: require SSE2

According to the official docs at https://learn.microsoft.com/en-us/cpp/cpp/vectorcall, SSE2 is required for this ABI. Add a check that enforces this.

I put this together with the other checks ensuring the target features required for a function are present... however, since the ABI is known pre-monomorphization, it would be possible to do this check earlier, which would have the advantage of checking even in `cargo check`. It would have the disadvantage of spreading this code in yet more places.

The first commit just does a little refactoring of the mono-time ABI check to make it easier to add the new check.

Cc `@workingjubilee`
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 19, 2025
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#120580 (Add `MAX_LEN_UTF8` and `MAX_LEN_UTF16` Constants)
 - rust-lang#132268 (Impl TryFrom<Vec<u8>> for String)
 - rust-lang#136093 (Match Ergonomics 2024: update old-edition behavior of feature gates)
 - rust-lang#136344 (Suggest replacing `.` with `::` in more error diagnostics.)
 - rust-lang#136690 (Use more explicit and reliable ptr select in sort impls)
 - rust-lang#136815 (CI: Stop /msys64/bin from being prepended to PATH in msys2 shell)
 - rust-lang#136923 (Lint `#[must_use]` attributes applied to methods in trait impls)
 - rust-lang#137155 (Organize `OsString`/`OsStr` shims)
 - rust-lang#137225 (vectorcall ABI: require SSE2)

Failed merges:

 - rust-lang#136780 (std: move stdio to `sys`)

r? `@ghost`
`@rustbot` modify labels: rollup
@matthiaskrgr
Copy link
Member

@bors r-
#137283 (comment)

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 19, 2025
@RalfJung
Copy link
Member Author

@bors rollup=never
ABI stuff is never that easy...

@RalfJung
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Feb 20, 2025

🔒 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 self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout vectorcall (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self vectorcall --force-with-lease (update this PR)

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 git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
CONFLICT (rename/rename): Rename "tests/ui/sse-abi-checks.stderr"->"tests/ui/sse-simd-abi-checks.stderr" in branch "HEAD" rename "tests/ui/sse-abi-checks.stderr"->"tests/ui/abi/sse-abi-checks.stderr" in "heads/homu-tmp"
CONFLICT (rename/rename): Rename "tests/ui/sse-abi-checks.rs"->"tests/ui/sse-simd-abi-checks.rs" in branch "HEAD" rename "tests/ui/sse-abi-checks.rs"->"tests/ui/abi/sse-abi-checks.rs" in "heads/homu-tmp"
Auto-merging tests/ui/sse-simd-abi-checks.rs and tests/ui/abi/sse-abi-checks.rs, both renamed from tests/ui/sse-abi-checks.rs
Auto-merging compiler/rustc_monomorphize/src/mono_checks/abi_check.rs
Automatic merge failed; fix conflicts and then commit the result.

also move the existing tests to a more sensible location
@rust-log-analyzer

This comment has been minimized.

@RalfJung
Copy link
Member Author

@bors r=nnethercote

@bors
Copy link
Contributor

bors commented Feb 20, 2025

📌 Commit 83fd16f has been approved by nnethercote

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 20, 2025
@bors
Copy link
Contributor

bors commented Feb 23, 2025

⌛ Testing commit 83fd16f with merge b522e7c...

@bors
Copy link
Contributor

bors commented Feb 23, 2025

☀️ Test successful - checks-actions
Approved by: nnethercote
Pushing b522e7c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 23, 2025
@bors bors merged commit b522e7c into rust-lang:master Feb 23, 2025
7 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Feb 23, 2025
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b522e7c): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (secondary 2.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.4% [2.2%, 3.1%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 772.144s -> 770.364s (-0.23%)
Artifact size: 359.81 MiB -> 359.79 MiB (-0.01%)

@RalfJung RalfJung deleted the vectorcall branch February 24, 2025 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants