[ARM64] Change INS_bkpt to INS_brk for INS_BREAKPOINT (#892)
authorLeslie Zhai <zhaixiang@loongson.cn>
Mon, 6 Jan 2020 18:10:42 +0000 (12:10 -0600)
committerBruce Forstall <brucefo@microsoft.com>
Mon, 6 Jan 2020 18:10:42 +0000 (10:10 -0800)
* [ARM64] Change INS_bkpt to INS_brk for INS_BREAKPOINT

https://github.com/dotnet/runtime/issues/606

* [ARM64] Change INS_bkpt to INS_brk for INS_BREAKPOINT

https://github.com/dotnet/runtime/issues/606

* [ARM64] Change INS_bkpt to INS_brk for INS_BREAKPOINT

https://github.com/dotnet/runtime/issues/606

* [ARM64] Change INS_bkpt to INS_brk for TARGET_UNIX

https://github.com/dotnet/runtime/issues/606

* [ARM64] Change INS_bkpt to INS_brk for TARGET_UNIX

https://github.com/dotnet/runtime/issues/606

* Fix formatting errors for INS_MULADD

src/coreclr/src/jit/codegenarm64.cpp
src/coreclr/src/jit/compiler.h
src/coreclr/src/jit/emitarm64.cpp

index 8444cb6..244e1b4 100644 (file)
@@ -1526,7 +1526,7 @@ BasicBlock* CodeGen::genCallFinally(BasicBlock* block)
 
         if ((block->bbNext == nullptr) || !BasicBlock::sameEHRegion(block, block->bbNext))
         {
-            instGen(INS_bkpt); // This should never get executed
+            instGen(INS_BREAKPOINT); // This should never get executed
         }
     }
     else
index 410ba96..1c8ff9a 100644 (file)
@@ -10589,8 +10589,12 @@ const instruction INS_SQRT = INS_vsqrt;
 
 #ifdef _TARGET_ARM64_
 
-const instruction INS_MULADD     = INS_madd;
+const instruction INS_MULADD = INS_madd;
+#if defined(_TARGET_UNIX_)
+const instruction INS_BREAKPOINT = INS_brk;
+#else
 const instruction INS_BREAKPOINT = INS_bkpt;
+#endif
 
 const instruction INS_ABS  = INS_fabs;
 const instruction INS_SQRT = INS_fsqrt;
index 6b1e59d..bbd15fc 100644 (file)
@@ -3368,7 +3368,10 @@ void emitter::emitIns(instruction ins)
     instrDesc* id  = emitNewInstrSmall(EA_8BYTE);
     insFormat  fmt = emitInsFormat(ins);
 
-    assert(fmt == IF_SN_0A);
+    if (ins != INS_BREAKPOINT)
+    {
+        assert(fmt == IF_SN_0A);
+    }
 
     id->idIns(ins);
     id->idInsFmt(fmt);
@@ -12555,7 +12558,7 @@ emitter::insExecutionCharacteristics emitter::getInsExecutionCharacteristics(ins
             }
             break;
 
-        case IF_SN_0A: // bkpt, nop
+        case IF_SN_0A: // bkpt, brk, nop
             result.insThroughput = PERFSCORE_THROUGHPUT_2X;
             result.insLatency    = PERFSCORE_LATENCY_ZERO;
             break;