-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Changed altivec.rs to new intrinsic declaration #1722
base: master
Are you sure you want to change the base?
Conversation
It think you can call |
Well in rust-lang/rust#132735 the pr said to migrate it to the same style like in compiler and standard library , I will change it if its not ok |
The goal is to avoid having an |
The code does note that the intrinsic declaration is there to
there are some issues around target features preventing inlining, so it may be related to that. That problem also may have been fixed in the meantime (by more aggressively inlining on the rust side), but it's something to check for. |
Looks like that is no longer a problem (in this case) https://godbolt.org/z/vYzxKMdeo, and both versions generate the same assembly. So just using |
@@ -688,10 +688,13 @@ mod sealed { | |||
let addr = (b as *const u8).offset(a); | |||
|
|||
// Workaround ptr::copy_nonoverlapping not being inlined | |||
unsafe extern "rust-intrinsic" { | |||
#[rustc_intrinsic] | |||
#[rustc_intrinsic_must_be_overridden] |
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.
Note that the rustc_intrinsic_must_be_overridden
attribute is being removed, please do not use it any more. The new new way to declare an intrinsic is:
#[rustc_intrinsic]
unsafe fn unreachable() -> !;
We used to do something similar in |
You can then also remove this line; stdarch no longer should declare any intrinsics itself: |
d25eeab
to
b7348d1
Compare
wont it potentially break some of the functionality? |
No, you've removed all usages of |
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 crate has a sumewhat funny import structure due to how it is integrated with libcore. Everything else uses crate::ptr
, not core::ptr
, so just to be sure let's also use that here.
let mut r = mem::MaybeUninit::uninit(); | ||
|
||
copy_nonoverlapping( | ||
core::ptr::copy_nonoverlapping( |
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.
core::ptr::copy_nonoverlapping( | |
crate::ptr::copy_nonoverlapping( |
} | ||
|
||
copy_nonoverlapping( | ||
core::ptr::copy_nonoverlapping( |
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.
core::ptr::copy_nonoverlapping( | |
crate::ptr::copy_nonoverlapping( |
…pping using core::ptr::copy_nonoverlapping for memory operations changes core::ptr::coopy_nonoverlapping to crate::ptr::
b7348d1
to
b12757c
Compare
No description provided.