Bug when using DIV

John Rose john.r.rose at oracle.com
Wed Apr 22 01:54:25 UTC 2020


On Apr 21, 2020, at 3:56 AM, Ningsheng Jian <ningsheng.jian at arm.com> wrote:
> 
> Arm SVE implementation will support vector integer division, but I think it's fine not to support it at current stage.

Thanks Ningsheng.

The Vector API is designed to bridge between the basic notions
of Java primitive arithmetic and the capabilities of vector machines.
As such, it must compromise on both sides to some extent.
Sometimes operations arise from Java and must fit into the
Vector API even if vector hardware has a slightly different set
of capabilities.  Sometimes operations appear on one or more
vector platform and must be fitted, somehow, into our Vector
API story.

Java has both divide and remainder operations for both integral
and float types, so the Vector API should support them for those
types also, but if *no* vector machine ever did so, we would consider
de-emphasizing or removing the from the Vector API.

It is more interesting to ask what should happen if *some* machines
support a given operation X but others don’t.  That’s a judgement call,
since Java can always supply a low-performance version of X on machines
that don’t do it natively, but (on the other hand) the Vector API should
not have surprising “performance potholes” in it.  We are removing such
a “pothole” but I think it is a temporary move until we get a reasonably
performing alternative on X86.

There are other places where the capabilities of ARM and X86 vector
ISAs differ in interesting ways.  This question will come up again when
we consider adding other operations that are only partially supported,
especially what we sometimes call “snowflake” operations, unique to
a platform, that support a special kind of algorithm such as machine
learning or cryptography.  (Integer divide is not really a “snowflake”,
but it calls a similar question, temporarily.)  I hope that we can figure
out a way to write modestly machine-specific vector code with
“snowflake” operations at some point in the future.

Another kind of “snowflake” is one which most platforms support
but Java doesn’t support directly for primitives.  Here I’m thinking
of the AES step (forward and reverse) and carry-less multiply.
I think some of these should also be added, in the future, to the
vector operation set, *and* to the JDK as vectorizable methods
that operate on single primitives.

— John


More information about the panama-dev mailing list