Enable the !LJ_GC64 PPC interpreter on PPC64.

This also adds a bit of plumbing to recognize ELF v2 ABI (which is NYI).
Since P64 no longer implies TOC, make TOC (and TOCENV) an independent define
passed to DynAsm from lj_arch.h.
This commit is contained in:
Marcin Kościelnicki 2016-03-08 01:45:40 +01:00
parent 8d1fb7131d
commit 47ed69b8a0
3 changed files with 27 additions and 10 deletions

View File

@ -450,7 +450,16 @@ ifeq (ppc,$(TARGET_LJARCH))
DASM_AFLAGS+= -D GPR64
endif
ifeq (PS3,$(TARGET_SYS))
DASM_AFLAGS+= -D PPE -D TOC
DASM_AFLAGS+= -D PPE
endif
ifneq (,$(findstring LJ_ARCH_PPC_TOC 1,$(TARGET_TESTARCH)))
DASM_AFLAGS+= -D TOC
endif
ifneq (,$(findstring LJ_ARCH_PPC_TOCENV 1,$(TARGET_TESTARCH)))
DASM_AFLAGS+= -D TOCENV
endif
ifneq (,$(findstring LJ_ARCH_PPC_ELFV2 1,$(TARGET_TESTARCH)))
DASM_AFLAGS+= -D ELFV2
endif
ifneq (,$(findstring LJ_ARCH_PPC64 ,$(TARGET_TESTARCH)))
DASM_ARCH= ppc64

View File

@ -263,10 +263,19 @@
#if LJ_TARGET_CONSOLE
#define LJ_ARCH_PPC32ON64 1
#define LJ_ARCH_NOFFI 1
#if LJ_TARGET_PS3
#define LJ_ARCH_PPC_TOC 1
#endif
#elif LJ_ARCH_BITS == 64
#define LJ_ARCH_PPC64 1
#define LJ_TARGET_GC64 1
#define LJ_ARCH_PPC32ON64 1
#define LJ_ARCH_NOJIT 1 /* NYI */
#define LJ_ARCH_NOFFI 1 /* NYI */
#if _CALL_ELF == 2
#define LJ_ARCH_PPC_ELFV2 1
#else
#define LJ_ARCH_PPC_TOC 1
#define LJ_ARCH_PPC_TOCENV 1
#endif
#endif
#if _ARCH_PWR7
@ -418,11 +427,11 @@
#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
#error "No support for PowerPC CPUs without double-precision FPU"
#endif
#if !LJ_ARCH_PPC64 && LJ_ARCH_ENDIAN == LUAJIT_LE
#error "No support for little-endian PPC32"
#if LJ_ARCH_ENDIAN == LUAJIT_LE
#error "No support for little-endian PPC"
#endif
#if LJ_ARCH_PPC64
#error "No support for PowerPC 64 bit mode (yet)"
#if LJ_ARCH_PPC_ELFV2
#error "No support for PPC ELFv2"
#endif
#ifdef __NO_FPRS__
#error "No support for PPC/e500 anymore (use LuaJIT 2.0)"

View File

@ -25,12 +25,11 @@
|// TOC Need table of contents (64 bit or 32 bit variant, e.g. PS3).
|// Function pointers are really a struct: code, TOC, env (optional).
|// TOCENV Function pointers have an environment pointer, too (not on PS3).
|// ELFV2 The 64-bit ELF V2 ABI is in use.
|// PPE Power Processor Element of Cell (PS3) or Xenon (Xbox 360).
|// Must avoid (slow) micro-coded instructions.
|
|.if P64
|.define TOC, 1
|.define TOCENV, 1
|.macro lpx, a, b, c; ldx a, b, c; .endmacro
|.macro lp, a, b; ld a, b; .endmacro
|.macro stp, a, b; std a, b; .endmacro
@ -49,7 +48,7 @@
|// Convenience macros for TOC handling.
|.if TOC
|// Linker needs a TOC patch area for every external call relocation.
|.macro blex, target; bl extern target@plt; nop; .endmacro
|.macro blex, target; bl extern target; nop; .endmacro
|.macro .toc, a, b; a, b; .endmacro
|.if P64
|.define TOC_OFS, 8