[vector] Is Mask inverted in XXXVector.xxxAll(Mask<>)?
Deshpande, Vivek R
vivek.r.deshpande at intel.com
Wed Mar 20 21:42:15 UTC 2019
Hi
It is selecting values from the broadcasted vector from base scalar value(used as starting point) based on the mask,
instead of the vector on which we want to reduce.
I think the arguments to blend passed should be interchanged.
Regards,
Vivek
-----Original Message-----
From: panama-dev [mailto:panama-dev-bounces at openjdk.java.net] On Behalf Of Vladimir Ivanov
Sent: Wednesday, March 20, 2019 2:21 PM
To: Lev Serebryakov <lev at serebryakov.spb.ru>; panama-dev at openjdk.java.net
Subject: Re: [vector] Is Mask inverted in XXXVector.xxxAll(Mask<>)?
Thanks for the report, Lev!
Yes, it's a bug. Filed https://bugs.openjdk.java.net/browse/JDK-8221176
Best regards,
Vladimir Ivanov
On 19/03/2019 09:54, Lev Serebryakov wrote:
>
> This code gives me 100.0f and not expected 10.0f (Preferred Spices
> in
> 256 on my system, as I don't have AVX-512):
>
> FloatVector.FloatSpecies PFS = FloatVector.preferredSpecies();
> FloatVector.Mask m = FloatVector.maskFromValues(PFS,
> true, false, true, false, true, false, true, false ); FloatVector v
> = FloatVector.fromArray(PFS, new float[]
> { 1.0f, 10.0f, 2.0f, 20.0f, 3.0f, 30.0f, 4.0f, 40.0f }, 0 ); float
> sum = v.addAll(m);
>
>
> Same problem with `mulAll()`.
>
More information about the panama-dev
mailing list