RFR: 8342103: C2 compiler support for Float16 type and associated scalar operations [v9]

Emanuel Peter epeter at openjdk.org
Wed Jan 8 14:13:40 UTC 2025


On Mon, 16 Dec 2024 14:19:49 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>>> > Can you quickly summarize what tests you have, and what they test?
>>> 
>>> Patch includes functional and performance tests, as per your suggestions IR framework-based tests now cover various special cases for constant folding transformation. Let me know if you see any gaps.
>> 
>> I was hoping that you could make a list of all optimizations that are included here, and tell me where the tests are for it. That would significantly reduce the review time on my end. Otherwise I have to correlate everything myself, and that will take me hours.
>
>> > > Can you quickly summarize what tests you have, and what they test?
>> > 
>> > 
>> > Patch includes functional and performance tests, as per your suggestions IR framework-based tests now cover various special cases for constant folding transformation. Let me know if you see any gaps.
>> 
>> I was hoping that you could make a list of all optimizations that are included here, and tell me where the tests are for it. That would significantly reduce the review time on my end. Otherwise I have to correlate everything myself, and that will take me hours.
> 
> 
> Validations details:-
> 
> A) x86 backend changes
>    - new assembler instruction
>    - macro assembly routines. 
>     Test point:-  test/jdk/jdk/incubator/vector/ScalarFloat16OperationsTest.java
>          - This test is based on a testng framework and includes new DataProviders to generate test vectors.
>          -  Test vectors cover the entire float16 value range and also special floating point values (NaN, +Int, -Inf, 0.0 and -0.0) 
> B) GVN transformations:-
>      -  Value Transforms
>         Test point:- test test/hotspot/jtreg/compiler/c2/irTests/TestFloat16ScalarOperations.java
>               -  Covers all the constant folding scenarios for add, sub, mul, div, sqrt, fma, min, and max operations addressed by this patch.
>               -  It also tests special case scenarios for each operation as specified by Java language specification.
>     -   identity Transforms
>         Test point:- test test/hotspot/jtreg/compiler/c2/irTests/TestFloat16ScalarOperations.java
>                -  Covers identity transformation for  ReinterpretS2HFNode,  DivHFNode
>     -  idealization Transforms
>         Test points:-  test/hotspot/jtreg/compiler/c2/irTests/MulHFNodeIdealizationTests.java
>                                 :-   test test/hotspot/jtreg/compiler/c2/irTests/TestFloat16ScalarOperations.java
>             - Contains test point for the following transform 
>                          MulHF idealization i.e. MulHF * 2 => AddHF  
>            -  Contains test point for the following transform
>                          DivHF SRC ,  PoT(constant) =>  MulHF SRC * reciprocal (constant) 
>             - Contains idealization test points for the following transform 
>                    ConvF2HF(FP32BinOp(ConvHF2F(x), ConvHF2F(y))) =>
>                            ReinterpretHF2S(FP16BinOp(ReinterpretS2HF(x), ReinterpretS2HF(y)))

@jatin-bhateja Is this ready for another review pass?

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

PR Comment: https://git.openjdk.org/jdk/pull/22754#issuecomment-2577768041


More information about the hotspot-compiler-dev mailing list