summaryrefslogtreecommitdiff
path: root/src/jit/lsraarmarch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/jit/lsraarmarch.cpp')
-rw-r--r--src/jit/lsraarmarch.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/jit/lsraarmarch.cpp b/src/jit/lsraarmarch.cpp
index 7d999d880f..f661babc5b 100644
--- a/src/jit/lsraarmarch.cpp
+++ b/src/jit/lsraarmarch.cpp
@@ -784,15 +784,24 @@ void Lowering::TreeNodeInfoInitBlockStore(GenTreeBlk* blkNode)
if (blkNode->OperGet() == GT_STORE_OBJ)
{
// CopyObj
- NYI_ARM("GT_STORE_OBJ is needed of write barriers implementation");
-
-#ifdef _TARGET_ARM64_
-
// We don't need to materialize the struct size but we still need
// a temporary register to perform the sequence of loads and stores.
blkNode->gtLsraInfo.internalIntCount = 1;
+ if (size >= 2 * REGSIZE_BYTES)
+ {
+ // We will use ldp/stp to reduce code size and improve performance
+ // so we need to reserve an extra internal register
+ blkNode->gtLsraInfo.internalIntCount++;
+ }
+
+ // We can't use the special Write Barrier registers, so exclude them from the mask
+ regMaskTP internalIntCandidates = RBM_ALLINT & ~(RBM_WRITE_BARRIER_DST_BYREF | RBM_WRITE_BARRIER_SRC_BYREF);
+ blkNode->gtLsraInfo.setInternalCandidates(l, internalIntCandidates);
+
+ // If we have a dest address we want it in RBM_WRITE_BARRIER_DST_BYREF.
dstAddr->gtLsraInfo.setSrcCandidates(l, RBM_WRITE_BARRIER_DST_BYREF);
+
// If we have a source address we want it in REG_WRITE_BARRIER_SRC_BYREF.
// Otherwise, if it is a local, codegen will put its address in REG_WRITE_BARRIER_SRC_BYREF,
// which is killed by a StoreObj (and thus needn't be reserved).
@@ -800,8 +809,6 @@ void Lowering::TreeNodeInfoInitBlockStore(GenTreeBlk* blkNode)
{
srcAddrOrFill->gtLsraInfo.setSrcCandidates(l, RBM_WRITE_BARRIER_SRC_BYREF);
}
-
-#endif // _TARGET_ARM64_
}
else
{
@@ -824,7 +831,8 @@ void Lowering::TreeNodeInfoInitBlockStore(GenTreeBlk* blkNode)
if (size >= 2 * REGSIZE_BYTES)
{
- // Use ldp/stp to reduce code size and improve performance
+ // We will use ldp/stp to reduce code size and improve performance
+ // so we need to reserve an extra internal register
internalIntCount++;
}