[vector] reshape/cast using species

Paul Sandoz paul.sandoz at oracle.com
Wed Feb 28 01:03:41 UTC 2018


Hi,

I think it makes more sense to move the reshape and cast functionality from Vector to species, and then to preserve the fluent nature of the API add methods to Vector that accept a species and defer to the species method. Same applies to Mask and Shuffle.

  http://cr.openjdk.java.net/~psandoz/panama/species-reshape-cast/webrev/index.html


I left some commented out methods that are intrinsic as a reminder this needs to be looked at:

 139 //    //Costless vector cast.  Bit-wise contents preserved
 140 //    @HotSpotIntrinsicCandidate
 141 //    default <F> Vector<F, S> rebracket(Class<F> type) { return reshape(type, shape());}
 142 

 468 //#if[float]
 469 //    @HotSpotIntrinsicCandidate
 470 //#end[float]
 471 //    @Override
 472 //    public <F> Vector<F,S> cast(Class<F> type) {
 473 //        return cast(type, shape());
 474 //    }

I’ll need some guidance with respect preserving hotspot intrinsic behavior for the newly added methods on species.

I’ll add some combo test later.

Thanks,
Paul.


More information about the panama-dev mailing list