valhalla icon indicating copy to clipboard operation
valhalla copied to clipboard

FP16 isNaN, isFinite, isInfinite intrinsics without Reinterpret nodes

Open Bhavana-Kilambi opened this issue 1 year ago • 2 comments

This patch removes the ReinterpretS2HF nodes in the mid-end during the generation of isNaNHF,isFiniteHF and isInfiniteHF nodes.

Performance results for this patch on an aarch64 machine -

Benchmark               Gain over baseline      Gain over default
FP16Ops.isFiniteHF      1.29                    1.85
FP16Ops.isInfiniteHF    1.28                    1.90
FP16Ops.isNaNHF         1.45                    1.58

The baseline patch generates floating point FP16 instructions and the default is where no FP16 intrinsics are used and FP32 instructions are generated.

Gain : thrpt of this patch / thrpt of either baseline or default

Tested FP16Ops.isInfiniteHF test on x86 and the performance is 2.6x better over the default case (which converts FP16 to FP32 and uses the vfpclass instruction).

The JMH tests are added in this patch.


Progress

  • [x] Change must not contain extraneous whitespace

Reviewers

  • @Babbz86 (no known openjdk.org user name / role)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/1242/head:pull/1242
$ git checkout pull/1242

Update a local copy of the PR:
$ git checkout pull/1242
$ git pull https://git.openjdk.org/valhalla.git pull/1242/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1242

View PR using the GUI difftool:
$ git pr show -t 1242

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/1242.diff

Bhavana-Kilambi avatar Sep 12 '24 07:09 Bhavana-Kilambi

:wave: Welcome back bkilambi! A progress list of the required criteria for merging this PR into lworld+fp16 will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

bridgekeeper[bot] avatar Sep 12 '24 07:09 bridgekeeper[bot]

❗ This change is not yet ready to be integrated. See the Progress checklist in the description for automated requirements.

openjdk[bot] avatar Sep 12 '24 07:09 openjdk[bot]

Closing as the other PR opened for implementing isNaN, isfinite and isInfinite for FP16 has been approved and integrated.

Bhavana-Kilambi avatar Sep 26 '24 13:09 Bhavana-Kilambi