LoongArch64: Add support for LuaJIT VM builder

Co-developed-by: Qiqi Huang <huangqiqi@loongson.cn>
This commit is contained in:
Xiaolin Zhao 2022-07-27 18:35:18 +08:00
parent fbb0994c6f
commit 052d7ec1d7
2 changed files with 11 additions and 0 deletions

View File

@ -67,6 +67,8 @@ static int collect_reloc(BuildCtx *ctx, uint8_t *addr, int idx, int type);
#include "../dynasm/dasm_ppc.h" #include "../dynasm/dasm_ppc.h"
#elif LJ_TARGET_MIPS #elif LJ_TARGET_MIPS
#include "../dynasm/dasm_mips.h" #include "../dynasm/dasm_mips.h"
#elif LJ_TARGET_LOONGARCH64
#include "../dynasm/dasm_loongarch64.h"
#else #else
#error "No support for this architecture (yet)" #error "No support for this architecture (yet)"
#endif #endif

View File

@ -156,6 +156,15 @@ static void emit_asm_wordreloc(BuildCtx *ctx, uint8_t *p, int n,
"Error: unsupported opcode %08x for %s symbol relocation.\n", "Error: unsupported opcode %08x for %s symbol relocation.\n",
ins, sym); ins, sym);
exit(1); exit(1);
#elif LJ_TARGET_LOONGARCH64
if ((ins >> 26) == 21) {
fprintf(ctx->fp, "\tbl %s\n", sym);
} else {
fprintf(stderr,
"Error: unsupported opcode %08x for %s symbol relocation.\n",
ins, sym);
exit(1);
}
#else #else
#error "missing relocation support for this architecture" #error "missing relocation support for this architecture"
#endif #endif