[vector] cast/rehsape intrinsics <was> Re: [vector] reshape/cast using species
Lupusoru, Razvan A
razvan.a.lupusoru at intel.com
Thu Mar 1 01:01:00 UTC 2018
Hi Paul,
Can you please wait 2-3 more days for this? Vladimir is working on finalizing the generalized intrinsics implementation - and we want to get that merged asap to allow us to deprecate old technique since the mix of two techniques have been leading to some bugs. Once generalized intrinsics is merged, we will work with you to have the compiler support ready to go for rebracket so that there are no errors when you do commit this code.
--Razvan
-----Original Message-----
From: panama-dev [mailto:panama-dev-bounces at openjdk.java.net] On Behalf Of Paul Sandoz
Sent: Wednesday, February 28, 2018 10:26 AM
To: panama-dev at openjdk.java.net
Subject: [vector] cast/rehsape intrinsics <was> Re: [vector] reshape/cast using species
Hi Razvan, Vladimir,
Are you ok if i push this patch leaving behind some intrinsics to be cleaned up to operate on species:
do_intrinsic(_VectorMaskRebracket, jdk_incubator_vector_VectorMask, rebracket_method_name, vector_mask_rebracket_sig, F_R) \
do_intrinsic(_VectorRebracket, jdk_incubator_vector_Vector, rebracket_method_name, vector_cast_sig, F_R) \
?
Perhaps we need to push casts/reshape down into VectorIntrinsics? For example:
static <V, W> W cast(Class<? extends V> vectorClassOut, Class<?> elementTypeOut, int vlenOut,
Class<? extends V> vectorClassIn, Class<?> elementTypeIn, int vlenIn,
V vIn,
Function<V, W> defaultImpl) {
throw new UnsupportedOperationException(); }
static <V, W> W reshape(Class<? extends V> vectorClassOut, Class<?> elementTypeOut, int vlenOut,
Class<? extends V> vectorClassIn, Class<?> elementTypeIn, int vlenIn,
V vIn,
Function<V, W> defaultImpl) {
throw new UnsupportedOperationException(); }
Same applies to Mask (and possibly Shuffle), which this method might cove with a rename of the vector parameters?
Paul.
> On Feb 27, 2018, at 5:03 PM, Paul Sandoz <Paul.Sandoz at oracle.com> wrote:
>
> 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