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
intrinsics: Add copy_nonoverlapping<T> #1459
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CohenArthur
force-pushed
the
copy-nonoverlapping
branch
from
August 11, 2022 10:04
2bbffdb
to
2eaf0a5
Compare
If you rebase this on top of #1462 you should be able to close the issue |
philberty
added this to In progress
in Const generics and missing features sprint
via automation
Aug 11, 2022
CohenArthur
force-pushed
the
copy-nonoverlapping
branch
4 times, most recently
from
August 12, 2022 08:55
72b06c1
to
795f27f
Compare
philberty
approved these changes
Aug 12, 2022
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.
LGTM
Const generics and missing features sprint
automation
moved this from In progress
to Reviewer approved
Aug 12, 2022
bors r+ |
Merge conflict. |
CohenArthur
force-pushed
the
copy-nonoverlapping
branch
2 times, most recently
from
August 16, 2022 09:27
c11732e
to
f68ecc7
Compare
This intrinsic is similar to C's memcpy (or in our case, GCC's __builtin_memcpy) with the order of arguments swapped and knowledge about the type of the operands. So we can desugar the following calls: `copy_nonoverlapping::<T>(src, dst, count)` can be converted to `__builtin_memcpy(dst, src, count * size_of::<T>())` Finally, unlike most intrinsics, copy_nonoverlapping must be marked as impure Co-authored-by: philbert <philip.herron@embecosm.com>
bors r+ |
Build succeeded: |
Const generics and missing features sprint
automation
moved this from Reviewer approved
to Done
Aug 16, 2022
CohenArthur
modified the milestones:
Basic const generics and missing features,
Compiler Intrinsics and Builtins
Aug 23, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
intrinsics: Add copy_nonoverlapping
This intrinsic is similar to C's memcpy (or in our case, GCC's
__builtin_memcpy) with the order of arguments swapped and knowledge
about the type of the operands. So we can desugar the following calls:
copy_nonoverlapping::<T>(src, dst, count)
can be converted to
__builtin_memcpy(dst, src, count * size_of::<T>())
Sadly, calling this intrinsic results in calls being optimized out for some reason. I'll open a separate issue to deal with that as I don't have the skills to resolve it.fixed by not marking the function's declaration asTREE_READONLY
Fixes #1450