Skip to content

memset and memcpy builtins should have alignment parameter #247

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

Closed
andrewrk opened this issue Feb 5, 2017 · 1 comment
Closed

memset and memcpy builtins should have alignment parameter #247

andrewrk opened this issue Feb 5, 2017 · 1 comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase.
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented Feb 5, 2017

Alignment must be known at compile time. If the source and destination pointers are known to be aligned to a value that is greater than 1, this can allow more optimal code generation. Otherwise, an alignment of 1 will still work fine. Alignment must be a power of 2.

Additionally, the existence of this parameter will encourage users to use @import("std").mem.copy and @import("std").mem.set rather than unsafe low level intrinsics, and those who use these builtins will think more carefully when they decide to use it.

http://llvm.org/docs/LangRef.html#llvm-memcpy-intrinsic

@andrewrk andrewrk added the enhancement Solving this issue will likely involve adding new logic or components to the codebase. label Feb 5, 2017
@andrewrk andrewrk modified the milestone: 0.2.0 Mar 26, 2017
@andrewrk andrewrk modified the milestones: 0.2.0, 0.1.0 Aug 27, 2017
@andrewrk
Copy link
Member Author

Solved by #37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase.
Projects
None yet
Development

No branches or pull requests

1 participant