[lworld+fp16] RFR: 8336406: Add support for FP16 binary operations [v2]

Jatin Bhateja jbhateja at openjdk.org
Thu Aug 8 02:51:44 UTC 2024


On Tue, 6 Aug 2024 08:55:42 GMT, Bhavana Kilambi <bkilambi at openjdk.org> wrote:

>> This patch adds middle end support in C2 for a few FP16 binary operations, namely - subtract, multiply, divide, min and max. It also adds aarch64 backend support for these operations.
>> 
>> Tested JTREG tests -
>> hotspot/jtreg/compiler/vectorization/TestFloat16VectorOps.java, hotspot/jtreg/compiler/vectorization/TestFloat16VectorReinterpretConv.java, hotspot/jtreg/compiler/intrinsics/float16 and test/jdk/java/lang/Float16 and they successfully pass on aarch64 and x86 machines.
>
> Bhavana Kilambi has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add MulHF::Ideal() and MulHF Idealization tests

Marked as reviewed by jbhateja (Committer).

Please address the closing comments and integrate.

Patch looks good to me. Will add x86 backend support for newly added intrinsic.

test/hotspot/jtreg/compiler/c2/irTests/MulHFNodeIdealizationTests.java line 60:

> 58:     public void test1() {
> 59:         dst = Float16.multiply(src, Float16.valueOf(2));
> 60:     }

2 -> 2.0f

test/hotspot/jtreg/compiler/c2/irTests/MulHFNodeIdealizationTests.java line 64:

> 62:     @Check(test="test1")
> 63:     public void checkTest1() {
> 64:         Float16 expected = Float16.valueOf(src.floatValue() * (float) 2);

Same as above

-------------

PR Review: https://git.openjdk.org/valhalla/pull/1175#pullrequestreview-2226486828
PR Comment: https://git.openjdk.org/valhalla/pull/1175#issuecomment-2274851367
PR Review Comment: https://git.openjdk.org/valhalla/pull/1175#discussion_r1708252301
PR Review Comment: https://git.openjdk.org/valhalla/pull/1175#discussion_r1708256373


More information about the valhalla-dev mailing list