-
Notifications
You must be signed in to change notification settings - Fork 50
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
How are values larger than u64 handled for Constant::Int? #5
Comments
A great question, thanks for reporting! Currently, I may be missing something, but it looks to me at first glance that the LLVM C API doesn't have a function to get the values of larger constant integers. This may be part of the same family of problems discussed in our README in the Limitations section (see also LLVM bug 42692). If that is indeed the case, then the fix here will have to be to submit a patch to LLVM adding a function or functions to the LLVM C API. On first glace, I think the C API function should probably use |
Thank you for the fast and comprehensive answer! If my project, that I'm using this library for, works out, I will probably take some time to look at removing some limitations. I guess we should leave this issue open, until someone gets around to it. |
I'm happy leaving this open until someone gets around to it (doesn't have to be you). I might make a note in our Limitations section or in the Constant docs. Thanks for the report! |
Hey,
first of all thank you for this lib, it is very nice to work with!
I noticed that llvm can have int values of arbitrary size, one example mentions an integer with the size of more than a million bits. In the case that raised this question for me, I have a constant integer size of 128, in a normally compiled program. However, the actual value fits inside a u64 and is used as part of the mul instruction.
https://releases.llvm.org/10.0.0/docs/LangRef.html#integer-type
The internal field value that contains the constant value is of size u64.
llvm-ir/src/constant.rs
Line 14 in 575bb41
So my question is, what happens for a constant int value that is larger than a u64?
The text was updated successfully, but these errors were encountered: