aboutsummaryrefslogtreecommitdiff
path: root/src/lj_arch.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lj_arch.h48
1 files changed, 37 insertions, 11 deletions
diff --git a/src/lj_arch.h b/src/lj_arch.h
index 3c3c98b1..bbcdc739 100644
--- a/src/lj_arch.h
+++ b/src/lj_arch.h
@@ -25,6 +25,10 @@
25#define LUAJIT_ARCH_ppc 5 25#define LUAJIT_ARCH_ppc 5
26#define LUAJIT_ARCH_MIPS 6 26#define LUAJIT_ARCH_MIPS 6
27#define LUAJIT_ARCH_mips 6 27#define LUAJIT_ARCH_mips 6
28#define LUAJIT_ARCH_MIPS32 6
29#define LUAJIT_ARCH_mips32 6
30#define LUAJIT_ARCH_MIPS64 7
31#define LUAJIT_ARCH_mips64 7
28 32
29/* Target OS. */ 33/* Target OS. */
30#define LUAJIT_OS_OTHER 0 34#define LUAJIT_OS_OTHER 0
@@ -47,8 +51,10 @@
47#define LUAJIT_TARGET LUAJIT_ARCH_ARM64 51#define LUAJIT_TARGET LUAJIT_ARCH_ARM64
48#elif defined(__ppc__) || defined(__ppc) || defined(__PPC__) || defined(__PPC) || defined(__powerpc__) || defined(__powerpc) || defined(__POWERPC__) || defined(__POWERPC) || defined(_M_PPC) 52#elif defined(__ppc__) || defined(__ppc) || defined(__PPC__) || defined(__PPC) || defined(__powerpc__) || defined(__powerpc) || defined(__POWERPC__) || defined(__POWERPC) || defined(_M_PPC)
49#define LUAJIT_TARGET LUAJIT_ARCH_PPC 53#define LUAJIT_TARGET LUAJIT_ARCH_PPC
54#elif defined(__mips64__) || defined(__mips64) || defined(__MIPS64__) || defined(__MIPS64)
55#define LUAJIT_TARGET LUAJIT_ARCH_MIPS64
50#elif defined(__mips__) || defined(__mips) || defined(__MIPS__) || defined(__MIPS) 56#elif defined(__mips__) || defined(__mips) || defined(__MIPS__) || defined(__MIPS)
51#define LUAJIT_TARGET LUAJIT_ARCH_MIPS 57#define LUAJIT_TARGET LUAJIT_ARCH_MIPS32
52#else 58#else
53#error "No support for this architecture (yet)" 59#error "No support for this architecture (yet)"
54#endif 60#endif
@@ -289,13 +295,21 @@
289#define LJ_ARCH_XENON 1 295#define LJ_ARCH_XENON 1
290#endif 296#endif
291 297
292#elif LUAJIT_TARGET == LUAJIT_ARCH_MIPS 298#elif LUAJIT_TARGET == LUAJIT_ARCH_MIPS32 || LUAJIT_TARGET == LUAJIT_ARCH_MIPS64
293 299
294#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) 300#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL)
301#if LUAJIT_TARGET == LUAJIT_ARCH_MIPS32
295#define LJ_ARCH_NAME "mipsel" 302#define LJ_ARCH_NAME "mipsel"
303#else
304#define LJ_ARCH_NAME "mips64el"
305#endif
296#define LJ_ARCH_ENDIAN LUAJIT_LE 306#define LJ_ARCH_ENDIAN LUAJIT_LE
297#else 307#else
308#if LUAJIT_TARGET == LUAJIT_ARCH_MIPS32
298#define LJ_ARCH_NAME "mips" 309#define LJ_ARCH_NAME "mips"
310#else
311#define LJ_ARCH_NAME "mips64"
312#endif
299#define LJ_ARCH_ENDIAN LUAJIT_BE 313#define LJ_ARCH_ENDIAN LUAJIT_BE
300#endif 314#endif
301 315
@@ -307,11 +321,6 @@
307#endif 321#endif
308#endif 322#endif
309 323
310/* Temporarily disable features until the code has been merged. */
311#if !defined(LUAJIT_NO_UNWIND) && __GNU_COMPACT_EH__
312#define LUAJIT_NO_UNWIND 1
313#endif
314
315#if !defined(LJ_ABI_SOFTFP) 324#if !defined(LJ_ABI_SOFTFP)
316#ifdef __mips_soft_float 325#ifdef __mips_soft_float
317#define LJ_ABI_SOFTFP 1 326#define LJ_ABI_SOFTFP 1
@@ -320,7 +329,15 @@
320#endif 329#endif
321#endif 330#endif
322 331
332#if LUAJIT_TARGET == LUAJIT_ARCH_MIPS32
323#define LJ_ARCH_BITS 32 333#define LJ_ARCH_BITS 32
334#define LJ_TARGET_MIPS32 1
335#else
336#define LJ_ARCH_BITS 64
337#define LJ_TARGET_MIPS64 1
338#define LJ_TARGET_GC64 1
339#define LJ_ARCH_NOJIT 1 /* NYI */
340#endif
324#define LJ_TARGET_MIPS 1 341#define LJ_TARGET_MIPS 1
325#define LJ_TARGET_EHRETREG 4 342#define LJ_TARGET_EHRETREG 4
326#define LJ_TARGET_JUMPRANGE 27 /* 2*2^27 = 256MB-aligned region */ 343#define LJ_TARGET_JUMPRANGE 27 /* 2*2^27 = 256MB-aligned region */
@@ -329,7 +346,7 @@
329#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */ 346#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */
330#define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL 347#define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL
331 348
332#if _MIPS_ARCH_MIPS32R2 349#if _MIPS_ARCH_MIPS32R2 || _MIPS_ARCH_MIPS64R2
333#define LJ_ARCH_VERSION 20 350#define LJ_ARCH_VERSION 20
334#else 351#else
335#define LJ_ARCH_VERSION 10 352#define LJ_ARCH_VERSION 10
@@ -410,9 +427,13 @@
410#ifdef __NO_FPRS__ 427#ifdef __NO_FPRS__
411#error "No support for PPC/e500 anymore (use LuaJIT 2.0)" 428#error "No support for PPC/e500 anymore (use LuaJIT 2.0)"
412#endif 429#endif
413#elif LJ_TARGET_MIPS 430#elif LJ_TARGET_MIPS32
414#if defined(_LP64) 431#if _MIPS_SIM != _MIPS_SIM_ABI32
415#error "No support for MIPS64" 432#error "Only o32 ABI supported for MIPS32"
433#endif
434#elif LJ_TARGET_MIPS64
435#if _MIPS_SIM != _MIPS_SIM_ABI64
436#error "Only n64 ABI supported for MIPS64"
416#endif 437#endif
417#endif 438#endif
418#endif 439#endif
@@ -524,6 +545,11 @@
524#define LJ_NO_SYSTEM 1 545#define LJ_NO_SYSTEM 1
525#endif 546#endif
526 547
548#if !defined(LUAJIT_NO_UNWIND) && __GNU_COMPACT_EH__
549/* NYI: no support for compact unwind specification, yet. */
550#define LUAJIT_NO_UNWIND 1
551#endif
552
527#if defined(LUAJIT_NO_UNWIND) || defined(__symbian__) || LJ_TARGET_IOS || LJ_TARGET_PS3 || LJ_TARGET_PS4 553#if defined(LUAJIT_NO_UNWIND) || defined(__symbian__) || LJ_TARGET_IOS || LJ_TARGET_PS3 || LJ_TARGET_PS4
528#define LJ_NO_UNWIND 1 554#define LJ_NO_UNWIND 1
529#endif 555#endif