aboutsummaryrefslogtreecommitdiff
path: root/src/lj_emit_mips.h
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/lj_emit_mips.h
parentf5983437a6b08c140bdeb2fc15fa30d7f3b0daad (diff)
downloadluajit-287a5347cfe452d44748327fb7c27f6ce57f5dc2.tar.gz
luajit-287a5347cfe452d44748327fb7c27f6ce57f5dc2.tar.bz2
luajit-287a5347cfe452d44748327fb7c27f6ce57f5dc2.zip
MIPS: Support MIPS16 interlinking.
Diffstat (limited to 'src/lj_emit_mips.h')
-rw-r--r--src/lj_emit_mips.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lj_emit_mips.h b/src/lj_emit_mips.h
index 9df04771..d35f830b 100644
--- a/src/lj_emit_mips.h
+++ b/src/lj_emit_mips.h
@@ -157,7 +157,8 @@ static void emit_call(ASMState *as, void *target, int needcfa)
157 MCode *p = as->mcp; 157 MCode *p = as->mcp;
158 *--p = MIPSI_NOP; 158 *--p = MIPSI_NOP;
159 if ((((uintptr_t)target ^ (uintptr_t)p) >> 28) == 0) { 159 if ((((uintptr_t)target ^ (uintptr_t)p) >> 28) == 0) {
160 *--p = MIPSI_JAL | (((uintptr_t)target >>2) & 0x03ffffffu); 160 *--p = (((uintptr_t)target & 1) ? MIPSI_JALX : MIPSI_JAL) |
161 (((uintptr_t)target >>2) & 0x03ffffffu);
161 } else { /* Target out of range: need indirect call. */ 162 } else { /* Target out of range: need indirect call. */
162 *--p = MIPSI_JALR | MIPSF_S(RID_CFUNCADDR); 163 *--p = MIPSI_JALR | MIPSF_S(RID_CFUNCADDR);
163 needcfa = 1; 164 needcfa = 1;