aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2011-04-04 01:44:54 +0200
committerMike Pall <mike>2011-04-04 01:44:54 +0200
commitf1c79f80c231b9591f018fd114f0f33d79c89bc2 (patch)
tree05c6e5caccc432fc1692f9b89e09606a5ac7ede6 /src
parent33bab1f76c14f01a7ad97fd2312524511c1a39a3 (diff)
downloadluajit-f1c79f80c231b9591f018fd114f0f33d79c89bc2.tar.gz
luajit-f1c79f80c231b9591f018fd114f0f33d79c89bc2.tar.bz2
luajit-f1c79f80c231b9591f018fd114f0f33d79c89bc2.zip
ARM: Minor fixes and cleanups for type checks.
Diffstat (limited to 'src')
-rw-r--r--src/buildvm_arm.dasc21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/buildvm_arm.dasc b/src/buildvm_arm.dasc
index 0cefc471..136b4c06 100644
--- a/src/buildvm_arm.dasc
+++ b/src/buildvm_arm.dasc
@@ -148,9 +148,9 @@
148|.macro ins_callt 148|.macro ins_callt
149| // BASE = new base, CARG3 = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC 149| // BASE = new base, CARG3 = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC
150| ldr PC, LFUNC:CARG3->field_pc 150| ldr PC, LFUNC:CARG3->field_pc
151| ldrb OP, [PC] 151| ldrb OP, [PC] // STALL: load PC. early PC.
152| ldr INS, [PC], #4 152| ldr INS, [PC], #4
153| ldr OP, [DISPATCH, OP, lsl #2] 153| ldr OP, [DISPATCH, OP, lsl #2] // STALL: load OP. early OP.
154| decode_RA8 RA, INS 154| decode_RA8 RA, INS
155| add RA, RA, BASE 155| add RA, RA, BASE
156| bx OP 156| bx OP
@@ -159,13 +159,14 @@
159|.macro ins_call 159|.macro ins_call
160| // BASE = new base, CARG3 = LFUNC/CFUNC, RC = nargs*8, PC = caller PC 160| // BASE = new base, CARG3 = LFUNC/CFUNC, RC = nargs*8, PC = caller PC
161| str PC, [BASE, FRAME_PC] 161| str PC, [BASE, FRAME_PC]
162| ins_callt 162| ins_callt // STALL: locked PC.
163|.endmacro 163|.endmacro
164| 164|
165|//----------------------------------------------------------------------- 165|//-----------------------------------------------------------------------
166| 166|
167|// Macros to test operand types. 167|// Macros to test operand types.
168|.macro checktp, reg, tp; cmn reg, #-tp; .endmacro 168|.macro checktp, reg, tp; cmn reg, #-tp; .endmacro
169|.macro checktpeq, reg, tp; cmneq reg, #-tp; .endmacro
169|.macro checkstr, reg, target; checktp reg, LJ_TSTR; bne target; .endmacro 170|.macro checkstr, reg, target; checktp reg, LJ_TSTR; bne target; .endmacro
170|.macro checktab, reg, target; checktp reg, LJ_TTAB; bne target; .endmacro 171|.macro checktab, reg, target; checktp reg, LJ_TTAB; bne target; .endmacro
171|.macro checkfunc, reg, target; checktp reg, LJ_TFUNC; bne target; .endmacro 172|.macro checkfunc, reg, target; checktp reg, LJ_TFUNC; bne target; .endmacro
@@ -930,7 +931,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
930 | ldr CARG1, [RC, #4] 931 | ldr CARG1, [RC, #4]
931 | add RA, BASE, RA 932 | add RA, BASE, RA
932 | ins_next2 933 | ins_next2
933 | cmn CARG1, #-LJ_TTRUE 934 | checktp CARG1, LJ_TTRUE
934 | mvnls CARG2, #~LJ_TFALSE 935 | mvnls CARG2, #~LJ_TFALSE
935 | mvnhi CARG2, #~LJ_TTRUE 936 | mvnhi CARG2, #~LJ_TTRUE
936 | str CARG2, [RA, #4] 937 | str CARG2, [RA, #4]
@@ -942,7 +943,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
942 | ldrd CARG12, [BASE, RC] 943 | ldrd CARG12, [BASE, RC]
943 | ins_next1 944 | ins_next1
944 | ins_next2 945 | ins_next2
945 | cmn CARG2, #-LJ_TISNUM 946 | checktp CARG2, LJ_TISNUM
946 | bne >5 947 | bne >5
947 | rsbs CARG1, CARG1, #0 948 | rsbs CARG1, CARG1, #0
948 | bvs >4 949 | bvs >4
@@ -1348,19 +1349,19 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
1348 | add RC, PC, RC, lsl #2 1349 | add RC, PC, RC, lsl #2
1349 if (!vk) { 1350 if (!vk) {
1350 | ldrd CARG34, FOR_STOP 1351 | ldrd CARG34, FOR_STOP
1351 | cmn CARG2, #-LJ_TISNUM 1352 | checktp CARG2, LJ_TISNUM
1352 | ldr RB, FOR_TSTEP 1353 | ldr RB, FOR_TSTEP
1353 | bne >5 1354 | bne >5
1354 | cmn CARG4, #-LJ_TISNUM 1355 | checktp CARG4, LJ_TISNUM
1355 | ldr CARG4, FOR_STEP 1356 | ldr CARG4, FOR_STEP
1356 | cmneq RB, #-LJ_TISNUM 1357 | checktpeq RB, LJ_TISNUM
1357 | bne ->vmeta_for 1358 | bne ->vmeta_for
1358 | cmp CARG4, #0 1359 | cmp CARG4, #0
1359 | blt >4 1360 | blt >4
1360 | cmp CARG1, CARG3 1361 | cmp CARG1, CARG3
1361 } else { 1362 } else {
1362 | ldrd CARG34, FOR_STEP 1363 | ldrd CARG34, FOR_STEP
1363 | cmn CARG2, #-LJ_TISNUM 1364 | checktp CARG2, LJ_TISNUM
1364 | bne >5 1365 | bne >5
1365 | adds CARG1, CARG1, CARG3 1366 | adds CARG1, CARG1, CARG3
1366 | ldr CARG4, FOR_STOP 1367 | ldr CARG4, FOR_STOP
@@ -1553,7 +1554,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
1553 |1: 1554 |1:
1554 | cmp RA, RC // Less args than parameters? 1555 | cmp RA, RC // Less args than parameters?
1555 | ldrdlo CARG12, [RA], #8 1556 | ldrdlo CARG12, [RA], #8
1556 | mvnhs CARG2, CARG3 1557 | movhs CARG2, CARG3
1557 | strlo CARG3, [RA, #-4] // Clear old fixarg slot (help the GC). 1558 | strlo CARG3, [RA, #-4] // Clear old fixarg slot (help the GC).
1558 |2: 1559 |2:
1559 | subs RB, RB, #1 1560 | subs RB, RB, #1