Reorganize the CPU feature detection
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.
- [x] 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
- [x] Read contributing guidlines
- [ ]
make check-rustpasses locally (it doesn't pass, but same number of failures as onmaster) - [x] 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.
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)
cc @davidmalcolm: Is this what you had in mind?
Waiting for David's opinion but happy to merge this
cc @davidmalcolm: Is this what you had in mind?
Yes; this looks great; thank you.
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
@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.
@CohenArthur: I thought we were in stage 1 until November 18?
@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
Thanks @CohenArthur! Could you please CC me when you post this on the mailing list?
Yes will do @antoyo!