Querying for best shape or species

Paul Sandoz paul.sandoz at oracle.com
Fri Nov 17 01:35:51 UTC 2017


We need a method on Vector for a given type to either return a shape or species for the maximum shape supported by the hardware e.g.

static <E> Vector.Species<E, ?> getOptimalSpecies(Class<E> c)

There has gotta be logic we can reuse with the VM and expose via a native method from which we can derive the species e.g. on VectorIntrinsics or Unsafe

// Return the maximum register size that can be used to pack, lane-wise, values of type c.
int getMaxRegisterSize(Class<?> c)

Vladimir, WDYT, is this easy to expose out?

Thanks,
Paul.


More information about the panama-dev mailing list