-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add a notion of "some ABIs require certain target features" #134794
base: master
Are you sure you want to change the base?
Conversation
Could not assign reviewer from: |
r? @davidtwco rustbot has assigned @davidtwco. Use |
These commits modify compiler targets. Some changes occurred in compiler/rustc_codegen_gcc |
This comment has been minimized.
This comment has been minimized.
79f8de2
to
849fb06
Compare
This comment has been minimized.
This comment has been minimized.
849fb06
to
a25cfb0
Compare
This comment has been minimized.
This comment has been minimized.
a25cfb0
to
e89c9ff
Compare
This comment has been minimized.
This comment has been minimized.
e89c9ff
to
c221672
Compare
This comment has been minimized.
This comment has been minimized.
c221672
to
b144ab7
Compare
I will get around to this, I just put a freeze on my queue because I was accumulating enough reviews in addition to ongoing patch series. :P |
// Embedded ABI, requires e. | ||
(&["e"], &[]) | ||
} | ||
"ilp32" | "lp64" => NOTHING, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"ilp32" | "lp64" => NOTHING, | |
"ilp32" | "lp64" => { | |
// Incompatible with e. | |
(&[], &["e"]) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right the old logic treated all the non-e ABIs the same, we should keep that.
The old logic also allowed disabling e when using an e ABI, so we should probably keep that, too.
b144ab7
to
7563d57
Compare
@ojeda wrote
That no longer works after this PR ( |
I think I finally found the right shape for the data and checks that I recently added in #133099, #133417, #134337: we have a notion of "this ABI requires the following list of target features, and it is incompatible with the following list of target features". This removes all the "toggleability" stuff introduced before, though we do keep the notion of a fully "forbidden" target feature -- this is needed to deal with target features that are actual ABI switches, and hence are needed to even compute the list of required target features.
This is best reviewed commit-by-commit. The first commit adds the new
abi_required_features
function. For now, that function supports x86, ARM, and RISC-V (just like the previous logic did). Unsurprisingly, RISC-V is the nicest. ;) Both-Ctarget-feature
and#[target_feature]
are updated to ensure we follow the rules of the ABI. We also always explicitly (un)set all required and in-conflict features, just to avoid potential trouble caused by the default features of whatever the base CPU is.As a side-effect this also (unstably) allows enabling
x87
when that is harmless.This should also prepare us for requiring SSE on x86-32bit when we want to use that for our ABI (and for float semantics sanity), see #133611.
The last commit marks SSE2 as required on x86-64, to better match the actual logic in LLVM and because all x86-64 chips do have SSE2.
r? @workingjubilee