RFR: 8375536: PPC64: Implement special MachNodes for floating point CMove [v5]
Richard Reingruber
rrich at openjdk.org
Sat Jan 31 12:30:06 UTC 2026
On Fri, 30 Jan 2026 15:01:11 GMT, Richard Reingruber <rrich at openjdk.org> wrote:
> > That was also wrong, but an additional problem was the wrong handling of NaN: C2 requires unordered to get treated like less
>
> The requirement is to implement `op1 cond op2 ? src1 : src2`. For NaN this means the result has to be `src2` except for `!=`. And that's it, isn't it?
>
> It might have helped to implement `op1 < op2` as `op2 > op1` using xscmpgtdp. The chosen implementation is also good.
I think I finally got it. The semantics to implement are the semantics of CmpF3Node/CmpD3Node.
Would you agree with the extended comment for cmovF?
// Works for single and double precision floats.
// dst = (op1 cmp(cc) op2) ? src1 : src2;
// Unordered sematics are the same as for CmpF3Node/CmpD3Node which implement the fcmpl/dcmpl bytecodes.
// Comparing unordered values has the same result as when src1 is less than src2.
// So dst = src1 for <, <=, != and dst = src2 for >, >=, ==.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29281#issuecomment-3828368439
More information about the hotspot-compiler-dev
mailing list