-
Notifications
You must be signed in to change notification settings - Fork 271
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 the trap instrinsic #571
Conversation
/// Generates the trap instruction `UD2` | ||
#[cfg_attr(test, assert_instr(ud2))] | ||
#[inline] | ||
pub unsafe fn ud2() -> ! { |
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.
The stdsimd-verify
crate (https://github.com/rust-lang-nursery/stdsimd/tree/master/crates/stdsimd-verify) needs to be updated to support bottom.
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.
This looks good to me! For x86 I think this'll be initially unstable, right? If so, yay (can have a formal FCP shortly afterwards) |
ping @japaric |
it doesn't do the right thing
I've decided to take over this. I've rebased and hopefully fixed everything. |
I know I initially suggested naming these by their underlying instructions, but that was only if they're gong in |
@parched these are all going in Once these are stabilized, one could implement one in stable Rust, although I agree with you in that it would make sense to include a portable trap intrinsic "somewhere" in standard (e.g. |
@gnzlbg I guess my concern is, for example on AArch64, there are now 2 |
Note that these APIs are unstable, and that we haven't signed off on their stabilization yet. The rfc repo issue achieved consensus that this was a venue worth exploring and I've signed off here that the proposed implementation is good enough for nightly, but that's it. We will need an RFC to stabilize these, and I think the RFC issue showed that we need more experience with these before writing an RFC because of some unresolved questions.
I do think that a portable There were some unresolved questions in the previous issue about how portable can such an intrinsic actually be, what to do in the platforms that might not support it, in which part of So the previous issue was mixing in my view two things:
Providing access to platform specific trap intrinsics and instructions was pretty uncontroversial, and its what's been merged here - this allows implementing a portable way to trap in an external crate (even though this might not be as good as Providing a portable way to trap had the unresolved questions mentioned above, and the discussion derailed a bit, which is why I think it is worth to have a focused discussion that's specific about that only. I think that once we have implemented both alternatives on nightly, we will be in a much better place to consider whether we ought to expose both, even though that introduces some duplication, or whether a portable way to trap is enough, in which case we can just remove the platform specific intrinsics. Once we are there, we'll have a much better feeling for what the "right" solution is, and it would be RFC time. |
When updating the rust submodule to the latest master, I get this error:
|
The paths added here might need some tuning to build upstream (we can't really test that here so it is normal that things break every now and then). Try the following:
You might need to tweak things a bit, so my recommendation is to just create a fork, change rust-lang/rust to use your fork, tweak things there until it builds properly, and then send a PR here to fix things. Let me know if you need help with this. |
Fixed in #599 |
as discussed in rust-lang/rfcs#2512
instead of the generic "trap" name the architecture specific name of the trap instruction has been used