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

Signed integers #13

Open
ChocolateLoverRaj opened this issue Dec 16, 2022 · 0 comments
Open

Signed integers #13

ChocolateLoverRaj opened this issue Dec 16, 2022 · 0 comments
Labels
plugin Not part of core llvm parser. Additional optional feature.

Comments

@ChocolateLoverRaj
Copy link
Owner

Why

It makes sense that LLVM doesn't have signed / unsigned integers, but for the programmer, it's nice to have signed / unsigned integers. Then when you multiply or divide, you don't need to specify signed or unsigned.

Without Plugin

%signedInt = load i32, ptr %ptr
%unsignedInt = load i32, ptr %ptr

Possible syntaxs

u / s

%signedInt = load si32, ptr %ptr
%unsignedInt = load ui32, ptr %ptr

signed / unsigned

%signedInt = load signed i32, ptr %ptr
%unsignedInt = load unsigned i32, ptr %ptr

Default

It would be confusing to have the default be signed or unsigned, so the plugin would require to specify signed or unsigned.

@ChocolateLoverRaj ChocolateLoverRaj added the plugin Not part of core llvm parser. Additional optional feature. label Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin Not part of core llvm parser. Additional optional feature.
Projects
None yet
Development

No branches or pull requests

1 participant