< prev index next >

src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp

Print this page
rev 6466 : 8165673: AArch64: Fix JNI floating point argument handling
Reviewed-by: aph, adinn
Contributed-by: ningsheng.jian@linaro.org

@@ -976,11 +976,20 @@
   }
 }
 
 // A float arg may have to do float reg int reg conversion
 static void float_move(MacroAssembler* masm, VMRegPair src, VMRegPair dst) {
-  if (src.first() != dst.first()) {
+  assert(src.first()->is_stack() && dst.first()->is_stack() ||                 
+         src.first()->is_reg() && dst.first()->is_reg(), "Unexpected error");  
+  if (src.first()->is_stack()) {                                               
+    if (dst.first()->is_stack()) {                                             
+      __ ldrw(rscratch1, Address(rfp, reg2offset_in(src.first())));            
+      __ strw(rscratch1, Address(sp, reg2offset_out(dst.first())));            
+    } else {                                                                   
+      ShouldNotReachHere();                                                    
+    }                                                                          
+  } else if (src.first() != dst.first()) {
     if (src.is_single_phys_reg() && dst.is_single_phys_reg())
       __ fmovs(dst.first()->as_FloatRegister(), src.first()->as_FloatRegister());
     else
       ShouldNotReachHere();
   }

@@ -1010,11 +1019,20 @@
 }
 
 
 // A double move
 static void double_move(MacroAssembler* masm, VMRegPair src, VMRegPair dst) {
-  if (src.first() != dst.first()) {
+  assert(src.first()->is_stack() && dst.first()->is_stack() ||                 
+         src.first()->is_reg() && dst.first()->is_reg(), "Unexpected error");
+  if (src.first()->is_stack()) {
+    if (dst.first()->is_stack()) {
+      __ ldr(rscratch1, Address(rfp, reg2offset_in(src.first())));
+      __ str(rscratch1, Address(sp, reg2offset_out(dst.first())));
+    } else {
+      ShouldNotReachHere(); 
+    }
+  } else if (src.first() != dst.first()) {
     if (src.is_single_phys_reg() && dst.is_single_phys_reg())
       __ fmovd(dst.first()->as_FloatRegister(), src.first()->as_FloatRegister());
     else
       ShouldNotReachHere();
   }
< prev index next >