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

x86 pow() stub from Intel libm is inconsistent with pow() from fdlib

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b150
    • CPU:
      x86
    • OS:
      generic

      Description

      There is way to prevent Interpreter to use math intrinsics: -XX:-InlineIntrinsics
      In such case it will call C code through JNI. But JIT compilers will still use pow() stub from libm.
      As result produced result java/lang/Math/PowTests.java may fail.

      java -Xcomp -XX:-TieredCompilation -XX:-InlineIntrinsics PowTests1
      a: 0.3678794411714423 b: 0.36787944117144233
      failed

      Attached PowTests1.java test is shortened PowTests.java test prepared by Oleg Pliss.

      One way to fix it (to get consistent results) is to not use libm stubs when InlineIntrinsics switched off:

      - if (VM_Version::supports_sse2() && UseLibmIntrinsic) {
      + if (VM_Version::supports_sse2() && UseLibmIntrinsic && InlineIntrinsics) {
             if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dsin) ||

      But it would be better if code in macroAssembler_x86_pow.cpp could be fixed.

      It would be also nice to verify other libm stubs with -XX:-InlineIntrinsics

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vdeshpande Vivek Deshpande
                Reporter:
                kvn Vladimir Kozlov
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: