summaryrefslogtreecommitdiff
path: root/src/lj_arch.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_arch.h')
-rw-r--r--src/lj_arch.h65
1 files changed, 62 insertions, 3 deletions
diff --git a/src/lj_arch.h b/src/lj_arch.h
index 5f788502..476c1241 100644
--- a/src/lj_arch.h
+++ b/src/lj_arch.h
@@ -60,7 +60,7 @@
60/* Select native OS if no target OS defined. */ 60/* Select native OS if no target OS defined. */
61#ifndef LUAJIT_OS 61#ifndef LUAJIT_OS
62 62
63#if defined(_WIN32) 63#if defined(_WIN32) && !defined(_XBOX_VER)
64#define LUAJIT_OS LUAJIT_OS_WINDOWS 64#define LUAJIT_OS LUAJIT_OS_WINDOWS
65#elif defined(__linux__) 65#elif defined(__linux__)
66#define LUAJIT_OS LUAJIT_OS_LINUX 66#define LUAJIT_OS LUAJIT_OS_LINUX
@@ -100,6 +100,16 @@
100#define LJ_TARGET_POSIX (LUAJIT_OS > LUAJIT_OS_WINDOWS) 100#define LJ_TARGET_POSIX (LUAJIT_OS > LUAJIT_OS_WINDOWS)
101#define LJ_TARGET_DLOPEN LJ_TARGET_POSIX 101#define LJ_TARGET_DLOPEN LJ_TARGET_POSIX
102 102
103#ifdef __CELLOS_LV2__
104#define LJ_TARGET_PS3 1
105#define LJ_TARGET_CONSOLE 1
106#endif
107
108#if _XBOX_VER >= 200
109#define LJ_TARGET_XBOX360 1
110#define LJ_TARGET_CONSOLE 1
111#endif
112
103#define LJ_NUMMODE_SINGLE 0 /* Single-number mode only. */ 113#define LJ_NUMMODE_SINGLE 0 /* Single-number mode only. */
104#define LJ_NUMMODE_SINGLE_DUAL 1 /* Default to single-number mode. */ 114#define LJ_NUMMODE_SINGLE_DUAL 1 /* Default to single-number mode. */
105#define LJ_NUMMODE_DUAL 2 /* Dual-number mode only. */ 115#define LJ_NUMMODE_DUAL 2 /* Dual-number mode only. */
@@ -151,6 +161,16 @@
151#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */ 161#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */
152#define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL 162#define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL
153 163
164#if __ARM_ARCH_7__ || __ARM_ARCH_7A__ || __ARM_ARCH_7R__
165#define LJ_ARCH_VERSION 70
166#elif __ARM_ARCH_6T2__
167#define LJ_ARCH_VERSION 61
168#elif __ARM_ARCH_6__ || __ARM_ARCH_6J__ || __ARM_ARCH_6K__ || __ARM_ARCH_6Z__ || __ARM_ARCH_6ZK__
169#define LJ_ARCH_VERSION 60
170#else
171#define LJ_ARCH_VERSION 50
172#endif
173
154#elif LUAJIT_TARGET == LUAJIT_ARCH_PPC 174#elif LUAJIT_TARGET == LUAJIT_ARCH_PPC
155 175
156#define LJ_ARCH_NAME "ppc" 176#define LJ_ARCH_NAME "ppc"
@@ -165,6 +185,35 @@
165#define LJ_TARGET_UNIFYROT 1 /* Want only IR_BROL. */ 185#define LJ_TARGET_UNIFYROT 1 /* Want only IR_BROL. */
166#define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL_SINGLE 186#define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL_SINGLE
167 187
188#if _ARCH_PWR7
189#define LJ_ARCH_VERSION 70
190#elif _ARCH_PWR6
191#define LJ_ARCH_VERSION 60
192#elif _ARCH_PWR5X
193#define LJ_ARCH_VERSION 51
194#elif _ARCH_PWR5
195#define LJ_ARCH_VERSION 50
196#elif _ARCH_PWR4
197#define LJ_ARCH_VERSION 40
198#else
199#define LJ_ARCH_VERSION 0
200#endif
201#if __PPC64__ || __powerpc64__ || LJ_TARGET_XBOX360
202#define LJ_ARCH_PPC64 1
203#endif
204#if _ARCH_PPCSQ
205#define LJ_ARCH_SQRT 1
206#endif
207#if _ARCH_PPC5X
208#define LJ_ARCH_ROUND 1
209#endif
210#if __PPU__
211#define LJ_ARCH_CELL 1
212#endif
213#if LJ_TARGET_XBOX360
214#define LJ_ARCH_XENON 1
215#endif
216
168#elif LUAJIT_TARGET == LUAJIT_ARCH_PPCSPE 217#elif LUAJIT_TARGET == LUAJIT_ARCH_PPCSPE
169 218
170#define LJ_ARCH_NAME "ppcspe" 219#define LJ_ARCH_NAME "ppcspe"
@@ -202,6 +251,12 @@
202#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */ 251#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */
203#define LJ_ARCH_NUMMODE LJ_NUMMODE_SINGLE 252#define LJ_ARCH_NUMMODE LJ_NUMMODE_SINGLE
204 253
254#if _MIPS_ARCH_MIPS32R2
255#define LJ_ARCH_VERSION 20
256#else
257#define LJ_ARCH_VERSION 10
258#endif
259
205#else 260#else
206#error "No target architecture defined" 261#error "No target architecture defined"
207#endif 262#endif
@@ -240,6 +295,9 @@
240#if defined(__ARM_PCS_VFP) 295#if defined(__ARM_PCS_VFP)
241#error "No support for ARM hard-float ABI (yet)" 296#error "No support for ARM hard-float ABI (yet)"
242#endif 297#endif
298#if __ARM_ARCH_6M__ || __ARM_ARCH_7M__ || __ARM_ARCH_7EM__
299#error "No support for Cortex-M CPUs"
300#endif
243#if !(__ARM_EABI__ || LJ_TARGET_IOS) 301#if !(__ARM_EABI__ || LJ_TARGET_IOS)
244#error "Only ARM EABI or iOS 3.0+ ABI is supported" 302#error "Only ARM EABI or iOS 3.0+ ABI is supported"
245#endif 303#endif
@@ -269,8 +327,9 @@
269#define LJ_DUALNUM 0 327#define LJ_DUALNUM 0
270#endif 328#endif
271 329
272#if LJ_TARGET_IOS 330#if LJ_TARGET_IOS || LJ_TARGET_CONSOLE
273/* Runtime code generation is restricted on iOS. Complain to Apple, not me. */ 331/* Runtime code generation is restricted on iOS. Complain to Apple, not me. */
332/* Ditto for the consoles. Complain to Sony or MS, not me. */
274#ifndef LUAJIT_ENABLE_JIT 333#ifndef LUAJIT_ENABLE_JIT
275#define LJ_OS_NOJIT 1 334#define LJ_OS_NOJIT 1
276#endif 335#endif
@@ -320,7 +379,7 @@
320#define LUAJIT_NO_EXP2 379#define LUAJIT_NO_EXP2
321#endif 380#endif
322 381
323#if defined(__symbian__) || LJ_TARGET_IOS 382#if defined(__symbian__) || LJ_TARGET_IOS || LJ_TARGET_PS3
324#define LUAJIT_NO_UNWIND 383#define LUAJIT_NO_UNWIND
325#endif 384#endif
326 385