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

[ppc] Assembler::add_const_optimized incorrect for some inputs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 11
    • Fix Version/s: 11
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b18
    • CPU:
      ppc

      Backports

        Description

        There's a typo in Assembler::add_const_optimized() which makes it return incorrect results for some input values. The fix is trivial:

        diff -r 1d476feca3c9 src/hotspot/cpu/ppc/assembler_ppc.cpp
        --- a/src/hotspot/cpu/ppc/assembler_ppc.cpp Mon Jun 04 11:19:54 2018 +0200
        +++ b/src/hotspot/cpu/ppc/assembler_ppc.cpp Tue Jun 05 11:21:08 2018 +0200
        @@ -486,7 +486,7 @@
           // Case 2: Can use addis.
           if (xd == 0) {
             short xc = rem & 0xFFFF; // 2nd 16-bit chunk.
        - rem = (rem >> 16) + ((unsigned short)xd >> 15);
        + rem = (rem >> 16) + ((unsigned short)xc >> 15);
             if (rem == 0) {
               addis(d, s, xc);
               return 0;

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                simonis Volker Simonis
                Reporter:
                simonis Volker Simonis
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: