RFR(XXS): 8204335: [ppc] Assembler::add_const_optimized incorrect for some inputs

Volker Simonis volker.simonis at gmail.com
Tue Jun 5 16:05:49 UTC 2018


Hi,

can I please have a review for this trivial, day-one, ppc-only fix:

http://cr.openjdk.java.net/~simonis/webrevs/2018/8204335/
https://bugs.openjdk.java.net/browse/JDK-8204335

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

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;

Thank you and best regards,
Volker


More information about the hotspot-dev mailing list