-
Notifications
You must be signed in to change notification settings - Fork 485
Refactoring float32 and float64 prims into a single FloatPrims functor #111
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
Conversation
6600a56
to
a9304af
Compare
Looks good, but I would prefer to factor this slightly differently:
This way, (1) you avoid all the extra |
a9304af
to
43ce67a
Compare
Good point. I am matching the stdlib idioms now, including signature names in the module. |
LGTM modulo the TODO. |
ml-proto/spec/float.ml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
size
wasn't in the interface before. Is there a need for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seem to be anymore. size was there a few commits ago when int cast was integrated in float, but I guess I just let it reappear. In any case, I removed it now. Thanks!
7fac340
to
0064c7a
Compare
ml-proto/spec/float.ml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a minor nit, print_nan
here should be named something like print_nan_significand_digits
since it's just printing that one part, rather than the whole NaN.
0064c7a
to
8c7de4f
Compare
Ok, done with the rename. |
lgtm; thanks! |
Refactoring float32 and float64 prims into a single FloatPrims functor
This is consistent with the ordering for all other instructions that have signed and unsigned variants. This does renumber these instructions, but no engine or toolchain has documented support for these instructions yet, so that should be ok.
Add further examples to explainer
This is a simple refactoring of F32 and F64 to avoid fairly significant duplication.