Bug when using DIV
Viswanathan, Sandhya
sandhya.viswanathan at intel.com
Mon Apr 20 19:57:04 UTC 2020
Hi Paul,
Yes, the DIV operator is supported for floating point (float/double) only.
That's how we have documented it in the Java doc also.
http://cr.openjdk.java.net/~psandoz/panama/vector-api-review/docs/api/jdk.incubator.vector/jdk/incubator/vector/VectorOperators.html#DIV
I think we should verify and update the implementation accordingly, if that is not already so.
Best Regards,
Sandhya
-----Original Message-----
From: Paul Sandoz <paul.sandoz at oracle.com>
Sent: Monday, April 20, 2020 11:13 AM
To: Remi Forax <forax at univ-mlv.fr>
Cc: panama-dev at openjdk.java.net' <panama-dev at openjdk.java.net>; Viswanathan, Sandhya <sandhya.viswanathan at intel.com>
Subject: Re: Bug when using DIV
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