Bug when using DIV

Paul Sandoz paul.sandoz at oracle.com
Mon Apr 20 18:13:09 UTC 2020


Hi Remi,

I seem to recall that it was planed to remove the div methods on vectors with integral values.  Hence the exception, the DIV operation is specified to be floating point only:

  public static final Binary DIV = binary("DIV", "/", VectorSupport.VECTOR_OP_DIV, VO_ONLYFP);

There is no vector hardware instruction for div for integrals. 

But IIUC there is SVML support, so potentially it could be rolled into that (with support for the transcendental functions) if/when the SVML is brought it.

Sandhya, what are your thoughts on this?

Paul.

> On Apr 16, 2020, at 10:09 AM, Remi Forax <forax at univ-mlv.fr> wrote:
> 
> Hi all,
> I've found a bug or at least a weird behaviour
>    var species =  IntVector.SPECIES_PREFERRED;
>    var array = IntStream.range(0, 64).toArray();
>    var v1 = IntVector.fromArray(species, array, 0);
>    var v2 = IntVector.fromArray(species, array, 0);
>    v1.div(v2);
> 
> Exception in thread "main" java.lang.UnsupportedOperationException: DIV: inapplicable floating point operator
>        at jdk.incubator.vector/jdk.incubator.vector.VectorOperators$OperatorImpl.illegalOperation(VectorOperators.java:908)
>        at jdk.incubator.vector/jdk.incubator.vector.VectorOperators$OperatorImpl.illegalOperation(VectorOperators.java:894)
>        at jdk.incubator.vector/jdk.incubator.vector.VectorOperators$OperatorImpl.opCode(VectorOperators.java:865)
>        at jdk.incubator.vector/jdk.incubator.vector.VectorOperators.opCode(VectorOperators.java:434)
>        at jdk.incubator.vector/jdk.incubator.vector.IntVector.opCode(IntVector.java:62)
>        at jdk.incubator.vector/jdk.incubator.vector.IntVector.lanewiseTemplate(IntVector.java:651)
>        at jdk.incubator.vector/jdk.incubator.vector.Int256Vector.lanewise(Int256Vector.java:277)
>        at jdk.incubator.vector/jdk.incubator.vector.Int256Vector.lanewise(Int256Vector.java:41)
>        at jdk.incubator.vector/jdk.incubator.vector.IntVector.div(IntVector.java:1336)
>        at fr.umlv.jruntime/fr.umlv.jruntime.DivBug.main(DivBug.java:12)
> 
> regards,
> Rémi
> 
> PS: i've first sent that email to "panama-dev" <panama-dev-bounces at openjdk.java.net> :(



More information about the panama-dev mailing list