Closed TheNumbat closed 1 day ago
@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
Can we please pull out the fix for cvtsi2ss
into a separate PR?
Sure; #2758 Now merged
@ccasin did you read the tests? If not please do. I am reading everything else that you didn't.
Yes, I read the tests, so this seems fine to merge once CI passes.
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
.