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

Add floating point support #17

Closed
chsasank opened this issue Jun 4, 2024 · 2 comments · Fixed by #18
Closed

Add floating point support #17

chsasank opened this issue Jun 4, 2024 · 2 comments · Fixed by #18

Comments

@chsasank
Copy link
Owner

chsasank commented Jun 4, 2024

Add floating point types

https://capra.cs.cornell.edu/bril/lang/float.html

and tests:

https://github.com/sampsyo/bril/tree/main/test/interp/float

Subset of #13

@GlowingScrewdriver
Copy link
Contributor

GlowingScrewdriver commented Jun 4, 2024

LLVM supports ordered and unordered floating point operations. BRIL doesn't make a distinction between them.
Whether a comparison or ordered or not affects the outcome when one operand is NaN. I am not sure of the finer details.

Clang emits ordered comparison instructions when comparing arbitrary numbers. We will follow the same for now.

@GlowingScrewdriver
Copy link
Contributor

Okay. Looks like the difference is this: if either operand is NaN, ordered operations return false, while unordered operations return true. So, makes sense to support the ordered operations.

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 a pull request may close this issue.

2 participants