mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
ARM: Misc. fixes for interpreter.
This commit is contained in:
parent
add553edd8
commit
32db4525d9
@ -16,7 +16,7 @@
|
|||||||
#include "lj_arch.h"
|
#include "lj_arch.h"
|
||||||
|
|
||||||
/* Hardcoded limits. Increase as needed. */
|
/* Hardcoded limits. Increase as needed. */
|
||||||
#define BUILD_MAX_RELOC 100 /* Max. number of relocations. */
|
#define BUILD_MAX_RELOC 200 /* Max. number of relocations. */
|
||||||
#define BUILD_MAX_FOLD 4096 /* Max. number of fold rules. */
|
#define BUILD_MAX_FOLD 4096 /* Max. number of fold rules. */
|
||||||
|
|
||||||
/* Prefix for scanned library definitions. */
|
/* Prefix for scanned library definitions. */
|
||||||
|
@ -1544,27 +1544,27 @@ static void build_subroutines(BuildCtx *ctx)
|
|||||||
|->vm_tobit_fb:
|
|->vm_tobit_fb:
|
||||||
| bhi ->fff_fallback
|
| bhi ->fff_fallback
|
||||||
|->vm_tobit:
|
|->vm_tobit:
|
||||||
| lsl CARG3, CARG2, #1
|
| lsl RB, CARG2, #1
|
||||||
| adds CARG3, CARG3, #0x00200000
|
| adds RB, RB, #0x00200000
|
||||||
| movpl CARG1, #0 // |x| < 1?
|
| movpl CARG1, #0 // |x| < 1?
|
||||||
| bxpl lr
|
| bxpl lr
|
||||||
| mvn CARG4, #0x3e0
|
| mvn CARG4, #0x3e0
|
||||||
| subs CARG3, CARG4, CARG3, asr #21
|
| subs RB, CARG4, RB, asr #21
|
||||||
| bmi >1 // |x| >= 2^32?
|
| bmi >1 // |x| >= 2^32?
|
||||||
| lsl CARG4, CARG2, #11
|
| lsl CARG4, CARG2, #11
|
||||||
| orr CARG4, CARG4, #0x80000000
|
| orr CARG4, CARG4, #0x80000000
|
||||||
| orr CARG4, CARG4, CARG1, lsr #21
|
| orr CARG4, CARG4, CARG1, lsr #21
|
||||||
| cmp CARG2, #0
|
| cmp CARG2, #0
|
||||||
| lsr CARG1, CARG4, CARG3
|
| lsr CARG1, CARG4, RB
|
||||||
| rsblt CARG1, CARG1, #0
|
| rsblt CARG1, CARG1, #0
|
||||||
| bx lr
|
| bx lr
|
||||||
|1:
|
|1:
|
||||||
| add CARG3, CARG3, #21
|
| add RB, RB, #21
|
||||||
| lsr CARG4, CARG1, CARG3
|
| lsr CARG4, CARG1, RB
|
||||||
| rsb CARG3, CARG3, #20
|
| rsb RB, RB, #20
|
||||||
| lsl CARG1, CARG2, #12
|
| lsl CARG1, CARG2, #12
|
||||||
| cmp CARG2, #0
|
| cmp CARG2, #0
|
||||||
| orr CARG1, CARG4, CARG1, lsl CARG3
|
| orr CARG1, CARG4, CARG1, lsl RB
|
||||||
| rsblt CARG1, CARG1, #0
|
| rsblt CARG1, CARG1, #0
|
||||||
| bx lr
|
| bx lr
|
||||||
|
|
|
|
||||||
@ -2120,6 +2120,9 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
|
|||||||
| ins_next
|
| ins_next
|
||||||
|
|
|
|
||||||
|3: // CARG12 is not an integer.
|
|3: // CARG12 is not an integer.
|
||||||
|
if (!vk) {
|
||||||
|
| subhi PC, RB, #0x20000
|
||||||
|
}
|
||||||
| bhi <1
|
| bhi <1
|
||||||
| // CARG12 is a number.
|
| // CARG12 is a number.
|
||||||
| checktp CARG4, LJ_TISNUM
|
| checktp CARG4, LJ_TISNUM
|
||||||
@ -2396,8 +2399,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
|
|||||||
| mvn RC, RC
|
| mvn RC, RC
|
||||||
| ins_next1
|
| ins_next1
|
||||||
| ldr CARG1, [KBASE, RC, lsl #2]
|
| ldr CARG1, [KBASE, RC, lsl #2]
|
||||||
| ins_next2
|
|
||||||
| mvn CARG2, #~LJ_TSTR
|
| mvn CARG2, #~LJ_TSTR
|
||||||
|
| ins_next2
|
||||||
| strd CARG12, [BASE, RA]
|
| strd CARG12, [BASE, RA]
|
||||||
| ins_next3
|
| ins_next3
|
||||||
break;
|
break;
|
||||||
@ -2890,7 +2893,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
|
|||||||
| b <3 // No 2nd write barrier needed.
|
| b <3 // No 2nd write barrier needed.
|
||||||
|
|
|
|
||||||
|7: // Possible table write barrier for the value. Skip valiswhite check.
|
|7: // Possible table write barrier for the value. Skip valiswhite check.
|
||||||
| barrierback TAB:CARG1, CARG2, CARG3
|
| barrierback TAB:RB, CARG2, CARG3
|
||||||
| b <3
|
| b <3
|
||||||
break;
|
break;
|
||||||
case BC_TSETB:
|
case BC_TSETB:
|
||||||
@ -2939,23 +2942,23 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
|
|||||||
|1:
|
|1:
|
||||||
| ldr RB, SAVE_MULTRES
|
| ldr RB, SAVE_MULTRES
|
||||||
| ldr TAB:CARG2, [RA, #-8] // Guaranteed to be a table.
|
| ldr TAB:CARG2, [RA, #-8] // Guaranteed to be a table.
|
||||||
| ldr CARG4, [KBASE, RC, lsl #3] // Integer constant is in lo-word.
|
| ldr CARG1, [KBASE, RC, lsl #3] // Integer constant is in lo-word.
|
||||||
| subs RB, RB, #8
|
| subs RB, RB, #8
|
||||||
| ldr CARG1, TAB:CARG2->asize
|
| ldr CARG4, TAB:CARG2->asize
|
||||||
| beq >4 // Nothing to copy?
|
| beq >4 // Nothing to copy?
|
||||||
| add CARG3, CARG4, RB, lsr #3
|
| add CARG3, CARG1, RB, lsr #3
|
||||||
| cmp CARG3, CARG1
|
| cmp CARG3, CARG4
|
||||||
| ldr CARG1, TAB:CARG2->array
|
| ldr CARG4, TAB:CARG2->array
|
||||||
| add RB, RA, RB
|
| add RB, RA, RB
|
||||||
| bhi >5
|
| bhi >5
|
||||||
| add INS, CARG1, CARG4, lsl #3
|
| add INS, CARG4, CARG1, lsl #3
|
||||||
| ldrb CARG4, TAB:CARG2->marked
|
| ldrb CARG1, TAB:CARG2->marked
|
||||||
|3: // Copy result slots to table.
|
|3: // Copy result slots to table.
|
||||||
| ldrd CARG12, [RA], #8
|
| ldrd CARG34, [RA], #8
|
||||||
| strd CARG12, [INS], #8
|
| strd CARG34, [INS], #8
|
||||||
| cmp RA, RB
|
| cmp RA, RB
|
||||||
| blo <3
|
| blo <3
|
||||||
| tst CARG4, #LJ_GC_BLACK // isblack(table)
|
| tst CARG1, #LJ_GC_BLACK // isblack(table)
|
||||||
| bne >7
|
| bne >7
|
||||||
|4:
|
|4:
|
||||||
| ins_next
|
| ins_next
|
||||||
@ -2969,7 +2972,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
|
|||||||
| b <1
|
| b <1
|
||||||
|
|
|
|
||||||
|7: // Possible table write barrier for any value. Skip valiswhite check.
|
|7: // Possible table write barrier for any value. Skip valiswhite check.
|
||||||
| barrierback TAB:RB, CARG4, CARG1
|
| barrierback TAB:RB, CARG1, CARG2
|
||||||
| b <4
|
| b <4
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -3010,13 +3013,13 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
|
|||||||
| checkfunc CARG4, ->vmeta_callt
|
| checkfunc CARG4, ->vmeta_callt
|
||||||
| ldr PC, [BASE, FRAME_PC]
|
| ldr PC, [BASE, FRAME_PC]
|
||||||
|->BC_CALLT2_Z:
|
|->BC_CALLT2_Z:
|
||||||
| str LFUNC:CARG3, [BASE, FRAME_FUNC] // Copy function down, but keep PC.
|
| mov RB, #0
|
||||||
| ldrb CARG4, LFUNC:CARG3->ffid
|
| ldrb CARG4, LFUNC:CARG3->ffid
|
||||||
| tst PC, #FRAME_TYPE
|
| tst PC, #FRAME_TYPE
|
||||||
| bne >7
|
| bne >7
|
||||||
|1:
|
|1:
|
||||||
|
| str LFUNC:CARG3, [BASE, FRAME_FUNC] // Copy function down, but keep PC.
|
||||||
| cmp NARGS8:RC, #0
|
| cmp NARGS8:RC, #0
|
||||||
| mov RB, #0
|
|
||||||
| beq >3
|
| beq >3
|
||||||
|2:
|
|2:
|
||||||
| ldrd CARG12, [RA, RB]
|
| ldrd CARG12, [RA, RB]
|
||||||
|
Loading…
Reference in New Issue
Block a user