[Arm64] Update emitOutputInstr to support GC refs in ldp forms
authorSteve MacLean, Qualcomm Datacenter Technologies, Inc <sdmaclea@qti.qualcomm.com>
Wed, 26 Apr 2017 22:39:03 +0000 (22:39 +0000)
committerSteve MacLean, Qualcomm Datacenter Technologies, Inc <sdmaclea@qti.qualcomm.com>
Wed, 26 Apr 2017 22:40:29 +0000 (22:40 +0000)
Commit migrated from https://github.com/dotnet/coreclr/commit/47261a0e9b82b735d1efcbd8c0ca0a2a3a75b8c9

src/coreclr/src/jit/emitarm64.cpp

index 0328cb6..1a56e86 100644 (file)
@@ -9331,8 +9331,17 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)
         {
             // INS_ldp etc...
             // We assume that "idReg1" and "idReg2" are the destination register for all instructions
-            emitGCregDeadUpd(id->idReg1(), dst);
-            emitGCregDeadUpd(id->idReg2(), dst);
+            // TODO-ARM64-CQ: Current limitations only allows using ldp/stp when both of the GC types match
+            if (id->idGCref() != GCT_NONE)
+            {
+                emitGCregLiveUpd(id->idGCref(), id->idReg1(), dst);
+                emitGCregLiveUpd(id->idGCref(), id->idReg2(), dst);
+            }
+            else
+            {
+                emitGCregDeadUpd(id->idReg1(), dst);
+                emitGCregDeadUpd(id->idReg2(), dst);
+            }
         }
         else
         {