aboutsummaryrefslogtreecommitdiff
path: root/src/lj_arch.h
diff options
context:
space:
mode:
authorMike Pall <mike>2020-01-20 22:15:45 +0100
committerMike Pall <mike>2020-01-20 22:15:45 +0100
commit94d0b53004a5fa368defa4307a17edcdb87fe727 (patch)
tree2468fb7d60f39ccadcd696d333c83ef49f3dfc02 /src/lj_arch.h
parentdfa692b746c9de067857d5fc992a41730be3d99a (diff)
downloadluajit-94d0b53004a5fa368defa4307a17edcdb87fe727.tar.gz
luajit-94d0b53004a5fa368defa4307a17edcdb87fe727.tar.bz2
luajit-94d0b53004a5fa368defa4307a17edcdb87fe727.zip
MIPS: Add MIPS64 R6 port.
Contributed by Hua Zhang, YunQiang Su from Wave Computing, and Radovan Birdic from RT-RK. Sponsored by Wave Computing.
Diffstat (limited to 'src/lj_arch.h')
-rw-r--r--src/lj_arch.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/lj_arch.h b/src/lj_arch.h
index 903d6c64..cd1a0568 100644
--- a/src/lj_arch.h
+++ b/src/lj_arch.h
@@ -330,18 +330,38 @@
330#elif LUAJIT_TARGET == LUAJIT_ARCH_MIPS32 || LUAJIT_TARGET == LUAJIT_ARCH_MIPS64 330#elif LUAJIT_TARGET == LUAJIT_ARCH_MIPS32 || LUAJIT_TARGET == LUAJIT_ARCH_MIPS64
331 331
332#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) 332#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL)
333#if __mips_isa_rev >= 6
334#define LJ_TARGET_MIPSR6 1
335#define LJ_TARGET_UNALIGNED 1
336#endif
333#if LUAJIT_TARGET == LUAJIT_ARCH_MIPS32 337#if LUAJIT_TARGET == LUAJIT_ARCH_MIPS32
338#if LJ_TARGET_MIPSR6
339#define LJ_ARCH_NAME "mips32r6el"
340#else
334#define LJ_ARCH_NAME "mipsel" 341#define LJ_ARCH_NAME "mipsel"
342#endif
343#else
344#if LJ_TARGET_MIPSR6
345#define LJ_ARCH_NAME "mips64r6el"
335#else 346#else
336#define LJ_ARCH_NAME "mips64el" 347#define LJ_ARCH_NAME "mips64el"
337#endif 348#endif
349#endif
338#define LJ_ARCH_ENDIAN LUAJIT_LE 350#define LJ_ARCH_ENDIAN LUAJIT_LE
339#else 351#else
340#if LUAJIT_TARGET == LUAJIT_ARCH_MIPS32 352#if LUAJIT_TARGET == LUAJIT_ARCH_MIPS32
353#if LJ_TARGET_MIPSR6
354#define LJ_ARCH_NAME "mips32r6"
355#else
341#define LJ_ARCH_NAME "mips" 356#define LJ_ARCH_NAME "mips"
357#endif
358#else
359#if LJ_TARGET_MIPSR6
360#define LJ_ARCH_NAME "mips64r6"
342#else 361#else
343#define LJ_ARCH_NAME "mips64" 362#define LJ_ARCH_NAME "mips64"
344#endif 363#endif
364#endif
345#define LJ_ARCH_ENDIAN LUAJIT_BE 365#define LJ_ARCH_ENDIAN LUAJIT_BE
346#endif 366#endif
347 367
@@ -377,7 +397,9 @@
377#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */ 397#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */
378#define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL 398#define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL
379 399
380#if _MIPS_ARCH_MIPS32R2 || _MIPS_ARCH_MIPS64R2 400#if LJ_TARGET_MIPSR6
401#define LJ_ARCH_VERSION 60
402#elif _MIPS_ARCH_MIPS32R2 || _MIPS_ARCH_MIPS64R2
381#define LJ_ARCH_VERSION 20 403#define LJ_ARCH_VERSION 20
382#else 404#else
383#define LJ_ARCH_VERSION 10 405#define LJ_ARCH_VERSION 10
@@ -453,8 +475,13 @@
453#if !((defined(_MIPS_SIM_ABI32) && _MIPS_SIM == _MIPS_SIM_ABI32) || (defined(_ABIO32) && _MIPS_SIM == _ABIO32)) 475#if !((defined(_MIPS_SIM_ABI32) && _MIPS_SIM == _MIPS_SIM_ABI32) || (defined(_ABIO32) && _MIPS_SIM == _ABIO32))
454#error "Only o32 ABI supported for MIPS32" 476#error "Only o32 ABI supported for MIPS32"
455#endif 477#endif
478#if LJ_TARGET_MIPSR6
479/* Not that useful, since most available r6 CPUs are 64 bit. */
480#error "No support for MIPS32R6"
481#endif
456#elif LJ_TARGET_MIPS64 482#elif LJ_TARGET_MIPS64
457#if !((defined(_MIPS_SIM_ABI64) && _MIPS_SIM == _MIPS_SIM_ABI64) || (defined(_ABI64) && _MIPS_SIM == _ABI64)) 483#if !((defined(_MIPS_SIM_ABI64) && _MIPS_SIM == _MIPS_SIM_ABI64) || (defined(_ABI64) && _MIPS_SIM == _ABI64))
484/* MIPS32ON64 aka n32 ABI support might be desirable, but difficult. */
458#error "Only n64 ABI supported for MIPS64" 485#error "Only n64 ABI supported for MIPS64"
459#endif 486#endif
460#endif 487#endif