Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8295926

RISC-V: C1: Fix LIRGenerator::do_LibmIntrinsic

XMLWordPrintable

    • 19
    • b22
    • riscv
    • linux

        The ported logic of LIRGenerator::do_LibmIntrinsic has a correctness problem, which will kill argument registers when the current libm intrinsic's operand is also a libm intrinsic, such as:

        (dpow val1 (dlog val2))

        LIRItem walks operands, so the `value.load_item_force(cc->at(0));` should be moved below after the LIRItem. But we might as well keep aligning AArch64's style.


        Reproducer: (pattern extracted from Renaissance `gauss-mix`)

        ```
        public class A {

            static int count = 0;

            public static void print(double var) {
                if (count % 10000 == 0) {
                    System.out.println(var);
                }
                count++;
            }

            public static void a(double var1, double var2, double var3) {
                double var4 = Math.pow(var3, Math.log(var1 / var2));
                print(var4);
            }

            public static void main(String[] args) {

                for (int i = 0; i < 50000; i++) {
                    double var21 = 2.2250738585072014E-308D;
                    double var15 = 1.1102230246251565E-16D;
                    double d1 = 2.0D;
                    A.a(var21, var15, d1);
                }

            }

        }
        ```

              xlinzheng Xiaolin Zheng
              xlinzheng Xiaolin Zheng
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: