mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 15:14:08 +00:00
MIPS: Add build rules (non-functional, yet).
This commit is contained in:
parent
b61be299c9
commit
b330b468b3
18
src/Makefile
18
src/Makefile
@ -54,6 +54,7 @@ CCOPT_X64=
|
||||
CCOPT_ARM=
|
||||
CCOPT_PPC=
|
||||
CCOPT_PPCSPE=
|
||||
CCOPT_MIPS=
|
||||
#
|
||||
CCDEBUG=
|
||||
# Uncomment the next line to generate debug information:
|
||||
@ -242,6 +243,13 @@ else
|
||||
ifneq (,$(findstring LJ_TARGET_PPCSPE ,$(TARGET_TESTARCH)))
|
||||
TARGET_CCARCH= ppcspe
|
||||
TARGET_XCFLAGS+= $(CCOPT_PPCSPE)
|
||||
else
|
||||
ifneq (,$(findstring LJ_TARGET_MIPS ,$(TARGET_TESTARCH)))
|
||||
ifneq (,$(findstring MIPSEL ,$(TARGET_TESTARCH)))
|
||||
TARGET_ARCH= -D__MIPSEL__=1
|
||||
endif
|
||||
TARGET_CCARCH= mips
|
||||
TARGET_XCFLAGS+= $(CCOPT_MIPS)
|
||||
else
|
||||
$(error Unsupported target architecture)
|
||||
endif
|
||||
@ -249,8 +257,9 @@ endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
TARGET_ARCH= $(patsubst %,-DLUAJIT_TARGET=LUAJIT_ARCH_%,$(TARGET_CCARCH))
|
||||
TARGET_ARCH+= $(patsubst %,-DLUAJIT_TARGET=LUAJIT_ARCH_%,$(TARGET_CCARCH))
|
||||
|
||||
ifneq (,$(PREFIX))
|
||||
ifneq (/usr/local,$(PREFIX))
|
||||
@ -353,6 +362,7 @@ DASM_FLAGS_X64WIN= -D X64 -D X64WIN
|
||||
DASM_FLAGS_ARM=
|
||||
DASM_FLAGS_PPC=
|
||||
DASM_FLAGS_PPCSPE=
|
||||
DASM_FLAGS_MIPS=
|
||||
|
||||
BUILDVM_O= buildvm.o buildvm_asm.o buildvm_peobj.o buildvm_lib.o buildvm_fold.o
|
||||
BUILDVM_T= buildvm
|
||||
@ -399,6 +409,7 @@ ALL_HDRGEN= lj_bcdef.h lj_ffdef.h lj_libdef.h lj_recdef.h lj_folddef.h
|
||||
ALL_GEN= $(LJVM_S) $(ALL_HDRGEN) $(LIB_VMDEFP)
|
||||
ALL_DYNGEN= buildvm_x86.h buildvm_x64.h buildvm_x64win.h buildvm_arm.h \
|
||||
buildvm_ppc.h buildvm_ppcspe.h
|
||||
###ALL_DYNGEN+= buildvm_mips.h
|
||||
WIN_RM= *.obj *.lib *.exp *.dll *.exe *.manifest *.pdb *.ilk
|
||||
ALL_RM= $(ALL_T) $(ALL_GEN) *.o $(WIN_RM)
|
||||
|
||||
@ -491,6 +502,7 @@ distclean: clean
|
||||
$(Q)$(DASM) $(DASM_DISTFLAGS) $(DASM_FLAGS_ARM) -o buildvm_arm.h buildvm_arm.dasc
|
||||
$(Q)$(DASM) $(DASM_DISTFLAGS) $(DASM_FLAGS_PPC) -o buildvm_ppc.h buildvm_ppc.dasc
|
||||
$(Q)$(DASM) $(DASM_DISTFLAGS) $(DASM_FLAGS_PPCSPE) -o buildvm_ppcspe.h buildvm_ppcspe.dasc
|
||||
@### $(Q)$(DASM) $(DASM_DISTFLAGS) $(DASM_FLAGS_MIPS) -o buildvm_mips.h buildvm_mips.dasc
|
||||
|
||||
depend:
|
||||
@for file in $(ALL_HDRGEN) $(ALL_DYNGEN); do \
|
||||
@ -536,6 +548,10 @@ buildvm_ppcspe.h: buildvm_ppcspe.dasc
|
||||
$(E) "DYNASM $@"
|
||||
$(Q)$(DASM) $(DASM_FLAGS) $(DASM_FLAGS_PPCSPE) -o $@ buildvm_ppcspe.dasc
|
||||
|
||||
buildvm_mips.h: buildvm_mips.dasc
|
||||
$(E) "DYNASM $@"
|
||||
$(Q)$(DASM) $(DASM_FLAGS) $(DASM_FLAGS_MIPS) -o $@ buildvm_mips.dasc
|
||||
|
||||
buildvm.o: $(ALL_DYNGEN) $(DASM_DIR)/dasm_*.h
|
||||
|
||||
$(BUILDVM_T): $(BUILDVM_O)
|
||||
|
@ -74,6 +74,9 @@ static int collect_reloc(BuildCtx *ctx, uint8_t *addr, int idx, int type);
|
||||
#elif LJ_TARGET_PPCSPE
|
||||
#include "../dynasm/dasm_ppc.h"
|
||||
#include "buildvm_ppcspe.h"
|
||||
#elif LJ_TARGET_MIPS
|
||||
#include "../dynasm/dasm_mips.h"
|
||||
#include "buildvm_mips.h"
|
||||
#else
|
||||
#error "No support for this architecture (yet)"
|
||||
#endif
|
||||
|
@ -119,6 +119,8 @@ static void emit_asm_wordreloc(BuildCtx *ctx, uint8_t *p, int n,
|
||||
ins, sym);
|
||||
exit(1);
|
||||
}
|
||||
#elif LJ_TARGET_MIPS
|
||||
UNUSED(sym); /* NYI */
|
||||
#else
|
||||
#error "missing relocation support for this architecture"
|
||||
#endif
|
||||
|
@ -614,6 +614,8 @@ static uint32_t jit_cpudetect(lua_State *L)
|
||||
#endif
|
||||
#elif LJ_TARGET_PPC || LJ_TARGET_PPCSPE
|
||||
/* Nothing to do. */
|
||||
#elif LJ_TARGET_MIPS
|
||||
/* NYI */
|
||||
#else
|
||||
#error "Missing CPU detection for this architecture"
|
||||
#endif
|
||||
|
@ -23,6 +23,8 @@
|
||||
#define LUAJIT_ARCH_ppc 4
|
||||
#define LUAJIT_ARCH_PPCSPE 5
|
||||
#define LUAJIT_ARCH_ppcspe 5
|
||||
#define LUAJIT_ARCH_MIPS 6
|
||||
#define LUAJIT_ARCH_mips 6
|
||||
|
||||
/* Target OS. */
|
||||
#define LUAJIT_OS_OTHER 0
|
||||
@ -47,6 +49,8 @@
|
||||
#else
|
||||
#define LUAJIT_TARGET LUAJIT_ARCH_PPC
|
||||
#endif
|
||||
#elif defined(__mips__) || defined(__mips) || defined(__MIPS__) || defined(__MIPS)
|
||||
#define LUAJIT_TARGET LUAJIT_ARCH_MIPS
|
||||
#else
|
||||
#error "No support for this architecture (yet)"
|
||||
#endif
|
||||
@ -182,6 +186,26 @@
|
||||
#define LJ_ARCH_NOFFI 1 /* NYI: comparisons, calls. */
|
||||
#define LJ_ARCH_NOJIT 1
|
||||
|
||||
#elif LUAJIT_TARGET == LUAJIT_ARCH_MIPS
|
||||
|
||||
#define LJ_ARCH_NAME "mips"
|
||||
#define LJ_ARCH_BITS 32
|
||||
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL)
|
||||
#define LJ_ARCH_ENDIAN LUAJIT_LE
|
||||
#else
|
||||
#define LJ_ARCH_ENDIAN LUAJIT_BE
|
||||
#endif
|
||||
#define LJ_ARCH_HASFPU 1
|
||||
#define LJ_TARGET_MIPS 1
|
||||
#define LJ_TARGET_EHRETREG 4
|
||||
#define LJ_TARGET_JUMPRANGE 27 /* 2*2^27 = 256MB-aligned region */
|
||||
#define LJ_TARGET_MASKSHIFT 1
|
||||
#define LJ_TARGET_MASKROT 1
|
||||
#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */
|
||||
#define LJ_ARCH_NUMMODE LJ_NUMMODE_SINGLE
|
||||
#define LJ_ARCH_NOFFI 1
|
||||
#define LJ_ARCH_NOJIT 1
|
||||
|
||||
#else
|
||||
#error "No target architecture defined"
|
||||
#endif
|
||||
|
@ -117,6 +117,16 @@ enum {
|
||||
#define CFRAME_OFS_MULTRES 8
|
||||
#define CFRAME_SIZE 184
|
||||
#define CFRAME_SHIFT_MULTRES 3
|
||||
#elif LJ_TARGET_MIPS
|
||||
/* NYI: Dummy definitions for now. */
|
||||
#define CFRAME_OFS_ERRF 0
|
||||
#define CFRAME_OFS_NRES 0
|
||||
#define CFRAME_OFS_PREV 0
|
||||
#define CFRAME_OFS_L 0
|
||||
#define CFRAME_OFS_PC 0
|
||||
#define CFRAME_OFS_MULTRES 0
|
||||
#define CFRAME_SIZE 256
|
||||
#define CFRAME_SHIFT_MULTRES 3
|
||||
#else
|
||||
#error "Missing CFRAME_* definitions for this architecture"
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user