On Thu, Mar 16, 2023 at 7:00 PM Bradley Lucier <[email protected]>
wrote:

When the two specialized arrays have different storage classes, this
> back and forth conversion is necessary, converting a u1vector element to
> a fixnum to store into a u8vector, say, as an example.
>

Well, it doesn't have to be done that way.  The conversion can be done at
the level of the machine representations without passing through a Scheme
value, pretty much the way it's done in C.  A fallback to back-and-forth
conversion would be required if the machine representations are unknown (in
practice, if they are non-IEEE).  My proposed f8 approach would be the
exception, because the mapping between internal and external values is done
via Scheme code.


> Moving the 16-bit representation
> between two f16-storage-class is much more efficient than converting to
> the double float Scheme object and then converting back again.
>

Absolutely.  But the same is true for heterogeneous moves, because no
allocations are required.

So (at least some) storage classes should have a way of loading and
> storing the representation of the data directly, instead of using the
> Scheme object as an intermediary.
>

That's what data->body is for, correct?

Reply via email to