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

Decide whether to promote all ints to floats in binops #52

Closed
KhaledAtef opened this issue Nov 30, 2015 · 4 comments
Closed

Decide whether to promote all ints to floats in binops #52

KhaledAtef opened this issue Nov 30, 2015 · 4 comments
Assignees

Comments

@KhaledAtef
Copy link
Collaborator

No description provided.

@KhaledAtef
Copy link
Collaborator Author

In the case of adding floats to ints, did we decide on promoting the ints to floats? Originally, we said we'll just take whatever comes first, but I couldn't remember what we decided on.

@six5532one
Copy link
Collaborator

I thought we decided to promote ints to floats (for binops) because when we got together last time, we tried out the llvm library's build_add function with an int and a "float" by casting the int to const_double, then using const_uitofp

@DavidWatkins
Copy link
Owner

Ah gotcha. But if we have the addition of two integers, it stays type int, correct?

@six5532one
Copy link
Collaborator

In the current implementation, yup indeed:
https://github.com/DavidWatkins/Dice/blob/emily/Compiler/analyzer.ml#L115

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

No branches or pull requests

3 participants