Address review feedback
authorSteve MacLean, Qualcomm Datacenter Technologies, Inc <sdmaclea@qti.qualcomm.com>
Fri, 7 Apr 2017 15:10:33 +0000 (15:10 +0000)
committerSteve MacLean, Qualcomm Datacenter Technologies, Inc <sdmaclea@qti.qualcomm.com>
Fri, 7 Apr 2017 16:07:54 +0000 (16:07 +0000)
Commit migrated from https://github.com/dotnet/coreclr/commit/d5d141545cbe7aea82c59b8e90748dadb4848bb9

src/coreclr/src/jit/codegenarm64.cpp

index 32f6117..f1a900d 100644 (file)
@@ -3381,8 +3381,18 @@ void CodeGen::genCodeForLoadOffset(instruction ins, emitAttr size, regNumber dst
 //   offset: distance from the base from which to load
 void CodeGen::genCodeForStoreOffset(instruction ins, emitAttr size, regNumber src, GenTree* base, unsigned offset)
 {
-    // For arm64 these functions are identical
-    genCodeForLoadOffset(ins, size, src, base, offset);
+    emitter* emit = getEmitter();
+
+    if (base->OperIsLocalAddr())
+    {
+        if (base->gtOper == GT_LCL_FLD_ADDR)
+            offset += base->gtLclFld.gtLclOffs;
+        emit->emitIns_S_R(ins, size, src, base->gtLclVarCommon.gtLclNum, offset);
+    }
+    else
+    {
+        emit->emitIns_R_R_I(ins, size, src, base->gtRegNum, offset);
+    }
 }
 
 // Generates CpBlk code by performing a loop unroll
@@ -3451,7 +3461,7 @@ void CodeGen::genCodeForCpBlkUnroll(GenTreeBlk* cpBlkNode)
         }
     }
 
-    // Fill the remainder (15 bytes or less) if there's one.
+    // Fill the remainder (7 bytes or less) if there's one.
     if ((size & 0x7) != 0)
     {
         if ((size & 4) != 0)