Fix safety doc in intrinsics::simd#159322
Conversation
|
Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr Some changes occurred to the platform-builtins intrinsics. Make sure the cc @antoyo, @GuillaumeGomez, @bjorn3, @calebzulawski, @programmerjake |
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
|
Is there LLVM documentation confirming the exact requirements here?
|
|
Looking at the diff, I think the old and new wording are equivalent. An "unmasked value" is likely meant to be interpreted as a value in a lane that has not been "masked out", i.e. in an enabled lane. But I agree that the old wording is confusing. So r=me on the change, but CI failed because the doc link is not right. |
|
Reminder, once the PR becomes ready for a review, use |
I found the possible corresponding documentation: llvm-masked-gather-intrinsics and llvm-masked-scatter-intrinsics, in which it emphasizes that |
|
@RalfJung I commit the fixed commit, it should have solved the link problem. Besides, I open a topic in Zulip: Maybe some safety doc need fixs in intrinsics::simd. In this topic I refered another functions: Also, I think |
| /// Unmasked values in `T` must be readable as if by `<ptr>::read` (e.g. aligned to the element | ||
| /// type). | ||
| /// Each pointer in `ptr` whose corresponding value in `mask` is `!0` must be readable as if by | ||
| /// [`crate::ptr::read`] (e.g. aligned to the element type). |
There was a problem hiding this comment.
Now the crate:: will show up in the rendered text, that's not great.
Something like [`ptr::read`][crate::ptr::read] should work.
There was a problem hiding this comment.
You dud not copy what I suggested and did not fix the problem I think.
There was a problem hiding this comment.
Oops, thank you for your remind. I think I do the right thing this time.😭
|
Also note that this is still marked as waiting-for-author. As the bot says, please say |
|
@rustbot ready |
|
@rustbot author |
|
@rustbot ready |
The Safety documentation for
simd_gatherandsimd_scatterincorrectly described unmasked values inTas requiring readable or writable memory.The memory access is performed through the corresponding enabled pointer lane in
ptr, so this updates the documentation to state that requirement explicitly.