RyuJIT/ARM32: update lea lowering
authorMikhail Skvortcov <m.skvortcov@partner.samsung.com>
Mon, 30 Jan 2017 10:04:46 +0000 (13:04 +0300)
committerMikhail Skvortcov <m.skvortcov@partner.samsung.com>
Thu, 9 Feb 2017 08:21:12 +0000 (11:21 +0300)
Commit migrated from https://github.com/dotnet/coreclr/commit/b10a7429eb95d10020b9a16837d8ae8099aa4870

src/coreclr/src/jit/lsraarm.cpp

index affa1de..6ed6db6 100644 (file)
@@ -944,13 +944,17 @@ void Lowering::TreeNodeInfoInit(GenTree* tree)
             }
             info->dstCount = 1;
 
+            // On ARM we may need a single internal register
+            // (when both conditions are true then we still only need a single internal register)
             if ((index != nullptr) && (cns != 0))
             {
-                NYI_ARM("GT_LEA: index and cns are not nil");
+                // ARM does not support both Index and offset so we need an internal register
+                info->internalIntCount = 1;
             }
             else if (!emitter::emitIns_valid_imm_for_add(cns, INS_FLAGS_DONT_CARE))
             {
-                NYI_ARM("GT_LEA: invalid imm");
+                // This offset can't be contained in the add instruction, so we need an internal register
+                info->internalIntCount = 1;
             }
         }
         break;