diff options
author | Mike Pall <mike> | 2010-09-17 16:01:02 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2010-09-17 16:01:02 +0200 |
commit | 9dc98280d228d8c127cc9abf04f7836ea8fffe71 (patch) | |
tree | 21689ccce7394981ff92f6f010778e5a43942f35 | |
parent | 66f0c437801ae0560b576c888df7c1e2f31c955e (diff) | |
download | luajit-9dc98280d228d8c127cc9abf04f7836ea8fffe71.tar.gz luajit-9dc98280d228d8c127cc9abf04f7836ea8fffe71.tar.bz2 luajit-9dc98280d228d8c127cc9abf04f7836ea8fffe71.zip |
PPC: Reschedule bytecode instruction fetch.
-rw-r--r-- | src/buildvm_ppc.dasc | 101 |
1 files changed, 66 insertions, 35 deletions
diff --git a/src/buildvm_ppc.dasc b/src/buildvm_ppc.dasc index 381161a9..a6ea6293 100644 --- a/src/buildvm_ppc.dasc +++ b/src/buildvm_ppc.dasc | |||
@@ -159,31 +159,45 @@ | |||
159 | |.macro decode_OP1, dst, ins; rlwinm dst, ins, 0, 24, 31; .endmacro | 159 | |.macro decode_OP1, dst, ins; rlwinm dst, ins, 0, 24, 31; .endmacro |
160 | |.macro decode_RD4, dst, ins; rlwinm dst, ins, 18, 14, 29; .endmacro | 160 | |.macro decode_RD4, dst, ins; rlwinm dst, ins, 18, 14, 29; .endmacro |
161 | | | 161 | | |
162 | |// Instruction decode+dispatch. | 162 | |// Instruction fetch. |
163 | |.macro ins_NEXT | 163 | |.macro ins_NEXT1 |
164 | | lwz INS, 0(PC) | 164 | | lwz INS, 0(PC) |
165 | | addi PC, PC, 4 | 165 | | addi PC, PC, 4 |
166 | | decode_OP4 TMP0, INS | 166 | |.endmacro |
167 | |// Instruction decode+dispatch. | ||
168 | |.macro ins_NEXT2 | ||
169 | | decode_OP4 TMP1, INS | ||
167 | | decode_RB8 RB, INS | 170 | | decode_RB8 RB, INS |
168 | | lwzx TMP0, DISPATCH, TMP0 | ||
169 | | decode_RD8 RD, INS | 171 | | decode_RD8 RD, INS |
172 | | lwzx TMP0, DISPATCH, TMP1 | ||
173 | | decode_RA8 RA, INS | ||
170 | | decode_RC8 RC, INS | 174 | | decode_RC8 RC, INS |
171 | | mtctr TMP0 | 175 | | mtctr TMP0 |
172 | | decode_RA8 RA, INS | ||
173 | | bctr | 176 | | bctr |
174 | |.endmacro | 177 | |.endmacro |
178 | |.macro ins_NEXT | ||
179 | | ins_NEXT1 | ||
180 | | ins_NEXT2 | ||
181 | |.endmacro | ||
175 | | | 182 | | |
176 | |// Instruction footer. | 183 | |// Instruction footer. |
177 | |.if 1 | 184 | |.if 1 |
178 | | // Replicated dispatch. Less unpredictable branches, but higher I-Cache use. | 185 | | // Replicated dispatch. Less unpredictable branches, but higher I-Cache use. |
179 | | .define ins_next, ins_NEXT | 186 | | .define ins_next, ins_NEXT |
180 | | .define ins_next_, ins_NEXT | 187 | | .define ins_next_, ins_NEXT |
188 | | .define ins_next1, ins_NEXT1 | ||
189 | | .define ins_next2, ins_NEXT2 | ||
181 | |.else | 190 | |.else |
182 | | // Common dispatch. Lower I-Cache use, only one (very) unpredictable branch. | 191 | | // Common dispatch. Lower I-Cache use, only one (very) unpredictable branch. |
183 | | // Affects only certain kinds of benchmarks (and only with -j off). | 192 | | // Affects only certain kinds of benchmarks (and only with -j off). |
184 | | .macro ins_next | 193 | | .macro ins_next |
185 | | b ->ins_next | 194 | | b ->ins_next |
186 | | .endmacro | 195 | | .endmacro |
196 | | .macro ins_next1 | ||
197 | | .endmacro | ||
198 | | .macro ins_next2 | ||
199 | | b ->ins_next | ||
200 | | .endmacro | ||
187 | | .macro ins_next_ | 201 | | .macro ins_next_ |
188 | | ->ins_next: | 202 | | ->ins_next: |
189 | | ins_NEXT | 203 | | ins_NEXT |
@@ -196,9 +210,9 @@ | |||
196 | | lwz PC, LFUNC:RB->pc | 210 | | lwz PC, LFUNC:RB->pc |
197 | | lwz INS, 0(PC) | 211 | | lwz INS, 0(PC) |
198 | | addi PC, PC, 4 | 212 | | addi PC, PC, 4 |
199 | | decode_OP4 TMP0, INS | 213 | | decode_OP4 TMP1, INS |
200 | | decode_RA8 RA, INS | 214 | | decode_RA8 RA, INS |
201 | | lwzx TMP0, DISPATCH, TMP0 | 215 | | lwzx TMP0, DISPATCH, TMP1 |
202 | | add RA, RA, BASE | 216 | | add RA, RA, BASE |
203 | | mtctr TMP0 | 217 | | mtctr TMP0 |
204 | | bctr | 218 | | bctr |
@@ -1404,17 +1418,19 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
1404 | 1418 | ||
1405 | case BC_MOV: | 1419 | case BC_MOV: |
1406 | | // RA = dst*8, RD = src*8 | 1420 | | // RA = dst*8, RD = src*8 |
1421 | | ins_next1 | ||
1407 | | evlddx TMP0, BASE, RD | 1422 | | evlddx TMP0, BASE, RD |
1408 | | evstddx TMP0, BASE, RA | 1423 | | evstddx TMP0, BASE, RA |
1409 | | ins_next_ | 1424 | | ins_next2 |
1410 | break; | 1425 | break; |
1411 | case BC_NOT: | 1426 | case BC_NOT: |
1412 | | // RA = dst*8, RD = src*8 | 1427 | | // RA = dst*8, RD = src*8 |
1428 | | ins_next1 | ||
1413 | | lwzx TMP0, BASE, RD | 1429 | | lwzx TMP0, BASE, RD |
1414 | | subfic TMP1, TMP0, LJ_TTRUE | 1430 | | subfic TMP1, TMP0, LJ_TTRUE |
1415 | | adde TMP0, TMP0, TMP1 | 1431 | | adde TMP0, TMP0, TMP1 |
1416 | | stwx TMP0, BASE, RA | 1432 | | stwx TMP0, BASE, RA |
1417 | | ins_next | 1433 | | ins_next2 |
1418 | break; | 1434 | break; |
1419 | case BC_UNM: | 1435 | case BC_UNM: |
1420 | | // RA = dst*8, RD = src*8 | 1436 | | // RA = dst*8, RD = src*8 |
@@ -1425,8 +1441,9 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
1425 | | evmergelo TMP1, TMP1, TMP2 | 1441 | | evmergelo TMP1, TMP1, TMP2 |
1426 | | checkfail ->vmeta_unm | 1442 | | checkfail ->vmeta_unm |
1427 | | evxor TMP0, TMP0, TMP1 | 1443 | | evxor TMP0, TMP0, TMP1 |
1444 | | ins_next1 | ||
1428 | | evstddx TMP0, BASE, RA | 1445 | | evstddx TMP0, BASE, RA |
1429 | | ins_next | 1446 | | ins_next2 |
1430 | break; | 1447 | break; |
1431 | case BC_LEN: | 1448 | case BC_LEN: |
1432 | | // RA = dst*8, RD = src*8 | 1449 | | // RA = dst*8, RD = src*8 |
@@ -1435,9 +1452,10 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
1435 | | checkfail >2 | 1452 | | checkfail >2 |
1436 | | lwz CRET1, STR:CARG1->len | 1453 | | lwz CRET1, STR:CARG1->len |
1437 | |1: | 1454 | |1: |
1455 | | ins_next1 | ||
1438 | | efdcfsi TMP0, CRET1 | 1456 | | efdcfsi TMP0, CRET1 |
1439 | | evstddx TMP0, BASE, RA | 1457 | | evstddx TMP0, BASE, RA |
1440 | | ins_next | 1458 | | ins_next2 |
1441 | |2: | 1459 | |2: |
1442 | | checktab CARG1 | 1460 | | checktab CARG1 |
1443 | | checkfail ->vmeta_len | 1461 | | checkfail ->vmeta_len |
@@ -1476,9 +1494,10 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
1476 | | | 1494 | | |
1477 | |.macro ins_arith, ins | 1495 | |.macro ins_arith, ins |
1478 | | ins_arithpre TMP0, TMP1 | 1496 | | ins_arithpre TMP0, TMP1 |
1497 | | ins_next1 | ||
1479 | | ins TMP0, TMP0, TMP1 | 1498 | | ins TMP0, TMP0, TMP1 |
1480 | | evstddx TMP0, BASE, RA | 1499 | | evstddx TMP0, BASE, RA |
1481 | | ins_next | 1500 | | ins_next2 |
1482 | |.endmacro | 1501 | |.endmacro |
1483 | 1502 | ||
1484 | case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: | 1503 | case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: |
@@ -1499,9 +1518,10 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
1499 | | efddiv CARG2, RD, SAVE0 | 1518 | | efddiv CARG2, RD, SAVE0 |
1500 | | bl ->vm_floor // floor(b/c) | 1519 | | bl ->vm_floor // floor(b/c) |
1501 | | efdmul TMP0, CRET2, SAVE0 | 1520 | | efdmul TMP0, CRET2, SAVE0 |
1521 | | ins_next1 | ||
1502 | | efdsub TMP0, RD, TMP0 // b - floor(b/c)*c | 1522 | | efdsub TMP0, RD, TMP0 // b - floor(b/c)*c |
1503 | | evstddx TMP0, BASE, RA | 1523 | | evstddx TMP0, BASE, RA |
1504 | | ins_next | 1524 | | ins_next2 |
1505 | break; | 1525 | break; |
1506 | case BC_MODNV: case BC_MODVV: | 1526 | case BC_MODNV: case BC_MODVV: |
1507 | | ins_arithpre RD, SAVE0 | 1527 | | ins_arithpre RD, SAVE0 |
@@ -1544,33 +1564,37 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
1544 | 1564 | ||
1545 | case BC_KSTR: | 1565 | case BC_KSTR: |
1546 | | // RA = dst*8, RD = str_const*8 (~) | 1566 | | // RA = dst*8, RD = str_const*8 (~) |
1567 | | ins_next1 | ||
1547 | | srwi TMP1, RD, 1 | 1568 | | srwi TMP1, RD, 1 |
1548 | | subfic TMP1, TMP1, -4 | 1569 | | subfic TMP1, TMP1, -4 |
1549 | | lwzx TMP0, KBASE, TMP1 // KBASE-4-str_const*4 | 1570 | | lwzx TMP0, KBASE, TMP1 // KBASE-4-str_const*4 |
1550 | | evmergelo TMP0, TISSTR, TMP0 | 1571 | | evmergelo TMP0, TISSTR, TMP0 |
1551 | | evstddx TMP0, BASE, RA | 1572 | | evstddx TMP0, BASE, RA |
1552 | | ins_next | 1573 | | ins_next2 |
1553 | break; | 1574 | break; |
1554 | case BC_KSHORT: | 1575 | case BC_KSHORT: |
1555 | | // RA = dst*8, RD = int16_literal*8 | 1576 | | // RA = dst*8, RD = int16_literal*8 |
1556 | | srwi TMP1, RD, 3 | 1577 | | srwi TMP1, RD, 3 |
1557 | | extsh TMP1, TMP1 | 1578 | | extsh TMP1, TMP1 |
1579 | | ins_next1 | ||
1558 | | efdcfsi TMP0, TMP1 | 1580 | | efdcfsi TMP0, TMP1 |
1559 | | evstddx TMP0, BASE, RA | 1581 | | evstddx TMP0, BASE, RA |
1560 | | ins_next | 1582 | | ins_next2 |
1561 | break; | 1583 | break; |
1562 | case BC_KNUM: | 1584 | case BC_KNUM: |
1563 | | // RA = dst*8, RD = num_const*8 | 1585 | | // RA = dst*8, RD = num_const*8 |
1564 | | evlddx TMP0, KBASE, RD | 1586 | | evlddx TMP0, KBASE, RD |
1587 | | ins_next1 | ||
1565 | | evstddx TMP0, BASE, RA | 1588 | | evstddx TMP0, BASE, RA |
1566 | | ins_next | 1589 | | ins_next2 |
1567 | break; | 1590 | break; |
1568 | case BC_KPRI: | 1591 | case BC_KPRI: |
1569 | | // RA = dst*8, RD = primitive_type*8 (~) | 1592 | | // RA = dst*8, RD = primitive_type*8 (~) |
1570 | | srwi TMP1, RD, 3 | 1593 | | srwi TMP1, RD, 3 |
1571 | | not TMP0, TMP1 | 1594 | | not TMP0, TMP1 |
1595 | | ins_next1 | ||
1572 | | stwx TMP0, BASE, RA | 1596 | | stwx TMP0, BASE, RA |
1573 | | ins_next | 1597 | | ins_next2 |
1574 | break; | 1598 | break; |
1575 | case BC_KNIL: | 1599 | case BC_KNIL: |
1576 | | // RA = base*8, RD = end*8 | 1600 | | // RA = base*8, RD = end*8 |
@@ -1581,13 +1605,14 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
1581 | | cmpw RA, RD | 1605 | | cmpw RA, RD |
1582 | | addi RA, RA, 8 | 1606 | | addi RA, RA, 8 |
1583 | | blt <1 | 1607 | | blt <1 |
1584 | | ins_next | 1608 | | ins_next_ |
1585 | break; | 1609 | break; |
1586 | 1610 | ||
1587 | /* -- Upvalue and function ops ------------------------------------------ */ | 1611 | /* -- Upvalue and function ops ------------------------------------------ */ |
1588 | 1612 | ||
1589 | case BC_UGET: | 1613 | case BC_UGET: |
1590 | | // RA = dst*8, RD = uvnum*8 | 1614 | | // RA = dst*8, RD = uvnum*8 |
1615 | | ins_next1 | ||
1591 | | lwz LFUNC:RB, FRAME_FUNC(BASE) | 1616 | | lwz LFUNC:RB, FRAME_FUNC(BASE) |
1592 | | srwi RD, RD, 1 | 1617 | | srwi RD, RD, 1 |
1593 | | addi RD, RD, offsetof(GCfuncL, uvptr) | 1618 | | addi RD, RD, offsetof(GCfuncL, uvptr) |
@@ -1595,7 +1620,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
1595 | | lwz TMP1, UPVAL:RB->v | 1620 | | lwz TMP1, UPVAL:RB->v |
1596 | | evldd TMP0, 0(TMP1) | 1621 | | evldd TMP0, 0(TMP1) |
1597 | | evstddx TMP0, BASE, RA | 1622 | | evstddx TMP0, BASE, RA |
1598 | | ins_next | 1623 | | ins_next2 |
1599 | break; | 1624 | break; |
1600 | case BC_USETV: | 1625 | case BC_USETV: |
1601 | | // RA = uvnum*8, RD = src*8 | 1626 | | // RA = uvnum*8, RD = src*8 |
@@ -1630,6 +1655,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
1630 | break; | 1655 | break; |
1631 | case BC_USETS: | 1656 | case BC_USETS: |
1632 | | // RA = uvnum*8, RD = str_const*8 (~) | 1657 | | // RA = uvnum*8, RD = str_const*8 (~) |
1658 | | ins_next1 | ||
1633 | | lwz LFUNC:RB, FRAME_FUNC(BASE) | 1659 | | lwz LFUNC:RB, FRAME_FUNC(BASE) |
1634 | | srwi TMP1, RD, 1 | 1660 | | srwi TMP1, RD, 1 |
1635 | | srwi RA, RA, 1 | 1661 | | srwi RA, RA, 1 |
@@ -1646,7 +1672,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
1646 | | evstdd STR:TMP1, 0(CARG2) | 1672 | | evstdd STR:TMP1, 0(CARG2) |
1647 | | bne >2 | 1673 | | bne >2 |
1648 | |1: | 1674 | |1: |
1649 | | ins_next | 1675 | | ins_next2 |
1650 | | | 1676 | | |
1651 | |2: // Check if string is white and ensure upvalue is closed. | 1677 | |2: // Check if string is white and ensure upvalue is closed. |
1652 | | andi. TMP3, TMP3, LJ_GC_WHITES // iswhite(str) | 1678 | | andi. TMP3, TMP3, LJ_GC_WHITES // iswhite(str) |
@@ -1660,6 +1686,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
1660 | break; | 1686 | break; |
1661 | case BC_USETN: | 1687 | case BC_USETN: |
1662 | | // RA = uvnum*8, RD = num_const*8 | 1688 | | // RA = uvnum*8, RD = num_const*8 |
1689 | | ins_next1 | ||
1663 | | lwz LFUNC:RB, FRAME_FUNC(BASE) | 1690 | | lwz LFUNC:RB, FRAME_FUNC(BASE) |
1664 | | srwi RA, RA, 1 | 1691 | | srwi RA, RA, 1 |
1665 | | addi RA, RA, offsetof(GCfuncL, uvptr) | 1692 | | addi RA, RA, offsetof(GCfuncL, uvptr) |
@@ -1667,10 +1694,11 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
1667 | | lwzx UPVAL:RB, LFUNC:RB, RA | 1694 | | lwzx UPVAL:RB, LFUNC:RB, RA |
1668 | | lwz TMP1, UPVAL:RB->v | 1695 | | lwz TMP1, UPVAL:RB->v |
1669 | | evstdd TMP0, 0(TMP1) | 1696 | | evstdd TMP0, 0(TMP1) |
1670 | | ins_next | 1697 | | ins_next2 |
1671 | break; | 1698 | break; |
1672 | case BC_USETP: | 1699 | case BC_USETP: |
1673 | | // RA = uvnum*8, RD = primitive_type*8 (~) | 1700 | | // RA = uvnum*8, RD = primitive_type*8 (~) |
1701 | | ins_next1 | ||
1674 | | lwz LFUNC:RB, FRAME_FUNC(BASE) | 1702 | | lwz LFUNC:RB, FRAME_FUNC(BASE) |
1675 | | srwi RA, RA, 1 | 1703 | | srwi RA, RA, 1 |
1676 | | addi RA, RA, offsetof(GCfuncL, uvptr) | 1704 | | addi RA, RA, offsetof(GCfuncL, uvptr) |
@@ -1679,7 +1707,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
1679 | | not TMP0, TMP0 | 1707 | | not TMP0, TMP0 |
1680 | | lwz TMP1, UPVAL:RB->v | 1708 | | lwz TMP1, UPVAL:RB->v |
1681 | | stw TMP0, 0(TMP1) | 1709 | | stw TMP0, 0(TMP1) |
1682 | | ins_next | 1710 | | ins_next2 |
1683 | break; | 1711 | break; |
1684 | 1712 | ||
1685 | case BC_UCLO: | 1713 | case BC_UCLO: |
@@ -1870,8 +1898,9 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
1870 | | checknil TMP1 | 1898 | | checknil TMP1 |
1871 | | checkok >5 | 1899 | | checkok >5 |
1872 | |1: | 1900 | |1: |
1901 | | ins_next1 | ||
1873 | | evstddx TMP1, BASE, RA | 1902 | | evstddx TMP1, BASE, RA |
1874 | | ins_next | 1903 | | ins_next2 |
1875 | | | 1904 | | |
1876 | |5: // Check for __index if table value is nil. | 1905 | |5: // Check for __index if table value is nil. |
1877 | | lwz TAB:TMP2, TAB:RB->metatable | 1906 | | lwz TAB:TMP2, TAB:RB->metatable |
@@ -2289,9 +2318,10 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
2289 | | bgt >6 | 2318 | | bgt >6 |
2290 | | sub BASE, TMP2, RA | 2319 | | sub BASE, TMP2, RA |
2291 | | lwz LFUNC:TMP1, FRAME_FUNC(BASE) | 2320 | | lwz LFUNC:TMP1, FRAME_FUNC(BASE) |
2321 | | ins_next1 | ||
2292 | | lwz TMP1, LFUNC:TMP1->pc | 2322 | | lwz TMP1, LFUNC:TMP1->pc |
2293 | | lwz KBASE, PC2PROTO(k)(TMP1) | 2323 | | lwz KBASE, PC2PROTO(k)(TMP1) |
2294 | | ins_next | 2324 | | ins_next2 |
2295 | | | 2325 | | |
2296 | |6: // Fill up results with nil. | 2326 | |6: // Fill up results with nil. |
2297 | | subi TMP1, RD, 8 | 2327 | | subi TMP1, RD, 8 |
@@ -2330,9 +2360,10 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
2330 | | bgt >6 | 2360 | | bgt >6 |
2331 | | sub BASE, TMP2, RA | 2361 | | sub BASE, TMP2, RA |
2332 | | lwz LFUNC:TMP1, FRAME_FUNC(BASE) | 2362 | | lwz LFUNC:TMP1, FRAME_FUNC(BASE) |
2363 | | ins_next1 | ||
2333 | | lwz TMP1, LFUNC:TMP1->pc | 2364 | | lwz TMP1, LFUNC:TMP1->pc |
2334 | | lwz KBASE, PC2PROTO(k)(TMP1) | 2365 | | lwz KBASE, PC2PROTO(k)(TMP1) |
2335 | | ins_next | 2366 | | ins_next2 |
2336 | | | 2367 | | |
2337 | |6: // Fill up results with nil. | 2368 | |6: // Fill up results with nil. |
2338 | | subi TMP1, RD, 8 | 2369 | | subi TMP1, RD, 8 |
@@ -2361,20 +2392,18 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
2361 | vk = (op == BC_IFORL || op == BC_JFORL); | 2392 | vk = (op == BC_IFORL || op == BC_JFORL); |
2362 | | add RA, BASE, RA | 2393 | | add RA, BASE, RA |
2363 | | evldd TMP1, FORL_IDX*8(RA) | 2394 | | evldd TMP1, FORL_IDX*8(RA) |
2364 | | evldd TMP2, FORL_STOP*8(RA) | ||
2365 | | evldd TMP3, FORL_STEP*8(RA) | 2395 | | evldd TMP3, FORL_STEP*8(RA) |
2396 | | evldd TMP2, FORL_STOP*8(RA) | ||
2366 | if (!vk) { | 2397 | if (!vk) { |
2367 | | evcmpgtu cr0, TMP1, TISNUM | 2398 | | evcmpgtu cr0, TMP1, TISNUM |
2368 | | evcmpgtu cr1, TMP2, TISNUM | ||
2369 | | evcmpgtu cr7, TMP3, TISNUM | 2399 | | evcmpgtu cr7, TMP3, TISNUM |
2370 | | cror 4*cr0+lt, 4*cr0+lt, 4*cr1+lt | 2400 | | evcmpgtu cr1, TMP2, TISNUM |
2371 | | cror 4*cr0+lt, 4*cr0+lt, 4*cr7+lt | 2401 | | cror 4*cr0+lt, 4*cr0+lt, 4*cr7+lt |
2402 | | cror 4*cr0+lt, 4*cr0+lt, 4*cr1+lt | ||
2372 | | blt ->vmeta_for | 2403 | | blt ->vmeta_for |
2373 | } | 2404 | } |
2374 | if (vk) { | 2405 | if (vk) { |
2375 | | efdadd TMP1, TMP1, TMP3 | 2406 | | efdadd TMP1, TMP1, TMP3 |
2376 | } | ||
2377 | if (vk) { | ||
2378 | | evstdd TMP1, FORL_IDX*8(RA) | 2407 | | evstdd TMP1, FORL_IDX*8(RA) |
2379 | } | 2408 | } |
2380 | | evcmpgts TMP3, TISNIL | 2409 | | evcmpgts TMP3, TISNIL |
@@ -2480,13 +2509,14 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
2480 | | cmplw RA, TMP2 | 2509 | | cmplw RA, TMP2 |
2481 | | slwi TMP1, TMP1, 3 | 2510 | | slwi TMP1, TMP1, 3 |
2482 | | bgt ->vm_growstack_l | 2511 | | bgt ->vm_growstack_l |
2512 | | ins_next1 | ||
2483 | |2: | 2513 | |2: |
2484 | | cmplw NARGS8:RC, TMP1 // Check for missing parameters. | 2514 | | cmplw NARGS8:RC, TMP1 // Check for missing parameters. |
2485 | | ble >3 | 2515 | | ble >3 |
2486 | if (op == BC_JFUNCF) { | 2516 | if (op == BC_JFUNCF) { |
2487 | | NYI | 2517 | | NYI |
2488 | } else { | 2518 | } else { |
2489 | | ins_next | 2519 | | ins_next2 |
2490 | } | 2520 | } |
2491 | | | 2521 | | |
2492 | |3: // Clear missing parameters. | 2522 | |3: // Clear missing parameters. |
@@ -2516,6 +2546,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
2516 | | lbz TMP2, -4+PC2PROTO(numparams)(PC) | 2546 | | lbz TMP2, -4+PC2PROTO(numparams)(PC) |
2517 | | mr RA, BASE | 2547 | | mr RA, BASE |
2518 | | mr RC, TMP1 | 2548 | | mr RC, TMP1 |
2549 | | ins_next1 | ||
2519 | | cmpwi TMP2, 0 | 2550 | | cmpwi TMP2, 0 |
2520 | | addi BASE, TMP1, 8 | 2551 | | addi BASE, TMP1, 8 |
2521 | | beq >3 | 2552 | | beq >3 |
@@ -2531,7 +2562,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
2531 | | addi TMP1, TMP1, 8 | 2562 | | addi TMP1, TMP1, 8 |
2532 | | bne <1 | 2563 | | bne <1 |
2533 | |3: | 2564 | |3: |
2534 | | ins_next | 2565 | | ins_next2 |
2535 | | | 2566 | | |
2536 | |4: // Clear missing parameters. | 2567 | |4: // Clear missing parameters. |
2537 | | evmr TMP0, TISNIL | 2568 | | evmr TMP0, TISNIL |
@@ -2542,18 +2573,18 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
2542 | case BC_FUNCCW: | 2573 | case BC_FUNCCW: |
2543 | | // BASE = new base, RA = BASE+framesize*8, RB = CFUNC, RC = nargs*8 | 2574 | | // BASE = new base, RA = BASE+framesize*8, RB = CFUNC, RC = nargs*8 |
2544 | if (op == BC_FUNCC) { | 2575 | if (op == BC_FUNCC) { |
2545 | | lwz TMP0, CFUNC:RB->f | 2576 | | lwz TMP3, CFUNC:RB->f |
2546 | } else { | 2577 | } else { |
2547 | | lwz TMP0, DISPATCH_GL(wrapf)(DISPATCH) | 2578 | | lwz TMP3, DISPATCH_GL(wrapf)(DISPATCH) |
2548 | } | 2579 | } |
2549 | | add TMP1, RA, NARGS8:RC | 2580 | | add TMP1, RA, NARGS8:RC |
2550 | | lwz TMP2, L->maxstack | 2581 | | lwz TMP2, L->maxstack |
2551 | | add RC, BASE, NARGS8:RC | 2582 | | add RC, BASE, NARGS8:RC |
2552 | | stw BASE, L->base | 2583 | | stw BASE, L->base |
2553 | | mtctr TMP0 | ||
2554 | | cmplw TMP1, TMP2 | 2584 | | cmplw TMP1, TMP2 |
2555 | | stw RC, L->top | 2585 | | stw RC, L->top |
2556 | | li_vmstate C | 2586 | | li_vmstate C |
2587 | | mtctr TMP3 | ||
2557 | if (op == BC_FUNCCW) { | 2588 | if (op == BC_FUNCCW) { |
2558 | | lwz CARG2, CFUNC:RB->f | 2589 | | lwz CARG2, CFUNC:RB->f |
2559 | } | 2590 | } |