[aarch64-port-dev ] RFR: ldr/ldrw uses

edward.nevill at linaro.org edward.nevill at linaro.org
Thu Jul 18 06:46:36 PDT 2013


Hi,

The following are some cases where I think ldr() is used instead of ldrw().

Andrew: Could you take a look at these cases and check that they are correct.

Ta.
Ed.

--- CUT HERE ---
exporting patch:
# HG changeset patch
# User Edward Nevill ed at camswl.com
# Date 1374154688 -3600
# Node ID 38be985a8c70e486ec0f859f308e1eb400c0af5d
# Parent  7811cd57ac8ebbc7f89608495b0fca3d18c08386
Fix ldr/ldrw

diff -r 7811cd57ac8e -r 38be985a8c70 src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp
--- a/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp	Thu Jul 18 10:48:41 2013 +0100
+++ b/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp	Thu Jul 18 14:38:08 2013 +0100
@@ -789,7 +789,7 @@
         __ enter();
         OopMap* map = save_live_registers(sasm, 3);
         // Retrieve bci
-        __ ldr(bci, Address(rfp, 2*BytesPerWord));
+        __ ldrw(bci, Address(rfp, 2*BytesPerWord));
         // And a pointer to the Method*
         __ ldr(method, Address(rfp, 3*BytesPerWord));
         int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, counter_overflow), bci, method);
diff -r 7811cd57ac8e -r 38be985a8c70 src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp
--- a/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp	Thu Jul 18 10:48:41 2013 +0100
+++ b/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp	Thu Jul 18 14:38:08 2013 +0100
@@ -1033,7 +1033,7 @@
   {
     Label no_reguard;
     __ lea(rscratch1, Address(rthread, in_bytes(JavaThread::stack_guard_state_offset())));
-    __ ldr(rscratch1, Address(rscratch1));
+    __ ldrw(rscratch1, Address(rscratch1));
     __ cmp(rscratch1, JavaThread::stack_guard_yellow_disabled);
     __ br(Assembler::NE, no_reguard);
 
diff -r 7811cd57ac8e -r 38be985a8c70 src/cpu/aarch64/vm/templateTable_aarch64.cpp
--- a/src/cpu/aarch64/vm/templateTable_aarch64.cpp	Thu Jul 18 10:48:41 2013 +0100
+++ b/src/cpu/aarch64/vm/templateTable_aarch64.cpp	Thu Jul 18 14:38:08 2013 +0100
@@ -418,7 +418,7 @@
 #endif
   // itos JVM_CONSTANT_Integer only
   __ adds(r1, r2, r1, Assembler::LSL, 3);
-  __ ldr(r0, Address(r1, base_offset));
+  __ ldrw(r0, Address(r1, base_offset));
   __ push_i(r0);
   __ bind(Done);
 }
@@ -1716,7 +1716,7 @@
       // r2: scratch
       __ cbz(r0, dispatch);	// test result -- no osr if null
       // nmethod may have been invalidated (VM may block upon call_VM return)
-      __ ldr(r2, Address(r0, nmethod::entry_bci_offset()));
+      __ ldrw(r2, Address(r0, nmethod::entry_bci_offset()));
       // InvalidOSREntryBci == -2 which overflows cmpw as unsigned
       // use cmnw against -InvalidOSREntryBci which does the same thing
       __ cmn(r2, -InvalidOSREntryBci);
@@ -3218,7 +3218,7 @@
 void TemplateTable::arraylength() {
   transition(atos, itos);
   __ null_check(r0, arrayOopDesc::length_offset_in_bytes());
-  __ ldr(r0, Address(r0, arrayOopDesc::length_offset_in_bytes()));
+  __ ldrw(r0, Address(r0, arrayOopDesc::length_offset_in_bytes()));
 }
 
 void TemplateTable::checkcast()
--- CUT HERE ----



More information about the aarch64-port-dev mailing list