-
Notifications
You must be signed in to change notification settings - Fork 2
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
Initial version of type size agnostic changes #59
base: master
Are you sure you want to change the base?
Conversation
First of all, thank you for starting to work on this problem! I am not sure whether this is functionality that will make it into Version 1.0, but I think it is a good idea to have a place to brainstorm how to properly realize the desired flexibility. To be honest, my plan for supporting "configurable" type sizes was a bit different. The idea is to introduce new low-level Oberon types (maybe in the TYPE
LONGINT = SYSTEM.INT32;
INTEGER = SYSTEM.INT32;
SHORTINT = SYSTEM.INT16;
BYTE = SYSTEM.BYTE;
SET = SYSTEM.SET32; I realize that my proposal is going to require more of a rewrite, but I fear that if this functionality is not realized in a conceptually clean and systematic way, it will be an endless source of problems. The effort could be smaller than expected though, as I have set out writing the compiler with the mindset What do you think? |
Yes, I agree with your comment regarding internally only use fixed int sizes Real unsigned types is maybe not needed. If we have a type Also remember to take into account the two different float types. How to treat exported constants? Maybe this topic is big enough with enough corner cases there is need for a short design document? The purpose of this PR was to only make the LLVM backend be able to output correct code for different sizes of integer, set and real types. I will then just edit the code in (Maybe it should be fairly easy to add the fixed types to This is just the small step with changes not intended to affect the current compiler. |
This PR contains changed to allow avoid hard coded sizes in the backend.
These changes are needed in order to later support cross compiling to target with different sizes than
currently hard coded into the compiler.
This is marked [DRAFT] as I request comments to these changes:
With these changes the unittests pass with the same results as earlier.
Some simple test of different sizes of SET and LONGINT works as expected.