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

Reorganize the CPU feature detection #3195

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

antoyo
Copy link
Contributor

@antoyo antoyo commented Oct 11, 2024

Move the code from i386-rust.cc to i386-rust-and-jit.inc so that it can be reused by libgccjit.

gcc/ChangeLog:

* config/i386/i386-rust-and-jit.inc: New file.
* config/i386/i386-rust.cc: Move code to i386-rust-and-jit.inc.

Here is a checklist to help you with your PR.

  • GCC development requires copyright assignment or the Developer's Certificate of Origin sign-off, see https://gcc.gnu.org/contribute.html or https://gcc.gnu.org/dco.html
  • Read contributing guidlines
  • make check-rust passes locally (it doesn't pass, but same number of failures as on master)
  • Run clang-format
  • (n/a) [ ] Added any relevant test cases to gcc/testsuite/rust/

Since both libgccjit (via rustc_codegen_gcc) and gccrs need to do the same CPU features detection, refactor this code to avoid duplication.

Move the code from i386-rust.cc to i386-rust-and-jit.inc so that it can
be reused by libgccjit.

gcc/ChangeLog:

	* config/i386/i386-rust-and-jit.inc: New file.
	* config/i386/i386-rust.cc: Move code to i386-rust-and-jit.inc.
@antoyo
Copy link
Contributor Author

antoyo commented Oct 11, 2024

As discussed with you, @CohenArthur, here's the PR that will allow us to not have duplication for the CPU features detection.

Some more context on the mailing list.

I already tested this in rustc_codegen_gcc: you can see the libgccjit commit here.

Test results:

		=== rust Summary ===

# of expected passes		9158
# of expected failures		315
# of unsupported tests		8

(same on the master branch)

@antoyo
Copy link
Contributor Author

antoyo commented Oct 11, 2024

cc @davidmalcolm: Is this what you had in mind?

@P-E-P P-E-P requested a review from CohenArthur October 27, 2024 12:46
Copy link
Member

@CohenArthur CohenArthur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good to me @antoyo, thank you for working on this!!

@CohenArthur
Copy link
Member

Waiting for David's opinion but happy to merge this

@davidmalcolm
Copy link
Contributor

cc @davidmalcolm: Is this what you had in mind?

Yes; this looks great; thank you.

@CohenArthur
Copy link
Member

Note that we might want to merge this once stage1 opens again @antoyo, as these aren't changes to gcc/rust/ and might require GCC maintainer approval. Or we can ask if we're free to upstream this on IRC

@davidmalcolm
Copy link
Contributor

@CohenArthur Given the "rust" and "jit" in the file names I think these patches can be approved by rust and jit maintainers. Given that you are the former and I'm the latter (and yes, I do approve the patch), I think you're good to go - but it should be posted to gcc-patches.

@antoyo
Copy link
Contributor Author

antoyo commented Nov 4, 2024

@CohenArthur: I thought we were in stage 1 until November 18?

@CohenArthur
Copy link
Member

@CohenArthur: I thought we were in stage 1 until November 18?

Yes, but that is only in 14 days - given how long it usually takes to get reviews and considering that reviewers will be pretty busy until that day, I consider it a bit late. However, as David said, we're probably maintainers of our config files for our respective frontends, so I'm happy to push this as part of our upstreaming process and post the patch upstream

@CohenArthur CohenArthur added this pull request to the merge queue Nov 5, 2024
Merged via the queue into Rust-GCC:master with commit 9bcd87f Nov 5, 2024
12 checks passed
@antoyo
Copy link
Contributor Author

antoyo commented Nov 5, 2024

Thanks @CohenArthur! Could you please CC me when you post this on the mailing list?

@CohenArthur
Copy link
Member

Yes will do @antoyo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants