-
Notifications
You must be signed in to change notification settings - Fork 65
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
Float32 array load/store primitives #2697
Open
TheNumbat
wants to merge
10
commits into
main
Choose a base branch
from
f32-bigarray
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@TheNumbat please add a full PR description |
Yeah, added, but this still isn't ready for review. Something bad is going on with the cfg backends |
xclerc
reviewed
Jun 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds %primitives for loading/storing float32s to/from strings, bytes, bigstrings, and float32_elt bigarrays. Also covers loading/storing unboxed float32s to/from bigstrings.
The string, bytes, and bigstring primitives have the same semantics as those for int32s; the only difference is that they operate on a float32 register directly. This did not require any compiler backend changes.
The bigarray functions are specialized copies of
caml_ba_ref
/caml_ba_set
for float32. They require bigarrays with thefloat32_elt
element kind, but purposefully ignore the bigarray's 'view' type. This allows the API functions to operate on e.g.(float, float32_elt, 'c) t
bigarrays.Pbigarray_float32_t
/Float32_t
. This kind not exposed by the standard library, and is only used by the new primitives.caml_ba_get_$N
/caml_ba_set_$N
, we now need to check whether the kind isPbigarray_float32_t
. This was necessary because the default runtime functions will convertfloat32_elt
s to doubles.float32_elt
bigarrays are supported. Generic arrays must still convert through float.Tests for all new primitives have been added to
float32_lib.ml
andfloat32_u_lib.ml
.p.s. fixes an assembly emission problem with
CVTSI2SS
, @xclerc to review the last commit