-
Notifications
You must be signed in to change notification settings - Fork 163
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 more intrinsics and refactor how we implement them #1003
Conversation
I would appreciate any GCC folks looking at this. This is part of my set of patches to get slices working, just so you know for context. It would be easier to look at each individual commit rather than the full diff for reviewing purposes. |
d3eeed8
to
7679cbe
Compare
This patch adds the initial support for generic intrinsics these are do not map directly to GCC builtins and need to be substited with their specificed types. This patch allows for custom implementation body for these functions by specifying handler functions which will generate the applicable intrinsic when asked for. Addresses #658
Intrinsics were hidden behind the GCC abstract. This removes it by keeping all of this logic within rust-intrinsic.cc so that we can make mappings of the rustc name to GCC ones. We have a big comment from the mappings used over to LLVM builtins which we can use to help guide how we do this for GCC.
This demonstrates how we can add in the simple intrinsics in a single patch. Addresses #658
Addresses #658
This is another type of intrisic since the function contains no parameters but the argument for the size_of is the generic parameter T. Which uses TYPE_SIZE_UNIT to get the type size in bytes. GCC will optimize the function call away when you turn optimizations on. Addresses #658
7679cbe
to
f057445
Compare
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.
Looks good to me! Waiting for the experts' opinions :)
bors r+ |
Build succeeded: |
This patch series implements:
It removes the GCC wrapper mappings to make them much easier to implement. It also demonstrates in single commits
the implementation of each of these intrinsic to make it easy to follow in how we implement them.
Addresses #658 #849