[lworld+fp16] RFR: 8336406: Add support for FP16 binary operations
Bhavana Kilambi
bkilambi at openjdk.org
Wed Jul 31 14:49:51 UTC 2024
On Wed, 31 Jul 2024 10:11:29 GMT, Jatin Bhateja <jbhateja 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.
>
> src/hotspot/share/opto/mulnode.hpp line 149:
>
>> 147: // Multiply 2 half floats
>> 148: class MulHFNode : public MulFNode {
>> 149: public:
>
> While its good to use MulFNode constant folding (Value) routines and generic Ideal transforms, we should skip any specific Idealization transformations which may end up generating purely [floating point IR](https://github.com/openjdk/valhalla/blob/lworld%2Bfp16/src/hotspot/share/opto/mulnode.cpp#L547)
Thank you for the review. I agree with your point and somehow missed this. I will make changes and upload a new PS soon.
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1175#discussion_r1698650323
More information about the valhalla-dev
mailing list