From a526110823f10c503682db2be1d23be5a39a39f9 Mon Sep 17 00:00:00 2001 From: qiaopengcheng Date: Fri, 10 Jun 2022 11:45:06 +0800 Subject: [PATCH] [LoongArch64] Fixed the compiling error for #69041. --- src/coreclr/jit/codegenloongarch64.cpp | 12 ++++++++++++ src/coreclr/jit/emitloongarch64.cpp | 2 +- src/coreclr/jit/emitloongarch64.h | 6 ++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/coreclr/jit/codegenloongarch64.cpp b/src/coreclr/jit/codegenloongarch64.cpp index 67d64db8c6a82..7f85403db4017 100644 --- a/src/coreclr/jit/codegenloongarch64.cpp +++ b/src/coreclr/jit/codegenloongarch64.cpp @@ -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: diff --git a/src/coreclr/jit/emitloongarch64.cpp b/src/coreclr/jit/emitloongarch64.cpp index 8e3802123dd5a..57987606a903c 100644 --- a/src/coreclr/jit/emitloongarch64.cpp +++ b/src/coreclr/jit/emitloongarch64.cpp @@ -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; diff --git a/src/coreclr/jit/emitloongarch64.h b/src/coreclr/jit/emitloongarch64.h index d7e7cc5450acb..da24986527182 100644 --- a/src/coreclr/jit/emitloongarch64.h +++ b/src/coreclr/jit/emitloongarch64.h @@ -133,6 +133,12 @@ inline static bool isFloatReg(regNumber reg) return (reg >= REG_FP_FIRST && reg <= REG_FP_LAST); } +/************************************************************************/ +/* Output target-independent instructions */ +/************************************************************************/ + +void emitIns_J(instruction ins, BasicBlock* dst, int instrCount = 0); + /************************************************************************/ /* The public entry points to output instructions */ /************************************************************************/