[aarch64-port-dev ] RFR: 8207838: AArch64: fix the order in which float registers are restored in restore_args

Yangfei (Felix) felix.yang at huawei.com
Thu Jul 19 07:39:14 UTC 2018


Hi,

    JIRA: https://bugs.openjdk.java.net/browse/JDK-8207838
    JIT code snippet of the native wrapper: 

    178   0x0000007f7857f438: str       d0, [sp,#-16]!      <==== save_args
    179   0x0000007f7857f43c: str       d1, [sp,#-16]!
    180   0x0000007f7857f440: str       d2, [sp,#-16]!
    181   0x0000007f7857f444: str       d3, [sp,#-16]!
    182   0x0000007f7857f448: stp       x1, xzr, [sp,#-16]!
    183   0x0000007f7857f44c: mov       x0, x19
    184   0x0000007f7857f450: mov       x1, x13
    185   0x0000007f7857f454: mov       x2, x28
    186   0x0000007f7857f458: stp       x8, x12, [sp,#-16]!
    187   0x0000007f7857f45c: mov       x8, #0xc560                     // #50528
    188   0x0000007f7857f460: movk      x8, #0x8dc8, lsl #16
    189   0x0000007f7857f464: movk      x8, #0x7f, lsl #32
    190   0x0000007f7857f468: blr       x8
    191   0x0000007f7857f46c: ldp       x8, x12, [sp],#16
    192   0x0000007f7857f470: isb
    193   0x0000007f7857f474: ldp       x1, xzr, [sp],#16
    194   0x0000007f7857f478: ldr       d0, [sp],#16         <==== restore_args
    195   0x0000007f7857f47c: ldr       d1, [sp],#16
    196   0x0000007f7857f480: ldr       d2, [sp],#16
    197   0x0000007f7857f484: ldr       d3, [sp],#16

    Here the order in which float registers are restored in restore_args does not match save_args in sharedRuntime_aarch64.cpp. 
    Patch contributed by guoge1 at huawei.com: 

diff -r a25c48c0a1ab src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp 
--- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp Mon Jul 16 15:09:19 2018 -0700 
+++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp Thu Jul 19 15:14:08 2018 +0800 
@@ -1107,7 +1107,7 @@ 
     } 
   } 
   __ pop(x, sp); 
- for ( int i = first_arg ; i < arg_count ; i++ ) { 
+ for ( int i = arg_count - 1 ; i >= first_arg ; i-- ) { 
     if (args[i].first()->is_Register()) { 
       ; 
     } else if (args[i].first()->is_FloatRegister()) {

    Tested with jtreg hotspot. Will post a valid webrev later. 
    Is it OK for jdk/jdk11? 

Thanks,
Felix



More information about the aarch64-port-dev mailing list