[lworld+fp16] RFR: 8308363: Initial compiler support for FP16 scalar operations. [v7]

Sandhya Viswanathan sviswanathan at openjdk.org
Mon Sep 18 22:32:09 UTC 2023


On Mon, 18 Sep 2023 17:39:08 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

> > Very good work in general. I only have couple of comments in the code, please take a look. Also there might be some further optimization opportunities for the path that comes from Op_ConvF2HF -> ReinterpretS2HF. ConvF2HF is doing the conversion from xmm to xmm register and then moves the xmm to gpr. ReinterpretS2HF then moves from gpr back to xmm. This unnecessary movement from xmm->gpr and from gpr->xmm could be optimized out.
> 
> Yes, but this can only be done if we factor out xmm -> gpr movement out of ConvF2HF, its inputs is a IEEE 754 binary32 bit floating point value and output is a binary16 bit value help in a GPR. It will not be proper to remove ConvF2HF + ReinterpretS2HF by a direct ideal transformation currently.

One path is having an instruct with match rule for this, something like below I think:
match(Set dst (ReinterprestS2HF(ConvF2HF src)));

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

PR Comment: https://git.openjdk.org/valhalla/pull/848#issuecomment-1724547301



More information about the valhalla-dev mailing list