aboutsummaryrefslogtreecommitdiff
path: root/src/lj_arch.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_arch.h')
-rw-r--r--src/lj_arch.h36
1 files changed, 26 insertions, 10 deletions
diff --git a/src/lj_arch.h b/src/lj_arch.h
index 54d5cd22..61c7e19f 100644
--- a/src/lj_arch.h
+++ b/src/lj_arch.h
@@ -210,13 +210,24 @@
210 210
211#elif LUAJIT_TARGET == LUAJIT_ARCH_PPC 211#elif LUAJIT_TARGET == LUAJIT_ARCH_PPC
212 212
213#define LJ_ARCH_NAME "ppc" 213#if __BYTE_ORDER__ != __ORDER_BIG_ENDIAN__
214#define LJ_ARCH_ENDIAN LUAJIT_LE
215#else
216#define LJ_ARCH_ENDIAN LUAJIT_BE
217#endif
218
214#if _LP64 219#if _LP64
215#define LJ_ARCH_BITS 64 220#define LJ_ARCH_BITS 64
221#if LJ_ARCH_ENDIAN == LUAJIT_LE
222#define LJ_ARCH_NAME "ppc64le"
223#else
224#define LJ_ARCH_NAME "ppc64"
225#endif
216#else 226#else
217#define LJ_ARCH_BITS 32 227#define LJ_ARCH_BITS 32
228#define LJ_ARCH_NAME "ppc"
218#endif 229#endif
219#define LJ_ARCH_ENDIAN LUAJIT_BE 230
220#define LJ_TARGET_PPC 1 231#define LJ_TARGET_PPC 1
221#define LJ_TARGET_EHRETREG 3 232#define LJ_TARGET_EHRETREG 3
222#define LJ_TARGET_JUMPRANGE 25 /* +-2^25 = +-32MB */ 233#define LJ_TARGET_JUMPRANGE 25 /* +-2^25 = +-32MB */
@@ -225,6 +236,15 @@
225#define LJ_TARGET_UNIFYROT 1 /* Want only IR_BROL. */ 236#define LJ_TARGET_UNIFYROT 1 /* Want only IR_BROL. */
226#define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL_SINGLE 237#define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL_SINGLE
227 238
239#if LJ_TARGET_CONSOLE
240#define LJ_ARCH_PPC32ON64 1
241#define LJ_ARCH_NOFFI 1
242#elif LJ_ARCH_BITS == 64
243#define LJ_ARCH_PPC64 1
244#define LJ_TARGET_GC64 1
245#define LJ_ARCH_NOJIT 1 /* NYI */
246#endif
247
228#if _ARCH_PWR7 248#if _ARCH_PWR7
229#define LJ_ARCH_VERSION 70 249#define LJ_ARCH_VERSION 70
230#elif _ARCH_PWR6 250#elif _ARCH_PWR6
@@ -238,10 +258,6 @@
238#else 258#else
239#define LJ_ARCH_VERSION 0 259#define LJ_ARCH_VERSION 0
240#endif 260#endif
241#if __PPC64__ || __powerpc64__ || LJ_TARGET_CONSOLE
242#define LJ_ARCH_PPC64 1
243#define LJ_ARCH_NOFFI 1
244#endif
245#if _ARCH_PPCSQ 261#if _ARCH_PPCSQ
246#define LJ_ARCH_SQRT 1 262#define LJ_ARCH_SQRT 1
247#endif 263#endif
@@ -345,11 +361,11 @@
345#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE) 361#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
346#error "No support for PowerPC CPUs without double-precision FPU" 362#error "No support for PowerPC CPUs without double-precision FPU"
347#endif 363#endif
348#if defined(_LITTLE_ENDIAN) 364#if !LJ_ARCH_PPC64 && LJ_ARCH_ENDIAN == LUAJIT_LE
349#error "No support for little-endian PowerPC" 365#error "No support for little-endian PPC32"
350#endif 366#endif
351#if defined(_LP64) 367#if LJ_ARCH_PPC64
352#error "No support for PowerPC 64 bit mode" 368#error "No support for PowerPC 64 bit mode (yet)"
353#endif 369#endif
354#ifdef __NO_FPRS__ 370#ifdef __NO_FPRS__
355#error "No support for PPC/e500 anymore (use LuaJIT 2.0)" 371#error "No support for PPC/e500 anymore (use LuaJIT 2.0)"