Skip to content
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

Allow for all integer types up to 128 bits. #1240

Conversation

BarabasGitHub
Copy link
Contributor

@BarabasGitHub BarabasGitHub commented Jul 15, 2018

I also tried to find the code for integer types or anything in the self hosted compiler but I couldn't find it.

Will it automatically link this to the issue now that I put the # in the branch name? I guess not. Does this work? #745

@BarabasGitHub
Copy link
Contributor Author

Oops, I didn't run all the tests.

@tiehuis
Copy link
Member

tiehuis commented Jul 15, 2018

I think we'll want a more general solution here for any bit-type instead of just increasing the current set.

I'm not completely familiar with the current implementation but I think we'll want to drop the entry_int from builtin and add a new builtin_int_table or similar, then lazily create integer types as the symbols are resolved. You could probably investigate how the IntType builtin currently works and treat matching symbols in exactly the same way.

I'll let @andrewrk say more.

@BarabasGitHub
Copy link
Contributor Author

I'll try to take a look at the IntType.

@BarabasGitHub
Copy link
Contributor Author

BarabasGitHub commented Jul 15, 2018

Meh, as far as I can see that means I've to parse the variable name in Ir.cpp unless I it can be intercepted somewhere before.

Ok. I tried to hack it in, but now everything is broken. :D
Someone with more knowledge about where all the offsets and indices and whatnot are should probably do this.

I did fix the up to 128 case, so I'll push that in case anyone decides that's good enough for now.

@andrewrk
Copy link
Member

I agree with @tiehuis. To solve #745 we do need to have a table of lazily generated int types, and we do need to parse the variable name just before looking it up in the primitive type table. Although we probably will pre-generate the common ones and keep references to them for convenience.

I'd be happy to prioritize this issue; I could knock it out pretty quickly since I have all the quirks memorized. Feel free to leave this PR up as motivation .

The self hosted compiler does not support integers yet :-)

@andrewrk andrewrk closed this in e9a03cc Jul 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants