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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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?

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.

1 participant