Add/SubSaturate for FP

Halimi, Jean-Philippe jean-philippe.halimi at intel.com
Mon Feb 26 18:19:03 UTC 2018


Hi all,

I’ve spend some time today analyzing the code. It looks like addSaturate and subSaturate are by design defined in the Vector superclass. Thus, the FP sub-classes inherit from the definitions as stated in the X-Vector.java.template file.

Should we move the definition of these methods to non-FP classes, or is there a way to mark some code as unreachable? This would increase the robustness of the code as there is currently code in FP classes that is non-usable.

Thanks,

Jp

From: Halimi, Jean-Philippe
Sent: Wednesday, February 21, 2018 12:08 PM
To: Paul Sandoz <paul.sandoz at oracle.com>; panama-dev at openjdk.java.net
Cc: Vladimir Ivanov <vladimir.x.ivanov at oracle.com>; Lupusoru, Razvan A <razvan.a.lupusoru at intel.com>; Rukmannagari, Shravya <shravya.rukmannagari at intel.com>; Deshpande, Vivek R <vivek.r.deshpande at intel.com>; Viswanathan, Sandhya <sandhya.viswanathan at intel.com>; Kandu, Rahul <rahul.kandu at intel.com>
Subject: RE: Add/SubSaturate for FP

Adding Panama-dev to the conversation.

Jp

From: Paul Sandoz [mailto:paul.sandoz at oracle.com]
Sent: Wednesday, February 21, 2018 11:53 AM
To: Halimi, Jean-Philippe <jean-philippe.halimi at intel.com<mailto:jean-philippe.halimi at intel.com>>
Cc: Vladimir Ivanov <vladimir.x.ivanov at oracle.com<mailto:vladimir.x.ivanov at oracle.com>>; Lupusoru, Razvan A <razvan.a.lupusoru at intel.com<mailto:razvan.a.lupusoru at intel.com>>; Rukmannagari, Shravya <shravya.rukmannagari at intel.com<mailto:shravya.rukmannagari at intel.com>>; Deshpande, Vivek R <vivek.r.deshpande at intel.com<mailto:vivek.r.deshpande at intel.com>>; Viswanathan, Sandhya <sandhya.viswanathan at intel.com<mailto:sandhya.viswanathan at intel.com>>; Kandu, Rahul <rahul.kandu at intel.com<mailto:rahul.kandu at intel.com>>
Subject: Re: Add/SubSaturate for FP

Hi Jp,

I think you are correct, they don’t make sense for FP types.

Also, i think the clamped value is incorrect for various types. What should the clamped value be for saturated add of two byte values? Byte.MAX_VALUE?

Shall we continue the conversation on the panama list?

—

Separately if we support saturation we should add scalar methods to the boxed classes.

Paul.


On Feb 21, 2018, at 10:59 AM, Halimi, Jean-Philippe <jean-philippe.halimi at intel.com<mailto:jean-philippe.halimi at intel.com>> wrote:

Dear both,

While I was adding test coverage for the VectorAPI testing framework, I realized that addSaturate for Float was saturating on Integer, while subSaturate was saturating on Float.
I am unsure whether Add and Sub saturate operations make sense for floating point vectors. I have made a patch which removes the two methods for FP vectors.

What are your thoughts?

Thanks,

Jp
<add_saturate.patch>



More information about the panama-dev mailing list