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

[ppc] Assembler::add_const_optimized incorrect for some inputs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 11
    • 11
    • hotspot
    • None
    • b18
    • ppc

        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;

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

                Created:
                Updated:
                Resolved: