[vector] Add non-masked Vector. intoByteArray accepting a byte order

Viswanathan, Sandhya sandhya.viswanathan at intel.com
Thu May 7 18:01:33 UTC 2020


+1

Best Regards,
Sandhya

-----Original Message-----
From: panama-dev <panama-dev-bounces at openjdk.java.net> On Behalf Of Paul Sandoz
Sent: Wednesday, May 06, 2020 4:14 PM
To: John Rose <john.r.rose at oracle.com>
Cc: panama-dev at openjdk.java.net' <panama-dev at openjdk.java.net>
Subject: Re: [vector] Add non-masked Vector. intoByteArray accepting a byte order

Here’s an update:

  http://cr.openjdk.java.net/~psandoz/panama/vector-intoByteArray-with-byte-order/webrev/ <http://cr.openjdk.java.net/~psandoz/panama/vector-intoByteArray-with-byte-order/webrev/>

Paul.

> On May 6, 2020, at 10:25 AM, John Rose <john.r.rose at oracle.com> wrote:
> 
> On May 6, 2020, at 8:11 AM, Paul Sandoz <paul.sandoz at oracle.com <mailto:paul.sandoz at oracle.com>> wrote:
>> 
>> Perhaps rather than filling out we need to slim down. where ByteOrder is a required parameter, then that fits with the pattern of non-mask and mask variants of many other methods:
>> 
>>  public abstract void intoByteArray(byte[] a, int offset, ByteOrder 
>> bo);  public abstract void intoByteArray(byte[] a, int offset, 
>> ByteOrder bo, VectorMask<E> m);
>> 
>> And, we do the same for [EType]Vector.fromByteArray.
> 
> That’s not terrible.  After all, if you are working with byte arrays, 
> you really do need to pay attention to byte order; it doesn’t just 
> sweep itself under the rug and go away.  (Trying to pretend byte order 
> doesn’t exist leads to a special code smell I call byte odor.)
> 
> — John



More information about the panama-dev mailing list