aboutsummaryrefslogtreecommitdiff
path: root/src/lib_jit.c
diff options
context:
space:
mode:
authorMike Pall <mike>2016-06-08 10:24:00 +0200
committerMike Pall <mike>2016-06-08 10:24:00 +0200
commit287a5347cfe452d44748327fb7c27f6ce57f5dc2 (patch)
tree72ee534bbad2ff069408977f0cb2787527dcdbc2 /src/lib_jit.c
parentf5983437a6b08c140bdeb2fc15fa30d7f3b0daad (diff)
downloadluajit-287a5347cfe452d44748327fb7c27f6ce57f5dc2.tar.gz
luajit-287a5347cfe452d44748327fb7c27f6ce57f5dc2.tar.bz2
luajit-287a5347cfe452d44748327fb7c27f6ce57f5dc2.zip
MIPS: Support MIPS16 interlinking.
Diffstat (limited to 'src/lib_jit.c')
-rw-r--r--src/lib_jit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib_jit.c b/src/lib_jit.c
index 1655f0c5..592538bd 100644
--- a/src/lib_jit.c
+++ b/src/lib_jit.c
@@ -721,8 +721,12 @@ static uint32_t jit_cpudetect(lua_State *L)
721#if defined(__GNUC__) 721#if defined(__GNUC__)
722 if (!(flags & JIT_F_MIPSXXR2)) { 722 if (!(flags & JIT_F_MIPSXXR2)) {
723 int x; 723 int x;
724#ifdef __mips16
725 x = 0; /* Runtime detection is difficult. Ensure optimal -march flags. */
726#else
724 /* On MIPS32R1 rotr is treated as srl. rotr r2,r2,1 -> srl r2,r2,1. */ 727 /* On MIPS32R1 rotr is treated as srl. rotr r2,r2,1 -> srl r2,r2,1. */
725 __asm__("li $2, 1\n\t.long 0x00221042\n\tmove %0, $2" : "=r"(x) : : "$2"); 728 __asm__("li $2, 1\n\t.long 0x00221042\n\tmove %0, $2" : "=r"(x) : : "$2");
729#endif
726 if (x) flags |= JIT_F_MIPSXXR2; /* Either 0x80000000 (R2) or 0 (R1). */ 730 if (x) flags |= JIT_F_MIPSXXR2; /* Either 0x80000000 (R2) or 0 (R1). */
727 } 731 }
728#endif 732#endif