[vectorIntrinsics] ByteArray tests and fix
Paul Sandoz
paul.sandoz at oracle.com
Fri Apr 17 01:07:12 UTC 2020
X-Vector.java.template
—
3196 $Type$Buffer tb = wrapper(a, offset, bo);
3197 return vsp.ldOp(tb, offset, (AbstractMask<$Boxtype$>)m,
3198 #if[byte]
3199 (tb_, offset_, i) -> tb_.get(offset_ + i));
3200 #else[byte]
3201 (tb_, __, i) -> tb_.get(i));
3202 #end[byte]
What if instead of that and other changes we change wrapper method to be:
private static $Type$Buffer wrapper(byte[] a, int offset,
ByteOrder bo) {
#if[byte]
return ByteBuffer.wrap(a, offset, a.length - offset)
.order(bo).slice();
#else[byte]
return ByteBuffer.wrap(a, offset, a.length - offset)
.order(bo).as$Type$Buffer();
#end[byte]
}
?
If correct that should be the only required change to this file.
In fact a better change would be for the byte into/fromByteArray to defer to the into/fromArray. Perhaps a larger change than you are willing to make for this fix?
Paul.
> On Apr 16, 2020, at 5:20 PM, Viswanathan, Sandhya <sandhya.viswanathan at intel.com> wrote:
>
> Please find below a webrev which adds tests for fromByteArray and intoByteArray methods.
> The webrev also fixes issues found in the ByteArray API implementation.
>
> http://cr.openjdk.java.net/~sviswanathan/vectorIntrinsics/ByteArray/webrev.00/
>
> Best Regards,
> Sandhya
More information about the panama-dev
mailing list