[LoongArch64] Fixed the compiling error for #69041. (#70544)
authorQiao Pengcheng <qiaopengcheng@loongson.cn>
Fri, 10 Jun 2022 13:52:53 +0000 (21:52 +0800)
committerGitHub <noreply@github.com>
Fri, 10 Jun 2022 13:52:53 +0000 (06:52 -0700)
src/coreclr/jit/codegenloongarch64.cpp
src/coreclr/jit/emitloongarch64.cpp
src/coreclr/jit/emitloongarch64.h

index 67d64db..7f85403 100644 (file)
@@ -1655,6 +1655,18 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 */
 
+//------------------------------------------------------------------------
+// inst_JMP: Generate a jump instruction.
+//
+void CodeGen::inst_JMP(emitJumpKind jmp, BasicBlock* tgtBlock)
+{
+#if !FEATURE_FIXED_OUT_ARGS
+    assert((tgtBlock->bbTgtStkDepth * sizeof(int) == genStackLevel) || isFramePointerUsed());
+#endif // !FEATURE_FIXED_OUT_ARGS
+
+    GetEmitter()->emitIns_J(emitter::emitJumpKindToIns(jmp), tgtBlock);
+}
+
 BasicBlock* CodeGen::genCallFinally(BasicBlock* block)
 {
     // Generate a call to the finally, like this:
index 8e38021..5798760 100644 (file)
@@ -3912,7 +3912,7 @@ static const char* const RegNames[] =
 
 void emitter::emitDisInsName(code_t code, const BYTE* addr, instrDesc* id)
 {
-    const BYTE*       insAdr      = addr;
+    const BYTE*       insAdr      = addr - writeableOffset;
     const char* const CFregName[] = {"fcc0", "fcc1", "fcc2", "fcc3", "fcc4", "fcc5", "fcc6", "fcc7"};
 
     unsigned int opcode = (code >> 26) & 0x3f;
index d7e7cc5..da24986 100644 (file)
@@ -134,6 +134,12 @@ inline static bool isFloatReg(regNumber reg)
 }
 
 /************************************************************************/
+/*                   Output target-independent instructions             */
+/************************************************************************/
+
+void emitIns_J(instruction ins, BasicBlock* dst, int instrCount = 0);
+
+/************************************************************************/
 /*           The public entry points to output instructions             */
 /************************************************************************/