RFR: 8375536: PPC64: Implement special MachNodes for floating point CMove [v2]

Martin Doerr mdoerr at openjdk.org
Thu Jan 29 09:49:22 UTC 2026


On Wed, 28 Jan 2026 20:39:53 GMT, Richard Reingruber <rrich at openjdk.org> wrote:

> > Please note that C2 generates code which is equivalent to your C version:
> 
> Could you please provide the Java source code for that?


class test {
  static double cmovf_eq(double op1, double op2, double src1, double src2) {
    return op1 == op2 ? src1 : src2;
  }

  static void main(String[] args) {
    double result = 0.0;
    for (int i = 0; i < 100_000; ++i) {
      result += cmovf_eq((double) (i / 2), (double) ((i + 1) / 2), 1.0, 2.0);
    }
    System.out.println("result = " + result);
  }
}


> > Btw. what the Spec suggests also seems to use the wrong order:
> 
> Where can that be found?

PowerISA™ Version3.1C

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29281#discussion_r2740791193


More information about the hotspot-compiler-dev mailing list