[vector api] RFR: Fix the issue about float/double reduce-max/min operations with NaN as an input
Yang Zhang (Arm Technology China)
Yang.Zhang at arm.com
Thu Jan 10 02:43:44 UTC 2019
Hi Vladimir, Sandhya
Ping again. Could you please help to review this patch?
Regards,
Yang
-----Original Message-----
From: Yang Zhang <yang.zhang at linaro.org>
Sent: Thursday, January 10, 2019 10:32 AM
To: Yang Zhang (Arm Technology China) <Yang.Zhang at arm.com>
Subject: Fwd: [vector api] RFR: Fix the issue about float/double reduce-max/min operations with NaN as an input
---------- Forwarded message ---------
From: Yang Zhang (Arm Technology China) <Yang.Zhang at arm.com>
Date: Fri, 14 Dec 2018 at 16:31
Subject: RE: [vector api] RFR: Fix the issue about float/double reduce-max/min operations with NaN as an input
To: Viswanathan, Sandhya <sandhya.viswanathan at intel.com>, panama-dev at openjdk.java.net <panama-dev at openjdk.java.net>
Cc: nd <nd at arm.com>
Hi Sandhya
Happy holidays. Let us keep on this work after holidays.
Regards
Yang
-----Original Message-----
From: Viswanathan, Sandhya <sandhya.viswanathan at intel.com>
Sent: Friday, December 14, 2018 9:43 AM
To: Yang Zhang (Arm Technology China) <Yang.Zhang at arm.com>; panama-dev at openjdk.java.net
Cc: nd <nd at arm.com>
Subject: RE: [vector api] RFR: Fix the issue about float/double reduce-max/min operations with NaN as an input
Hi Yang,
The current x86 intrinsics are based on the current definition as in Javadoc for Vector API float(double) min:
public abstract FloatVector<S> min(float s) Returns the minimum of this vector and the broadcast of an input scalar.
This is a vector binary operation where the operation (a, b) -> a < b ? a : b is applied to lane elements.
Parameters:
s - the input scalar
Returns:
the minimum of this vector and the broadcast of an input scalar
We are looking into making it closer to Math.min at least in the NaN related behavior. Let us wait till January middle or so to converge on this, it being too close to Christmas now and many are on vacation.
Hope that is ok.
Happy holidays. It is wonderful to see you and others from Arm technology onboard and contributing to Panama Vector API. Let us keep this collaboration going.
Best Regards,
Sandhya
-----Original Message-----
From: panama-dev [mailto:panama-dev-bounces at openjdk.java.net] On Behalf Of Yang Zhang (Arm Technology China)
Sent: Wednesday, December 12, 2018 12:37 AM
To: panama-dev at openjdk.java.net
Cc: nd <nd at arm.com>
Subject: [vector api] RFR: Fix the issue about float/double reduce-max/min operations with NaN as an input
Hi
When I implement reduce-max/min, I found there is an issue about float/double reduce-max/min operations with NaN as an input.
In java doc, if either value is NaN, then the result of max/min(a, b) is NaN. But the result of "((a > b) ? a : b)" is affected by sequence of (a, b). If a is NaN, the result is b. If b is NaN, the result is b (NaN).
I have a patch which could fix this issue. Could you please help to review it?
http://cr.openjdk.java.net/~yzhang/vectorapi.nan/webrev.00/
Ps. With this patch, there are 5 failures on x86 platform.
jdk/incubator/vector/Float256VectorTests.java
jdk/incubator/vector/Float64VectorTests.java
jdk/incubator/vector/FloatMaxVectorTests.java
jdk/incubator/vector/Double128VectorTests.java
jdk/incubator/vector/DoubleMaxVectorTests.java
Webrev:
Regards,
Yang
More information about the panama-dev
mailing list