diff options
| author | 2015-01-22 09:34:01 -0500 | |
|---|---|---|
| committer | 2015-01-22 09:39:41 -0500 | |
| commit | 8810dfe1deb693ab818bd3b7b880903e188c6017 (patch) | |
| tree | c76d3549886121fb4fc74d1c1605480137fb7ded /src | |
| parent | Merge pull request #495 from bunnei/fix-waitsynch (diff) | |
| download | yuzu-8810dfe1deb693ab818bd3b7b880903e188c6017.tar.gz yuzu-8810dfe1deb693ab818bd3b7b880903e188c6017.tar.xz yuzu-8810dfe1deb693ab818bd3b7b880903e188c6017.zip | |
dyncom: Minor cleanup
Removes some unused macros and cleans up indentation inconsistencies
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/arm/dyncom/arm_dyncom_interpreter.cpp | 552 |
1 files changed, 270 insertions, 282 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp index fce8d8e4f..81427720e 100644 --- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp +++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp | |||
| @@ -24,37 +24,29 @@ using namespace std; | |||
| 24 | #include "core/hle/hle.h" | 24 | #include "core/hle/hle.h" |
| 25 | 25 | ||
| 26 | enum { | 26 | enum { |
| 27 | COND = (1 << 0), | 27 | COND = (1 << 0), |
| 28 | NON_BRANCH = (1 << 1), | 28 | NON_BRANCH = (1 << 1), |
| 29 | DIRECT_BRANCH = (1 << 2), | 29 | DIRECT_BRANCH = (1 << 2), |
| 30 | INDIRECT_BRANCH = (1 << 3), | 30 | INDIRECT_BRANCH = (1 << 3), |
| 31 | CALL = (1 << 4), | 31 | CALL = (1 << 4), |
| 32 | RET = (1 << 5), | 32 | RET = (1 << 5), |
| 33 | END_OF_PAGE = (1 << 6), | 33 | END_OF_PAGE = (1 << 6), |
| 34 | THUMB = (1 << 7) | 34 | THUMB = (1 << 7) |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | #define USER_MODE_OPT 1 | ||
| 38 | #define HYBRID_MODE 0 // Enable for JIT mode | ||
| 39 | |||
| 40 | #define THRESHOLD 1000 | ||
| 41 | #define DURATION 500 | ||
| 42 | |||
| 43 | #define CHECK_RS if(RS == 15) rs += 8 | ||
| 44 | #define CHECK_RM if(RM == 15) rm += 8 | ||
| 45 | |||
| 46 | #undef BITS | 37 | #undef BITS |
| 38 | #undef BIT | ||
| 47 | #define BITS(s, a, b) ((s << ((sizeof(s) * 8 - 1) - b)) >> (sizeof(s) * 8 - b + a - 1)) | 39 | #define BITS(s, a, b) ((s << ((sizeof(s) * 8 - 1) - b)) >> (sizeof(s) * 8 - b + a - 1)) |
| 48 | #define BIT(s, n) ((s >> (n)) & 1) | 40 | #define BIT(s, n) ((s >> (n)) & 1) |
| 49 | #define RM BITS(sht_oper, 0, 3) | 41 | #define RM BITS(sht_oper, 0, 3) |
| 50 | #define RS BITS(sht_oper, 8, 11) | 42 | #define RS BITS(sht_oper, 8, 11) |
| 51 | 43 | ||
| 52 | #define glue(x, y) x ## y | 44 | #define glue(x, y) x ## y |
| 53 | #define DPO(s) glue(DataProcessingOperands, s) | 45 | #define DPO(s) glue(DataProcessingOperands, s) |
| 54 | #define ROTATE_RIGHT(n, i, l) ((n << (l - i)) | (n >> i)) | 46 | #define ROTATE_RIGHT(n, i, l) ((n << (l - i)) | (n >> i)) |
| 55 | #define ROTATE_LEFT(n, i, l) ((n >> (l - i)) | (n << i)) | 47 | #define ROTATE_LEFT(n, i, l) ((n >> (l - i)) | (n << i)) |
| 56 | #define ROTATE_RIGHT_32(n, i) ROTATE_RIGHT(n, i, 32) | 48 | #define ROTATE_RIGHT_32(n, i) ROTATE_RIGHT(n, i, 32) |
| 57 | #define ROTATE_LEFT_32(n, i) ROTATE_LEFT(n, i, 32) | 49 | #define ROTATE_LEFT_32(n, i) ROTATE_LEFT(n, i, 32) |
| 58 | 50 | ||
| 59 | #define rotr(x,n) ( (x >> n) | ((x & ((1 << (n + 1)) - 1)) << (32 - n)) ) | 51 | #define rotr(x,n) ( (x >> n) | ((x & ((1 << (n + 1)) - 1)) << (32 - n)) ) |
| 60 | 52 | ||
| @@ -702,9 +694,6 @@ void LnSWoUB(ScaledRegisterOffset)(arm_processor *cpu, unsigned int inst, unsign | |||
| 702 | virt_addr = addr; | 694 | virt_addr = addr; |
| 703 | } | 695 | } |
| 704 | 696 | ||
| 705 | #define ISNEG(n) (n < 0) | ||
| 706 | #define ISPOS(n) (n >= 0) | ||
| 707 | |||
| 708 | typedef struct _arm_inst { | 697 | typedef struct _arm_inst { |
| 709 | unsigned int idx; | 698 | unsigned int idx; |
| 710 | unsigned int cond; | 699 | unsigned int cond; |
| @@ -1324,15 +1313,15 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(adc)(unsigned int inst, int index) | |||
| 1324 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(adc_inst)); | 1313 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(adc_inst)); |
| 1325 | adc_inst *inst_cream = (adc_inst *)inst_base->component; | 1314 | adc_inst *inst_cream = (adc_inst *)inst_base->component; |
| 1326 | 1315 | ||
| 1327 | inst_base->cond = BITS(inst, 28, 31); | 1316 | inst_base->cond = BITS(inst, 28, 31); |
| 1328 | inst_base->idx = index; | 1317 | inst_base->idx = index; |
| 1329 | inst_base->br = NON_BRANCH; | 1318 | inst_base->br = NON_BRANCH; |
| 1330 | inst_base->load_r15 = 0; | 1319 | inst_base->load_r15 = 0; |
| 1331 | 1320 | ||
| 1332 | inst_cream->I = BIT(inst, 25); | 1321 | inst_cream->I = BIT(inst, 25); |
| 1333 | inst_cream->S = BIT(inst, 20); | 1322 | inst_cream->S = BIT(inst, 20); |
| 1334 | inst_cream->Rn = BITS(inst, 16, 19); | 1323 | inst_cream->Rn = BITS(inst, 16, 19); |
| 1335 | inst_cream->Rd = BITS(inst, 12, 15); | 1324 | inst_cream->Rd = BITS(inst, 12, 15); |
| 1336 | if (CHECK_RN) | 1325 | if (CHECK_RN) |
| 1337 | inst_base->load_r15 = 1; | 1326 | inst_base->load_r15 = 1; |
| 1338 | inst_cream->shifter_operand = BITS(inst, 0, 11); | 1327 | inst_cream->shifter_operand = BITS(inst, 0, 11); |
| @@ -1347,15 +1336,15 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(add)(unsigned int inst, int index) | |||
| 1347 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(add_inst)); | 1336 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(add_inst)); |
| 1348 | add_inst *inst_cream = (add_inst *)inst_base->component; | 1337 | add_inst *inst_cream = (add_inst *)inst_base->component; |
| 1349 | 1338 | ||
| 1350 | inst_base->cond = BITS(inst, 28, 31); | 1339 | inst_base->cond = BITS(inst, 28, 31); |
| 1351 | inst_base->idx = index; | 1340 | inst_base->idx = index; |
| 1352 | inst_base->br = NON_BRANCH; | 1341 | inst_base->br = NON_BRANCH; |
| 1353 | inst_base->load_r15 = 0; | 1342 | inst_base->load_r15 = 0; |
| 1354 | 1343 | ||
| 1355 | inst_cream->I = BIT(inst, 25); | 1344 | inst_cream->I = BIT(inst, 25); |
| 1356 | inst_cream->S = BIT(inst, 20); | 1345 | inst_cream->S = BIT(inst, 20); |
| 1357 | inst_cream->Rn = BITS(inst, 16, 19); | 1346 | inst_cream->Rn = BITS(inst, 16, 19); |
| 1358 | inst_cream->Rd = BITS(inst, 12, 15); | 1347 | inst_cream->Rd = BITS(inst, 12, 15); |
| 1359 | if (CHECK_RN) | 1348 | if (CHECK_RN) |
| 1360 | inst_base->load_r15 = 1; | 1349 | inst_base->load_r15 = 1; |
| 1361 | inst_cream->shifter_operand = BITS(inst, 0, 11); | 1350 | inst_cream->shifter_operand = BITS(inst, 0, 11); |
| @@ -1370,15 +1359,15 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(and)(unsigned int inst, int index) | |||
| 1370 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(and_inst)); | 1359 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(and_inst)); |
| 1371 | and_inst *inst_cream = (and_inst *)inst_base->component; | 1360 | and_inst *inst_cream = (and_inst *)inst_base->component; |
| 1372 | 1361 | ||
| 1373 | inst_base->cond = BITS(inst, 28, 31); | 1362 | inst_base->cond = BITS(inst, 28, 31); |
| 1374 | inst_base->idx = index; | 1363 | inst_base->idx = index; |
| 1375 | inst_base->br = NON_BRANCH; | 1364 | inst_base->br = NON_BRANCH; |
| 1376 | inst_base->load_r15 = 0; | 1365 | inst_base->load_r15 = 0; |
| 1377 | 1366 | ||
| 1378 | inst_cream->I = BIT(inst, 25); | 1367 | inst_cream->I = BIT(inst, 25); |
| 1379 | inst_cream->S = BIT(inst, 20); | 1368 | inst_cream->S = BIT(inst, 20); |
| 1380 | inst_cream->Rn = BITS(inst, 16, 19); | 1369 | inst_cream->Rn = BITS(inst, 16, 19); |
| 1381 | inst_cream->Rd = BITS(inst, 12, 15); | 1370 | inst_cream->Rd = BITS(inst, 12, 15); |
| 1382 | if (CHECK_RN) | 1371 | if (CHECK_RN) |
| 1383 | inst_base->load_r15 = 1; | 1372 | inst_base->load_r15 = 1; |
| 1384 | inst_cream->shifter_operand = BITS(inst, 0, 11); | 1373 | inst_cream->shifter_operand = BITS(inst, 0, 11); |
| @@ -1395,9 +1384,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(bbl)(unsigned int inst, int index) | |||
| 1395 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(bbl_inst)); | 1384 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(bbl_inst)); |
| 1396 | bbl_inst *inst_cream = (bbl_inst *)inst_base->component; | 1385 | bbl_inst *inst_cream = (bbl_inst *)inst_base->component; |
| 1397 | 1386 | ||
| 1398 | inst_base->cond = BITS(inst, 28, 31); | 1387 | inst_base->cond = BITS(inst, 28, 31); |
| 1399 | inst_base->idx = index; | 1388 | inst_base->idx = index; |
| 1400 | inst_base->br = DIRECT_BRANCH; | 1389 | inst_base->br = DIRECT_BRANCH; |
| 1401 | 1390 | ||
| 1402 | if (BIT(inst, 24)) | 1391 | if (BIT(inst, 24)) |
| 1403 | inst_base->br = CALL; | 1392 | inst_base->br = CALL; |
| @@ -1414,15 +1403,15 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(bic)(unsigned int inst, int index) | |||
| 1414 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(bic_inst)); | 1403 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(bic_inst)); |
| 1415 | bic_inst *inst_cream = (bic_inst *)inst_base->component; | 1404 | bic_inst *inst_cream = (bic_inst *)inst_base->component; |
| 1416 | 1405 | ||
| 1417 | inst_base->cond = BITS(inst, 28, 31); | 1406 | inst_base->cond = BITS(inst, 28, 31); |
| 1418 | inst_base->idx = index; | 1407 | inst_base->idx = index; |
| 1419 | inst_base->br = NON_BRANCH; | 1408 | inst_base->br = NON_BRANCH; |
| 1420 | inst_base->load_r15 = 0; | 1409 | inst_base->load_r15 = 0; |
| 1421 | 1410 | ||
| 1422 | inst_cream->I = BIT(inst, 25); | 1411 | inst_cream->I = BIT(inst, 25); |
| 1423 | inst_cream->S = BIT(inst, 20); | 1412 | inst_cream->S = BIT(inst, 20); |
| 1424 | inst_cream->Rn = BITS(inst, 16, 19); | 1413 | inst_cream->Rn = BITS(inst, 16, 19); |
| 1425 | inst_cream->Rd = BITS(inst, 12, 15); | 1414 | inst_cream->Rd = BITS(inst, 12, 15); |
| 1426 | if (CHECK_RN) | 1415 | if (CHECK_RN) |
| 1427 | inst_base->load_r15 = 1; | 1416 | inst_base->load_r15 = 1; |
| 1428 | inst_cream->shifter_operand = BITS(inst, 0, 11); | 1417 | inst_cream->shifter_operand = BITS(inst, 0, 11); |
| @@ -1438,9 +1427,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(blx)(unsigned int inst, int index) | |||
| 1438 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(blx_inst)); | 1427 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(blx_inst)); |
| 1439 | blx_inst *inst_cream = (blx_inst *)inst_base->component; | 1428 | blx_inst *inst_cream = (blx_inst *)inst_base->component; |
| 1440 | 1429 | ||
| 1441 | inst_base->cond = BITS(inst, 28, 31); | 1430 | inst_base->cond = BITS(inst, 28, 31); |
| 1442 | inst_base->idx = index; | 1431 | inst_base->idx = index; |
| 1443 | inst_base->br = INDIRECT_BRANCH; | 1432 | inst_base->br = INDIRECT_BRANCH; |
| 1444 | 1433 | ||
| 1445 | inst_cream->inst = inst; | 1434 | inst_cream->inst = inst; |
| 1446 | if (BITS(inst, 20, 27) == 0x12 && BITS(inst, 4, 7) == 0x3) { | 1435 | if (BITS(inst, 20, 27) == 0x12 && BITS(inst, 4, 7) == 0x3) { |
| @@ -1472,17 +1461,18 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(bxj)(unsigned int inst, int index) | |||
| 1472 | ARM_INST_PTR INTERPRETER_TRANSLATE(cdp)(unsigned int inst, int index){ | 1461 | ARM_INST_PTR INTERPRETER_TRANSLATE(cdp)(unsigned int inst, int index){ |
| 1473 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(cdp_inst)); | 1462 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(cdp_inst)); |
| 1474 | cdp_inst *inst_cream = (cdp_inst *)inst_base->component; | 1463 | cdp_inst *inst_cream = (cdp_inst *)inst_base->component; |
| 1475 | inst_base->cond = BITS(inst, 28, 31); | 1464 | |
| 1476 | inst_base->idx = index; | 1465 | inst_base->cond = BITS(inst, 28, 31); |
| 1477 | inst_base->br = NON_BRANCH; | 1466 | inst_base->idx = index; |
| 1467 | inst_base->br = NON_BRANCH; | ||
| 1478 | inst_base->load_r15 = 0; | 1468 | inst_base->load_r15 = 0; |
| 1479 | 1469 | ||
| 1480 | inst_cream->CRm = BITS(inst, 0, 3); | 1470 | inst_cream->CRm = BITS(inst, 0, 3); |
| 1481 | inst_cream->CRd = BITS(inst, 12, 15); | 1471 | inst_cream->CRd = BITS(inst, 12, 15); |
| 1482 | inst_cream->CRn = BITS(inst, 16, 19); | 1472 | inst_cream->CRn = BITS(inst, 16, 19); |
| 1483 | inst_cream->cp_num = BITS(inst, 8, 11); | 1473 | inst_cream->cp_num = BITS(inst, 8, 11); |
| 1484 | inst_cream->opcode_2 = BITS(inst, 5, 7); | 1474 | inst_cream->opcode_2 = BITS(inst, 5, 7); |
| 1485 | inst_cream->opcode_1 = BITS(inst, 20, 23); | 1475 | inst_cream->opcode_1 = BITS(inst, 20, 23); |
| 1486 | inst_cream->inst = inst; | 1476 | inst_cream->inst = inst; |
| 1487 | 1477 | ||
| 1488 | LOG_TRACE(Core_ARM11, "inst %x index %x", inst, index); | 1478 | LOG_TRACE(Core_ARM11, "inst %x index %x", inst, index); |
| @@ -1491,9 +1481,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(cdp)(unsigned int inst, int index){ | |||
| 1491 | ARM_INST_PTR INTERPRETER_TRANSLATE(clrex)(unsigned int inst, int index) | 1481 | ARM_INST_PTR INTERPRETER_TRANSLATE(clrex)(unsigned int inst, int index) |
| 1492 | { | 1482 | { |
| 1493 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(clrex_inst)); | 1483 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(clrex_inst)); |
| 1494 | inst_base->cond = BITS(inst, 28, 31); | 1484 | inst_base->cond = BITS(inst, 28, 31); |
| 1495 | inst_base->idx = index; | 1485 | inst_base->idx = index; |
| 1496 | inst_base->br = NON_BRANCH; | 1486 | inst_base->br = NON_BRANCH; |
| 1497 | 1487 | ||
| 1498 | return inst_base; | 1488 | return inst_base; |
| 1499 | } | 1489 | } |
| @@ -1502,13 +1492,13 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(clz)(unsigned int inst, int index) | |||
| 1502 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(clz_inst)); | 1492 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(clz_inst)); |
| 1503 | clz_inst *inst_cream = (clz_inst *)inst_base->component; | 1493 | clz_inst *inst_cream = (clz_inst *)inst_base->component; |
| 1504 | 1494 | ||
| 1505 | inst_base->cond = BITS(inst, 28, 31); | 1495 | inst_base->cond = BITS(inst, 28, 31); |
| 1506 | inst_base->idx = index; | 1496 | inst_base->idx = index; |
| 1507 | inst_base->br = NON_BRANCH; | 1497 | inst_base->br = NON_BRANCH; |
| 1508 | inst_base->load_r15 = 0; | 1498 | inst_base->load_r15 = 0; |
| 1509 | 1499 | ||
| 1510 | inst_cream->Rm = BITS(inst, 0, 3); | 1500 | inst_cream->Rm = BITS(inst, 0, 3); |
| 1511 | inst_cream->Rd = BITS(inst, 12, 15); | 1501 | inst_cream->Rd = BITS(inst, 12, 15); |
| 1512 | if (CHECK_RM) | 1502 | if (CHECK_RM) |
| 1513 | inst_base->load_r15 = 1; | 1503 | inst_base->load_r15 = 1; |
| 1514 | 1504 | ||
| @@ -1519,15 +1509,14 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(cmn)(unsigned int inst, int index) | |||
| 1519 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(cmn_inst)); | 1509 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(cmn_inst)); |
| 1520 | cmn_inst *inst_cream = (cmn_inst *)inst_base->component; | 1510 | cmn_inst *inst_cream = (cmn_inst *)inst_base->component; |
| 1521 | 1511 | ||
| 1522 | inst_base->cond = BITS(inst, 28, 31); | 1512 | inst_base->cond = BITS(inst, 28, 31); |
| 1523 | inst_base->idx = index; | 1513 | inst_base->idx = index; |
| 1524 | inst_base->br = NON_BRANCH; | 1514 | inst_base->br = NON_BRANCH; |
| 1525 | inst_base->load_r15 = 0; | 1515 | inst_base->load_r15 = 0; |
| 1526 | 1516 | ||
| 1527 | inst_cream->I = BIT(inst, 25); | 1517 | inst_cream->I = BIT(inst, 25); |
| 1528 | //inst_cream->S = BIT(inst, 20); | 1518 | inst_cream->Rn = BITS(inst, 16, 19); |
| 1529 | inst_cream->Rn = BITS(inst, 16, 19); | 1519 | |
| 1530 | //inst_cream->Rd = BITS(inst, 12, 15); | ||
| 1531 | if (CHECK_RN) | 1520 | if (CHECK_RN) |
| 1532 | inst_base->load_r15 = 1; | 1521 | inst_base->load_r15 = 1; |
| 1533 | inst_cream->shifter_operand = BITS(inst, 0, 11); | 1522 | inst_cream->shifter_operand = BITS(inst, 0, 11); |
| @@ -1539,13 +1528,13 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(cmp)(unsigned int inst, int index) | |||
| 1539 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(cmp_inst)); | 1528 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(cmp_inst)); |
| 1540 | cmp_inst *inst_cream = (cmp_inst *)inst_base->component; | 1529 | cmp_inst *inst_cream = (cmp_inst *)inst_base->component; |
| 1541 | 1530 | ||
| 1542 | inst_base->cond = BITS(inst, 28, 31); | 1531 | inst_base->cond = BITS(inst, 28, 31); |
| 1543 | inst_base->idx = index; | 1532 | inst_base->idx = index; |
| 1544 | inst_base->br = NON_BRANCH; | 1533 | inst_base->br = NON_BRANCH; |
| 1545 | inst_base->load_r15 = 0; | 1534 | inst_base->load_r15 = 0; |
| 1546 | 1535 | ||
| 1547 | inst_cream->I = BIT(inst, 25); | 1536 | inst_cream->I = BIT(inst, 25); |
| 1548 | inst_cream->Rn = BITS(inst, 16, 19); | 1537 | inst_cream->Rn = BITS(inst, 16, 19); |
| 1549 | if (CHECK_RN) | 1538 | if (CHECK_RN) |
| 1550 | inst_base->load_r15 = 1; | 1539 | inst_base->load_r15 = 1; |
| 1551 | inst_cream->shifter_operand = BITS(inst, 0, 11); | 1540 | inst_cream->shifter_operand = BITS(inst, 0, 11); |
| @@ -1557,16 +1546,16 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(cps)(unsigned int inst, int index) | |||
| 1557 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(cps_inst)); | 1546 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(cps_inst)); |
| 1558 | cps_inst *inst_cream = (cps_inst *)inst_base->component; | 1547 | cps_inst *inst_cream = (cps_inst *)inst_base->component; |
| 1559 | 1548 | ||
| 1560 | inst_base->cond = BITS(inst, 28, 31); | 1549 | inst_base->cond = BITS(inst, 28, 31); |
| 1561 | inst_base->idx = index; | 1550 | inst_base->idx = index; |
| 1562 | inst_base->br = NON_BRANCH; | 1551 | inst_base->br = NON_BRANCH; |
| 1563 | 1552 | ||
| 1564 | inst_cream->imod0 = BIT(inst, 18); | 1553 | inst_cream->imod0 = BIT(inst, 18); |
| 1565 | inst_cream->imod1 = BIT(inst, 19); | 1554 | inst_cream->imod1 = BIT(inst, 19); |
| 1566 | inst_cream->mmod = BIT(inst, 17); | 1555 | inst_cream->mmod = BIT(inst, 17); |
| 1567 | inst_cream->A = BIT(inst, 8); | 1556 | inst_cream->A = BIT(inst, 8); |
| 1568 | inst_cream->I = BIT(inst, 7); | 1557 | inst_cream->I = BIT(inst, 7); |
| 1569 | inst_cream->F = BIT(inst, 6); | 1558 | inst_cream->F = BIT(inst, 6); |
| 1570 | inst_cream->mode = BITS(inst, 0, 4); | 1559 | inst_cream->mode = BITS(inst, 0, 4); |
| 1571 | 1560 | ||
| 1572 | return inst_base; | 1561 | return inst_base; |
| @@ -1576,13 +1565,13 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(cpy)(unsigned int inst, int index) | |||
| 1576 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mov_inst)); | 1565 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mov_inst)); |
| 1577 | mov_inst *inst_cream = (mov_inst *)inst_base->component; | 1566 | mov_inst *inst_cream = (mov_inst *)inst_base->component; |
| 1578 | 1567 | ||
| 1579 | inst_base->cond = BITS(inst, 28, 31); | 1568 | inst_base->cond = BITS(inst, 28, 31); |
| 1580 | inst_base->idx = index; | 1569 | inst_base->idx = index; |
| 1581 | inst_base->br = NON_BRANCH; | 1570 | inst_base->br = NON_BRANCH; |
| 1582 | 1571 | ||
| 1583 | inst_cream->I = BIT(inst, 25); | 1572 | inst_cream->I = BIT(inst, 25); |
| 1584 | inst_cream->S = BIT(inst, 20); | 1573 | inst_cream->S = BIT(inst, 20); |
| 1585 | inst_cream->Rd = BITS(inst, 12, 15); | 1574 | inst_cream->Rd = BITS(inst, 12, 15); |
| 1586 | inst_cream->shifter_operand = BITS(inst, 0, 11); | 1575 | inst_cream->shifter_operand = BITS(inst, 0, 11); |
| 1587 | inst_cream->shtop_func = get_shtop(inst); | 1576 | inst_cream->shtop_func = get_shtop(inst); |
| 1588 | 1577 | ||
| @@ -1596,15 +1585,15 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(eor)(unsigned int inst, int index) | |||
| 1596 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(eor_inst)); | 1585 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(eor_inst)); |
| 1597 | eor_inst *inst_cream = (eor_inst *)inst_base->component; | 1586 | eor_inst *inst_cream = (eor_inst *)inst_base->component; |
| 1598 | 1587 | ||
| 1599 | inst_base->cond = BITS(inst, 28, 31); | 1588 | inst_base->cond = BITS(inst, 28, 31); |
| 1600 | inst_base->idx = index; | 1589 | inst_base->idx = index; |
| 1601 | inst_base->br = NON_BRANCH; | 1590 | inst_base->br = NON_BRANCH; |
| 1602 | inst_base->load_r15 = 0; | 1591 | inst_base->load_r15 = 0; |
| 1603 | 1592 | ||
| 1604 | inst_cream->I = BIT(inst, 25); | 1593 | inst_cream->I = BIT(inst, 25); |
| 1605 | inst_cream->S = BIT(inst, 20); | 1594 | inst_cream->S = BIT(inst, 20); |
| 1606 | inst_cream->Rn = BITS(inst, 16, 19); | 1595 | inst_cream->Rn = BITS(inst, 16, 19); |
| 1607 | inst_cream->Rd = BITS(inst, 12, 15); | 1596 | inst_cream->Rd = BITS(inst, 12, 15); |
| 1608 | if (CHECK_RN) | 1597 | if (CHECK_RN) |
| 1609 | inst_base->load_r15 = 1; | 1598 | inst_base->load_r15 = 1; |
| 1610 | inst_cream->shifter_operand = BITS(inst, 0, 11); | 1599 | inst_cream->shifter_operand = BITS(inst, 0, 11); |
| @@ -1617,9 +1606,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(eor)(unsigned int inst, int index) | |||
| 1617 | ARM_INST_PTR INTERPRETER_TRANSLATE(ldc)(unsigned int inst, int index) | 1606 | ARM_INST_PTR INTERPRETER_TRANSLATE(ldc)(unsigned int inst, int index) |
| 1618 | { | 1607 | { |
| 1619 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(ldc_inst)); | 1608 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(ldc_inst)); |
| 1620 | inst_base->cond = BITS(inst, 28, 31); | 1609 | inst_base->cond = BITS(inst, 28, 31); |
| 1621 | inst_base->idx = index; | 1610 | inst_base->idx = index; |
| 1622 | inst_base->br = NON_BRANCH; | 1611 | inst_base->br = NON_BRANCH; |
| 1623 | 1612 | ||
| 1624 | return inst_base; | 1613 | return inst_base; |
| 1625 | } | 1614 | } |
| @@ -1629,8 +1618,8 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(ldm)(unsigned int inst, int index) | |||
| 1629 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; | 1618 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; |
| 1630 | 1619 | ||
| 1631 | inst_base->cond = BITS(inst, 28, 31); | 1620 | inst_base->cond = BITS(inst, 28, 31); |
| 1632 | inst_base->idx = index; | 1621 | inst_base->idx = index; |
| 1633 | inst_base->br = NON_BRANCH; | 1622 | inst_base->br = NON_BRANCH; |
| 1634 | 1623 | ||
| 1635 | inst_cream->inst = inst; | 1624 | inst_cream->inst = inst; |
| 1636 | inst_cream->get_addr = get_calc_addr_op(inst); | 1625 | inst_cream->get_addr = get_calc_addr_op(inst); |
| @@ -1645,9 +1634,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(sxth)(unsigned int inst, int index) | |||
| 1645 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(sxtb_inst)); | 1634 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(sxtb_inst)); |
| 1646 | sxtb_inst *inst_cream = (sxtb_inst *)inst_base->component; | 1635 | sxtb_inst *inst_cream = (sxtb_inst *)inst_base->component; |
| 1647 | 1636 | ||
| 1648 | inst_base->cond = BITS(inst, 28, 31); | 1637 | inst_base->cond = BITS(inst, 28, 31); |
| 1649 | inst_base->idx = index; | 1638 | inst_base->idx = index; |
| 1650 | inst_base->br = NON_BRANCH; | 1639 | inst_base->br = NON_BRANCH; |
| 1651 | inst_base->load_r15 = 0; | 1640 | inst_base->load_r15 = 0; |
| 1652 | 1641 | ||
| 1653 | inst_cream->Rd = BITS(inst, 12, 15); | 1642 | inst_cream->Rd = BITS(inst, 12, 15); |
| @@ -1663,9 +1652,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(ldr)(unsigned int inst, int index) | |||
| 1663 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(ldst_inst)); | 1652 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(ldst_inst)); |
| 1664 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; | 1653 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; |
| 1665 | 1654 | ||
| 1666 | inst_base->cond = BITS(inst, 28, 31); | 1655 | inst_base->cond = BITS(inst, 28, 31); |
| 1667 | inst_base->idx = index; | 1656 | inst_base->idx = index; |
| 1668 | inst_base->br = NON_BRANCH; | 1657 | inst_base->br = NON_BRANCH; |
| 1669 | inst_base->load_r15 = 0; | 1658 | inst_base->load_r15 = 0; |
| 1670 | 1659 | ||
| 1671 | inst_cream->inst = inst; | 1660 | inst_cream->inst = inst; |
| @@ -1682,9 +1671,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(ldrcond)(unsigned int inst, int index) | |||
| 1682 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(ldst_inst)); | 1671 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(ldst_inst)); |
| 1683 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; | 1672 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; |
| 1684 | 1673 | ||
| 1685 | inst_base->cond = BITS(inst, 28, 31); | 1674 | inst_base->cond = BITS(inst, 28, 31); |
| 1686 | inst_base->idx = index; | 1675 | inst_base->idx = index; |
| 1687 | inst_base->br = NON_BRANCH; | 1676 | inst_base->br = NON_BRANCH; |
| 1688 | inst_base->load_r15 = 0; | 1677 | inst_base->load_r15 = 0; |
| 1689 | 1678 | ||
| 1690 | inst_cream->inst = inst; | 1679 | inst_cream->inst = inst; |
| @@ -1701,9 +1690,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(uxth)(unsigned int inst, int index) | |||
| 1701 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(uxth_inst)); | 1690 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(uxth_inst)); |
| 1702 | uxth_inst *inst_cream = (uxth_inst *)inst_base->component; | 1691 | uxth_inst *inst_cream = (uxth_inst *)inst_base->component; |
| 1703 | 1692 | ||
| 1704 | inst_base->cond = BITS(inst, 28, 31); | 1693 | inst_base->cond = BITS(inst, 28, 31); |
| 1705 | inst_base->idx = index; | 1694 | inst_base->idx = index; |
| 1706 | inst_base->br = NON_BRANCH; | 1695 | inst_base->br = NON_BRANCH; |
| 1707 | inst_base->load_r15 = 0; | 1696 | inst_base->load_r15 = 0; |
| 1708 | 1697 | ||
| 1709 | inst_cream->Rd = BITS(inst, 12, 15); | 1698 | inst_cream->Rd = BITS(inst, 12, 15); |
| @@ -1719,9 +1708,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(uxtah)(unsigned int inst, int index) | |||
| 1719 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(uxtah_inst)); | 1708 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(uxtah_inst)); |
| 1720 | uxtah_inst *inst_cream = (uxtah_inst *)inst_base->component; | 1709 | uxtah_inst *inst_cream = (uxtah_inst *)inst_base->component; |
| 1721 | 1710 | ||
| 1722 | inst_base->cond = BITS(inst, 28, 31); | 1711 | inst_base->cond = BITS(inst, 28, 31); |
| 1723 | inst_base->idx = index; | 1712 | inst_base->idx = index; |
| 1724 | inst_base->br = NON_BRANCH; | 1713 | inst_base->br = NON_BRANCH; |
| 1725 | inst_base->load_r15 = 0; | 1714 | inst_base->load_r15 = 0; |
| 1726 | 1715 | ||
| 1727 | inst_cream->Rn = BITS(inst, 16, 19); | 1716 | inst_cream->Rn = BITS(inst, 16, 19); |
| @@ -1739,8 +1728,8 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(ldrb)(unsigned int inst, int index) | |||
| 1739 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; | 1728 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; |
| 1740 | 1729 | ||
| 1741 | inst_base->cond = BITS(inst, 28, 31); | 1730 | inst_base->cond = BITS(inst, 28, 31); |
| 1742 | inst_base->idx = index; | 1731 | inst_base->idx = index; |
| 1743 | inst_base->br = NON_BRANCH; | 1732 | inst_base->br = NON_BRANCH; |
| 1744 | 1733 | ||
| 1745 | inst_cream->inst = inst; | 1734 | inst_cream->inst = inst; |
| 1746 | inst_cream->get_addr = get_calc_addr_op(inst); | 1735 | inst_cream->get_addr = get_calc_addr_op(inst); |
| @@ -1779,8 +1768,8 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(ldrd)(unsigned int inst, int index) | |||
| 1779 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; | 1768 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; |
| 1780 | 1769 | ||
| 1781 | inst_base->cond = BITS(inst, 28, 31); | 1770 | inst_base->cond = BITS(inst, 28, 31); |
| 1782 | inst_base->idx = index; | 1771 | inst_base->idx = index; |
| 1783 | inst_base->br = NON_BRANCH; | 1772 | inst_base->br = NON_BRANCH; |
| 1784 | 1773 | ||
| 1785 | inst_cream->inst = inst; | 1774 | inst_cream->inst = inst; |
| 1786 | inst_cream->get_addr = get_calc_addr_op(inst); | 1775 | inst_cream->get_addr = get_calc_addr_op(inst); |
| @@ -1819,8 +1808,8 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(ldrh)(unsigned int inst, int index) | |||
| 1819 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; | 1808 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; |
| 1820 | 1809 | ||
| 1821 | inst_base->cond = BITS(inst, 28, 31); | 1810 | inst_base->cond = BITS(inst, 28, 31); |
| 1822 | inst_base->idx = index; | 1811 | inst_base->idx = index; |
| 1823 | inst_base->br = NON_BRANCH; | 1812 | inst_base->br = NON_BRANCH; |
| 1824 | 1813 | ||
| 1825 | inst_cream->inst = inst; | 1814 | inst_cream->inst = inst; |
| 1826 | inst_cream->get_addr = get_calc_addr_op(inst); | 1815 | inst_cream->get_addr = get_calc_addr_op(inst); |
| @@ -1836,8 +1825,8 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(ldrsb)(unsigned int inst, int index) | |||
| 1836 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; | 1825 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; |
| 1837 | 1826 | ||
| 1838 | inst_base->cond = BITS(inst, 28, 31); | 1827 | inst_base->cond = BITS(inst, 28, 31); |
| 1839 | inst_base->idx = index; | 1828 | inst_base->idx = index; |
| 1840 | inst_base->br = NON_BRANCH; | 1829 | inst_base->br = NON_BRANCH; |
| 1841 | 1830 | ||
| 1842 | inst_cream->inst = inst; | 1831 | inst_cream->inst = inst; |
| 1843 | inst_cream->get_addr = get_calc_addr_op(inst); | 1832 | inst_cream->get_addr = get_calc_addr_op(inst); |
| @@ -1853,8 +1842,8 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(ldrsh)(unsigned int inst, int index) | |||
| 1853 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; | 1842 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; |
| 1854 | 1843 | ||
| 1855 | inst_base->cond = BITS(inst, 28, 31); | 1844 | inst_base->cond = BITS(inst, 28, 31); |
| 1856 | inst_base->idx = index; | 1845 | inst_base->idx = index; |
| 1857 | inst_base->br = NON_BRANCH; | 1846 | inst_base->br = NON_BRANCH; |
| 1858 | 1847 | ||
| 1859 | inst_cream->inst = inst; | 1848 | inst_cream->inst = inst; |
| 1860 | inst_cream->get_addr = get_calc_addr_op(inst); | 1849 | inst_cream->get_addr = get_calc_addr_op(inst); |
| @@ -1896,9 +1885,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(mcr)(unsigned int inst, int index) | |||
| 1896 | { | 1885 | { |
| 1897 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mcr_inst)); | 1886 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mcr_inst)); |
| 1898 | mcr_inst *inst_cream = (mcr_inst *)inst_base->component; | 1887 | mcr_inst *inst_cream = (mcr_inst *)inst_base->component; |
| 1899 | inst_base->cond = BITS(inst, 28, 31); | 1888 | inst_base->cond = BITS(inst, 28, 31); |
| 1900 | inst_base->idx = index; | 1889 | inst_base->idx = index; |
| 1901 | inst_base->br = NON_BRANCH; | 1890 | inst_base->br = NON_BRANCH; |
| 1902 | 1891 | ||
| 1903 | inst_cream->crn = BITS(inst, 16, 19); | 1892 | inst_cream->crn = BITS(inst, 16, 19); |
| 1904 | inst_cream->crm = BITS(inst, 0, 3); | 1893 | inst_cream->crm = BITS(inst, 0, 3); |
| @@ -1915,16 +1904,16 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(mla)(unsigned int inst, int index) | |||
| 1915 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mla_inst)); | 1904 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mla_inst)); |
| 1916 | mla_inst *inst_cream = (mla_inst *)inst_base->component; | 1905 | mla_inst *inst_cream = (mla_inst *)inst_base->component; |
| 1917 | 1906 | ||
| 1918 | inst_base->cond = BITS(inst, 28, 31); | 1907 | inst_base->cond = BITS(inst, 28, 31); |
| 1919 | inst_base->idx = index; | 1908 | inst_base->idx = index; |
| 1920 | inst_base->br = NON_BRANCH; | 1909 | inst_base->br = NON_BRANCH; |
| 1921 | inst_base->load_r15 = 0; | 1910 | inst_base->load_r15 = 0; |
| 1922 | 1911 | ||
| 1923 | inst_cream->S = BIT(inst, 20); | 1912 | inst_cream->S = BIT(inst, 20); |
| 1924 | inst_cream->Rn = BITS(inst, 12, 15); | 1913 | inst_cream->Rn = BITS(inst, 12, 15); |
| 1925 | inst_cream->Rd = BITS(inst, 16, 19); | 1914 | inst_cream->Rd = BITS(inst, 16, 19); |
| 1926 | inst_cream->Rs = BITS(inst, 8, 11); | 1915 | inst_cream->Rs = BITS(inst, 8, 11); |
| 1927 | inst_cream->Rm = BITS(inst, 0, 3); | 1916 | inst_cream->Rm = BITS(inst, 0, 3); |
| 1928 | 1917 | ||
| 1929 | if (CHECK_RM || CHECK_RN || CHECK_RS) | 1918 | if (CHECK_RM || CHECK_RN || CHECK_RS) |
| 1930 | inst_base->load_r15 = 1; | 1919 | inst_base->load_r15 = 1; |
| @@ -1936,13 +1925,13 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(mov)(unsigned int inst, int index) | |||
| 1936 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mov_inst)); | 1925 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mov_inst)); |
| 1937 | mov_inst *inst_cream = (mov_inst *)inst_base->component; | 1926 | mov_inst *inst_cream = (mov_inst *)inst_base->component; |
| 1938 | 1927 | ||
| 1939 | inst_base->cond = BITS(inst, 28, 31); | 1928 | inst_base->cond = BITS(inst, 28, 31); |
| 1940 | inst_base->idx = index; | 1929 | inst_base->idx = index; |
| 1941 | inst_base->br = NON_BRANCH; | 1930 | inst_base->br = NON_BRANCH; |
| 1942 | 1931 | ||
| 1943 | inst_cream->I = BIT(inst, 25); | 1932 | inst_cream->I = BIT(inst, 25); |
| 1944 | inst_cream->S = BIT(inst, 20); | 1933 | inst_cream->S = BIT(inst, 20); |
| 1945 | inst_cream->Rd = BITS(inst, 12, 15); | 1934 | inst_cream->Rd = BITS(inst, 12, 15); |
| 1946 | inst_cream->shifter_operand = BITS(inst, 0, 11); | 1935 | inst_cream->shifter_operand = BITS(inst, 0, 11); |
| 1947 | inst_cream->shtop_func = get_shtop(inst); | 1936 | inst_cream->shtop_func = get_shtop(inst); |
| 1948 | 1937 | ||
| @@ -1955,9 +1944,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(mrc)(unsigned int inst, int index) | |||
| 1955 | { | 1944 | { |
| 1956 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mrc_inst)); | 1945 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mrc_inst)); |
| 1957 | mrc_inst *inst_cream = (mrc_inst *)inst_base->component; | 1946 | mrc_inst *inst_cream = (mrc_inst *)inst_base->component; |
| 1958 | inst_base->cond = BITS(inst, 28, 31); | 1947 | inst_base->cond = BITS(inst, 28, 31); |
| 1959 | inst_base->idx = index; | 1948 | inst_base->idx = index; |
| 1960 | inst_base->br = NON_BRANCH; | 1949 | inst_base->br = NON_BRANCH; |
| 1961 | 1950 | ||
| 1962 | inst_cream->crn = BITS(inst, 16, 19); | 1951 | inst_cream->crn = BITS(inst, 16, 19); |
| 1963 | inst_cream->crm = BITS(inst, 0, 3); | 1952 | inst_cream->crm = BITS(inst, 0, 3); |
| @@ -1974,12 +1963,12 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(mrs)(unsigned int inst, int index) | |||
| 1974 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mrs_inst)); | 1963 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mrs_inst)); |
| 1975 | mrs_inst *inst_cream = (mrs_inst *)inst_base->component; | 1964 | mrs_inst *inst_cream = (mrs_inst *)inst_base->component; |
| 1976 | 1965 | ||
| 1977 | inst_base->cond = BITS(inst, 28, 31); | 1966 | inst_base->cond = BITS(inst, 28, 31); |
| 1978 | inst_base->idx = index; | 1967 | inst_base->idx = index; |
| 1979 | inst_base->br = NON_BRANCH; | 1968 | inst_base->br = NON_BRANCH; |
| 1980 | 1969 | ||
| 1981 | inst_cream->Rd = BITS(inst, 12, 15); | 1970 | inst_cream->Rd = BITS(inst, 12, 15); |
| 1982 | inst_cream->R = BIT(inst, 22); | 1971 | inst_cream->R = BIT(inst, 22); |
| 1983 | 1972 | ||
| 1984 | return inst_base; | 1973 | return inst_base; |
| 1985 | } | 1974 | } |
| @@ -1988,9 +1977,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(msr)(unsigned int inst, int index) | |||
| 1988 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(msr_inst)); | 1977 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(msr_inst)); |
| 1989 | msr_inst *inst_cream = (msr_inst *)inst_base->component; | 1978 | msr_inst *inst_cream = (msr_inst *)inst_base->component; |
| 1990 | 1979 | ||
| 1991 | inst_base->cond = BITS(inst, 28, 31); | 1980 | inst_base->cond = BITS(inst, 28, 31); |
| 1992 | inst_base->idx = index; | 1981 | inst_base->idx = index; |
| 1993 | inst_base->br = NON_BRANCH; | 1982 | inst_base->br = NON_BRANCH; |
| 1994 | 1983 | ||
| 1995 | inst_cream->field_mask = BITS(inst, 16, 19); | 1984 | inst_cream->field_mask = BITS(inst, 16, 19); |
| 1996 | inst_cream->R = BIT(inst, 22); | 1985 | inst_cream->R = BIT(inst, 22); |
| @@ -2003,15 +1992,15 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(mul)(unsigned int inst, int index) | |||
| 2003 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mul_inst)); | 1992 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mul_inst)); |
| 2004 | mul_inst *inst_cream = (mul_inst *)inst_base->component; | 1993 | mul_inst *inst_cream = (mul_inst *)inst_base->component; |
| 2005 | 1994 | ||
| 2006 | inst_base->cond = BITS(inst, 28, 31); | 1995 | inst_base->cond = BITS(inst, 28, 31); |
| 2007 | inst_base->idx = index; | 1996 | inst_base->idx = index; |
| 2008 | inst_base->br = NON_BRANCH; | 1997 | inst_base->br = NON_BRANCH; |
| 2009 | inst_base->load_r15 = 0; | 1998 | inst_base->load_r15 = 0; |
| 2010 | 1999 | ||
| 2011 | inst_cream->S = BIT(inst, 20); | 2000 | inst_cream->S = BIT(inst, 20); |
| 2012 | inst_cream->Rm = BITS(inst, 0, 3); | 2001 | inst_cream->Rm = BITS(inst, 0, 3); |
| 2013 | inst_cream->Rs = BITS(inst, 8, 11); | 2002 | inst_cream->Rs = BITS(inst, 8, 11); |
| 2014 | inst_cream->Rd = BITS(inst, 16, 19); | 2003 | inst_cream->Rd = BITS(inst, 16, 19); |
| 2015 | 2004 | ||
| 2016 | if (CHECK_RM || CHECK_RS) | 2005 | if (CHECK_RM || CHECK_RS) |
| 2017 | inst_base->load_r15 = 1; | 2006 | inst_base->load_r15 = 1; |
| @@ -2022,13 +2011,13 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(mvn)(unsigned int inst, int index) | |||
| 2022 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mvn_inst)); | 2011 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mvn_inst)); |
| 2023 | mvn_inst *inst_cream = (mvn_inst *)inst_base->component; | 2012 | mvn_inst *inst_cream = (mvn_inst *)inst_base->component; |
| 2024 | 2013 | ||
| 2025 | inst_base->cond = BITS(inst, 28, 31); | 2014 | inst_base->cond = BITS(inst, 28, 31); |
| 2026 | inst_base->idx = index; | 2015 | inst_base->idx = index; |
| 2027 | inst_base->br = NON_BRANCH; | 2016 | inst_base->br = NON_BRANCH; |
| 2028 | 2017 | ||
| 2029 | inst_cream->I = BIT(inst, 25); | 2018 | inst_cream->I = BIT(inst, 25); |
| 2030 | inst_cream->S = BIT(inst, 20); | 2019 | inst_cream->S = BIT(inst, 20); |
| 2031 | inst_cream->Rd = BITS(inst, 12, 15); | 2020 | inst_cream->Rd = BITS(inst, 12, 15); |
| 2032 | inst_cream->shifter_operand = BITS(inst, 0, 11); | 2021 | inst_cream->shifter_operand = BITS(inst, 0, 11); |
| 2033 | inst_cream->shtop_func = get_shtop(inst); | 2022 | inst_cream->shtop_func = get_shtop(inst); |
| 2034 | 2023 | ||
| @@ -2043,15 +2032,15 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(orr)(unsigned int inst, int index) | |||
| 2043 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(orr_inst)); | 2032 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(orr_inst)); |
| 2044 | orr_inst *inst_cream = (orr_inst *)inst_base->component; | 2033 | orr_inst *inst_cream = (orr_inst *)inst_base->component; |
| 2045 | 2034 | ||
| 2046 | inst_base->cond = BITS(inst, 28, 31); | 2035 | inst_base->cond = BITS(inst, 28, 31); |
| 2047 | inst_base->idx = index; | 2036 | inst_base->idx = index; |
| 2048 | inst_base->br = NON_BRANCH; | 2037 | inst_base->br = NON_BRANCH; |
| 2049 | inst_base->load_r15 = 0; | 2038 | inst_base->load_r15 = 0; |
| 2050 | 2039 | ||
| 2051 | inst_cream->I = BIT(inst, 25); | 2040 | inst_cream->I = BIT(inst, 25); |
| 2052 | inst_cream->S = BIT(inst, 20); | 2041 | inst_cream->S = BIT(inst, 20); |
| 2053 | inst_cream->Rd = BITS(inst, 12, 15); | 2042 | inst_cream->Rd = BITS(inst, 12, 15); |
| 2054 | inst_cream->Rn = BITS(inst, 16, 19); | 2043 | inst_cream->Rn = BITS(inst, 16, 19); |
| 2055 | inst_cream->shifter_operand = BITS(inst, 0, 11); | 2044 | inst_cream->shifter_operand = BITS(inst, 0, 11); |
| 2056 | inst_cream->shtop_func = get_shtop(inst); | 2045 | inst_cream->shtop_func = get_shtop(inst); |
| 2057 | 2046 | ||
| @@ -2090,9 +2079,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(pld)(unsigned int inst, int index) | |||
| 2090 | { | 2079 | { |
| 2091 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(pld_inst)); | 2080 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(pld_inst)); |
| 2092 | 2081 | ||
| 2093 | inst_base->cond = BITS(inst, 28, 31); | 2082 | inst_base->cond = BITS(inst, 28, 31); |
| 2094 | inst_base->idx = index; | 2083 | inst_base->idx = index; |
| 2095 | inst_base->br = NON_BRANCH; | 2084 | inst_base->br = NON_BRANCH; |
| 2096 | inst_base->load_r15 = 0; | 2085 | inst_base->load_r15 = 0; |
| 2097 | 2086 | ||
| 2098 | return inst_base; | 2087 | return inst_base; |
| @@ -2199,15 +2188,15 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(rsb)(unsigned int inst, int index) | |||
| 2199 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(rsb_inst)); | 2188 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(rsb_inst)); |
| 2200 | rsb_inst *inst_cream = (rsb_inst *)inst_base->component; | 2189 | rsb_inst *inst_cream = (rsb_inst *)inst_base->component; |
| 2201 | 2190 | ||
| 2202 | inst_base->cond = BITS(inst, 28, 31); | 2191 | inst_base->cond = BITS(inst, 28, 31); |
| 2203 | inst_base->idx = index; | 2192 | inst_base->idx = index; |
| 2204 | inst_base->br = NON_BRANCH; | 2193 | inst_base->br = NON_BRANCH; |
| 2205 | inst_base->load_r15 = 0; | 2194 | inst_base->load_r15 = 0; |
| 2206 | 2195 | ||
| 2207 | inst_cream->I = BIT(inst, 25); | 2196 | inst_cream->I = BIT(inst, 25); |
| 2208 | inst_cream->S = BIT(inst, 20); | 2197 | inst_cream->S = BIT(inst, 20); |
| 2209 | inst_cream->Rn = BITS(inst, 16, 19); | 2198 | inst_cream->Rn = BITS(inst, 16, 19); |
| 2210 | inst_cream->Rd = BITS(inst, 12, 15); | 2199 | inst_cream->Rd = BITS(inst, 12, 15); |
| 2211 | inst_cream->shifter_operand = BITS(inst, 0, 11); | 2200 | inst_cream->shifter_operand = BITS(inst, 0, 11); |
| 2212 | inst_cream->shtop_func = get_shtop(inst); | 2201 | inst_cream->shtop_func = get_shtop(inst); |
| 2213 | if (CHECK_RN) | 2202 | if (CHECK_RN) |
| @@ -2223,15 +2212,15 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(rsc)(unsigned int inst, int index) | |||
| 2223 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(rsc_inst)); | 2212 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(rsc_inst)); |
| 2224 | rsc_inst *inst_cream = (rsc_inst *)inst_base->component; | 2213 | rsc_inst *inst_cream = (rsc_inst *)inst_base->component; |
| 2225 | 2214 | ||
| 2226 | inst_base->cond = BITS(inst, 28, 31); | 2215 | inst_base->cond = BITS(inst, 28, 31); |
| 2227 | inst_base->idx = index; | 2216 | inst_base->idx = index; |
| 2228 | inst_base->br = NON_BRANCH; | 2217 | inst_base->br = NON_BRANCH; |
| 2229 | inst_base->load_r15 = 0; | 2218 | inst_base->load_r15 = 0; |
| 2230 | 2219 | ||
| 2231 | inst_cream->I = BIT(inst, 25); | 2220 | inst_cream->I = BIT(inst, 25); |
| 2232 | inst_cream->S = BIT(inst, 20); | 2221 | inst_cream->S = BIT(inst, 20); |
| 2233 | inst_cream->Rn = BITS(inst, 16, 19); | 2222 | inst_cream->Rn = BITS(inst, 16, 19); |
| 2234 | inst_cream->Rd = BITS(inst, 12, 15); | 2223 | inst_cream->Rd = BITS(inst, 12, 15); |
| 2235 | inst_cream->shifter_operand = BITS(inst, 0, 11); | 2224 | inst_cream->shifter_operand = BITS(inst, 0, 11); |
| 2236 | inst_cream->shtop_func = get_shtop(inst); | 2225 | inst_cream->shtop_func = get_shtop(inst); |
| 2237 | if (CHECK_RN) | 2226 | if (CHECK_RN) |
| @@ -2286,15 +2275,15 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(sbc)(unsigned int inst, int index) | |||
| 2286 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(sbc_inst)); | 2275 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(sbc_inst)); |
| 2287 | sbc_inst *inst_cream = (sbc_inst *)inst_base->component; | 2276 | sbc_inst *inst_cream = (sbc_inst *)inst_base->component; |
| 2288 | 2277 | ||
| 2289 | inst_base->cond = BITS(inst, 28, 31); | 2278 | inst_base->cond = BITS(inst, 28, 31); |
| 2290 | inst_base->idx = index; | 2279 | inst_base->idx = index; |
| 2291 | inst_base->br = NON_BRANCH; | 2280 | inst_base->br = NON_BRANCH; |
| 2292 | inst_base->load_r15 = 0; | 2281 | inst_base->load_r15 = 0; |
| 2293 | 2282 | ||
| 2294 | inst_cream->I = BIT(inst, 25); | 2283 | inst_cream->I = BIT(inst, 25); |
| 2295 | inst_cream->S = BIT(inst, 20); | 2284 | inst_cream->S = BIT(inst, 20); |
| 2296 | inst_cream->Rn = BITS(inst, 16, 19); | 2285 | inst_cream->Rn = BITS(inst, 16, 19); |
| 2297 | inst_cream->Rd = BITS(inst, 12, 15); | 2286 | inst_cream->Rd = BITS(inst, 12, 15); |
| 2298 | inst_cream->shifter_operand = BITS(inst, 0, 11); | 2287 | inst_cream->shifter_operand = BITS(inst, 0, 11); |
| 2299 | inst_cream->shtop_func = get_shtop(inst); | 2288 | inst_cream->shtop_func = get_shtop(inst); |
| 2300 | if (CHECK_RN) | 2289 | if (CHECK_RN) |
| @@ -2370,15 +2359,15 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(smla)(unsigned int inst, int index) | |||
| 2370 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(smla_inst)); | 2359 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(smla_inst)); |
| 2371 | smla_inst *inst_cream = (smla_inst *)inst_base->component; | 2360 | smla_inst *inst_cream = (smla_inst *)inst_base->component; |
| 2372 | 2361 | ||
| 2373 | inst_base->cond = BITS(inst, 28, 31); | 2362 | inst_base->cond = BITS(inst, 28, 31); |
| 2374 | inst_base->idx = index; | 2363 | inst_base->idx = index; |
| 2375 | inst_base->br = NON_BRANCH; | 2364 | inst_base->br = NON_BRANCH; |
| 2376 | inst_base->load_r15 = 0; | 2365 | inst_base->load_r15 = 0; |
| 2377 | 2366 | ||
| 2378 | inst_cream->x = BIT(inst, 5); | 2367 | inst_cream->x = BIT(inst, 5); |
| 2379 | inst_cream->y = BIT(inst, 6); | 2368 | inst_cream->y = BIT(inst, 6); |
| 2380 | inst_cream->Rm = BITS(inst, 0, 3); | 2369 | inst_cream->Rm = BITS(inst, 0, 3); |
| 2381 | inst_cream->Rs = BITS(inst, 8, 11); | 2370 | inst_cream->Rs = BITS(inst, 8, 11); |
| 2382 | inst_cream->Rd = BITS(inst, 16, 19); | 2371 | inst_cream->Rd = BITS(inst, 16, 19); |
| 2383 | inst_cream->Rn = BITS(inst, 12, 15); | 2372 | inst_cream->Rn = BITS(inst, 12, 15); |
| 2384 | 2373 | ||
| @@ -2423,14 +2412,14 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(smlal)(unsigned int inst, int index) | |||
| 2423 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(umlal_inst)); | 2412 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(umlal_inst)); |
| 2424 | umlal_inst *inst_cream = (umlal_inst *)inst_base->component; | 2413 | umlal_inst *inst_cream = (umlal_inst *)inst_base->component; |
| 2425 | 2414 | ||
| 2426 | inst_base->cond = BITS(inst, 28, 31); | 2415 | inst_base->cond = BITS(inst, 28, 31); |
| 2427 | inst_base->idx = index; | 2416 | inst_base->idx = index; |
| 2428 | inst_base->br = NON_BRANCH; | 2417 | inst_base->br = NON_BRANCH; |
| 2429 | inst_base->load_r15 = 0; | 2418 | inst_base->load_r15 = 0; |
| 2430 | 2419 | ||
| 2431 | inst_cream->S = BIT(inst, 20); | 2420 | inst_cream->S = BIT(inst, 20); |
| 2432 | inst_cream->Rm = BITS(inst, 0, 3); | 2421 | inst_cream->Rm = BITS(inst, 0, 3); |
| 2433 | inst_cream->Rs = BITS(inst, 8, 11); | 2422 | inst_cream->Rs = BITS(inst, 8, 11); |
| 2434 | inst_cream->RdHi = BITS(inst, 16, 19); | 2423 | inst_cream->RdHi = BITS(inst, 16, 19); |
| 2435 | inst_cream->RdLo = BITS(inst, 12, 15); | 2424 | inst_cream->RdLo = BITS(inst, 12, 15); |
| 2436 | 2425 | ||
| @@ -2537,9 +2526,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(smul)(unsigned int inst, int index) | |||
| 2537 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(smul_inst)); | 2526 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(smul_inst)); |
| 2538 | smul_inst *inst_cream = (smul_inst *)inst_base->component; | 2527 | smul_inst *inst_cream = (smul_inst *)inst_base->component; |
| 2539 | 2528 | ||
| 2540 | inst_base->cond = BITS(inst, 28, 31); | 2529 | inst_base->cond = BITS(inst, 28, 31); |
| 2541 | inst_base->idx = index; | 2530 | inst_base->idx = index; |
| 2542 | inst_base->br = NON_BRANCH; | 2531 | inst_base->br = NON_BRANCH; |
| 2543 | inst_base->load_r15 = 0; | 2532 | inst_base->load_r15 = 0; |
| 2544 | 2533 | ||
| 2545 | inst_cream->Rd = BITS(inst, 16, 19); | 2534 | inst_cream->Rd = BITS(inst, 16, 19); |
| @@ -2559,14 +2548,14 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(smull)(unsigned int inst, int index) | |||
| 2559 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(umull_inst)); | 2548 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(umull_inst)); |
| 2560 | umull_inst *inst_cream = (umull_inst *)inst_base->component; | 2549 | umull_inst *inst_cream = (umull_inst *)inst_base->component; |
| 2561 | 2550 | ||
| 2562 | inst_base->cond = BITS(inst, 28, 31); | 2551 | inst_base->cond = BITS(inst, 28, 31); |
| 2563 | inst_base->idx = index; | 2552 | inst_base->idx = index; |
| 2564 | inst_base->br = NON_BRANCH; | 2553 | inst_base->br = NON_BRANCH; |
| 2565 | inst_base->load_r15 = 0; | 2554 | inst_base->load_r15 = 0; |
| 2566 | 2555 | ||
| 2567 | inst_cream->S = BIT(inst, 20); | 2556 | inst_cream->S = BIT(inst, 20); |
| 2568 | inst_cream->Rm = BITS(inst, 0, 3); | 2557 | inst_cream->Rm = BITS(inst, 0, 3); |
| 2569 | inst_cream->Rs = BITS(inst, 8, 11); | 2558 | inst_cream->Rs = BITS(inst, 8, 11); |
| 2570 | inst_cream->RdHi = BITS(inst, 16, 19); | 2559 | inst_cream->RdHi = BITS(inst, 16, 19); |
| 2571 | inst_cream->RdLo = BITS(inst, 12, 15); | 2560 | inst_cream->RdLo = BITS(inst, 12, 15); |
| 2572 | 2561 | ||
| @@ -2580,14 +2569,14 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(smulw)(unsigned int inst, int index) | |||
| 2580 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(smlad_inst)); | 2569 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(smlad_inst)); |
| 2581 | smlad_inst *inst_cream = (smlad_inst *)inst_base->component; | 2570 | smlad_inst *inst_cream = (smlad_inst *)inst_base->component; |
| 2582 | 2571 | ||
| 2583 | inst_base->cond = BITS(inst, 28, 31); | 2572 | inst_base->cond = BITS(inst, 28, 31); |
| 2584 | inst_base->idx = index; | 2573 | inst_base->idx = index; |
| 2585 | inst_base->br = NON_BRANCH; | 2574 | inst_base->br = NON_BRANCH; |
| 2586 | inst_base->load_r15 = 0; | 2575 | inst_base->load_r15 = 0; |
| 2587 | 2576 | ||
| 2588 | inst_cream->m = BIT(inst, 6); | 2577 | inst_cream->m = BIT(inst, 6); |
| 2589 | inst_cream->Rm = BITS(inst, 8, 11); | 2578 | inst_cream->Rm = BITS(inst, 8, 11); |
| 2590 | inst_cream->Rn = BITS(inst, 0, 3); | 2579 | inst_cream->Rn = BITS(inst, 0, 3); |
| 2591 | inst_cream->Rd = BITS(inst, 16, 19); | 2580 | inst_cream->Rd = BITS(inst, 16, 19); |
| 2592 | 2581 | ||
| 2593 | if (CHECK_RM || CHECK_RN) | 2582 | if (CHECK_RM || CHECK_RN) |
| @@ -2633,9 +2622,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(ssat16)(unsigned int inst, int index) | |||
| 2633 | ARM_INST_PTR INTERPRETER_TRANSLATE(stc)(unsigned int inst, int index) | 2622 | ARM_INST_PTR INTERPRETER_TRANSLATE(stc)(unsigned int inst, int index) |
| 2634 | { | 2623 | { |
| 2635 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(stc_inst)); | 2624 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(stc_inst)); |
| 2636 | inst_base->cond = BITS(inst, 28, 31); | 2625 | inst_base->cond = BITS(inst, 28, 31); |
| 2637 | inst_base->idx = index; | 2626 | inst_base->idx = index; |
| 2638 | inst_base->br = NON_BRANCH; | 2627 | inst_base->br = NON_BRANCH; |
| 2639 | 2628 | ||
| 2640 | return inst_base; | 2629 | return inst_base; |
| 2641 | } | 2630 | } |
| @@ -2645,8 +2634,8 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(stm)(unsigned int inst, int index) | |||
| 2645 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; | 2634 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; |
| 2646 | 2635 | ||
| 2647 | inst_base->cond = BITS(inst, 28, 31); | 2636 | inst_base->cond = BITS(inst, 28, 31); |
| 2648 | inst_base->idx = index; | 2637 | inst_base->idx = index; |
| 2649 | inst_base->br = NON_BRANCH; | 2638 | inst_base->br = NON_BRANCH; |
| 2650 | 2639 | ||
| 2651 | inst_cream->inst = inst; | 2640 | inst_cream->inst = inst; |
| 2652 | inst_cream->get_addr = get_calc_addr_op(inst); | 2641 | inst_cream->get_addr = get_calc_addr_op(inst); |
| @@ -2657,9 +2646,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(sxtb)(unsigned int inst, int index) | |||
| 2657 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(sxtb_inst)); | 2646 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(sxtb_inst)); |
| 2658 | sxtb_inst *inst_cream = (sxtb_inst *)inst_base->component; | 2647 | sxtb_inst *inst_cream = (sxtb_inst *)inst_base->component; |
| 2659 | 2648 | ||
| 2660 | inst_base->cond = BITS(inst, 28, 31); | 2649 | inst_base->cond = BITS(inst, 28, 31); |
| 2661 | inst_base->idx = index; | 2650 | inst_base->idx = index; |
| 2662 | inst_base->br = NON_BRANCH; | 2651 | inst_base->br = NON_BRANCH; |
| 2663 | inst_base->load_r15 = 0; | 2652 | inst_base->load_r15 = 0; |
| 2664 | 2653 | ||
| 2665 | inst_cream->Rd = BITS(inst, 12, 15); | 2654 | inst_cream->Rd = BITS(inst, 12, 15); |
| @@ -2676,8 +2665,8 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(str)(unsigned int inst, int index) | |||
| 2676 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; | 2665 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; |
| 2677 | 2666 | ||
| 2678 | inst_base->cond = BITS(inst, 28, 31); | 2667 | inst_base->cond = BITS(inst, 28, 31); |
| 2679 | inst_base->idx = index; | 2668 | inst_base->idx = index; |
| 2680 | inst_base->br = NON_BRANCH; | 2669 | inst_base->br = NON_BRANCH; |
| 2681 | 2670 | ||
| 2682 | inst_cream->inst = inst; | 2671 | inst_cream->inst = inst; |
| 2683 | inst_cream->get_addr = get_calc_addr_op(inst); | 2672 | inst_cream->get_addr = get_calc_addr_op(inst); |
| @@ -2692,9 +2681,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(uxtb)(unsigned int inst, int index) | |||
| 2692 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(uxth_inst)); | 2681 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(uxth_inst)); |
| 2693 | uxth_inst *inst_cream = (uxth_inst *)inst_base->component; | 2682 | uxth_inst *inst_cream = (uxth_inst *)inst_base->component; |
| 2694 | 2683 | ||
| 2695 | inst_base->cond = BITS(inst, 28, 31); | 2684 | inst_base->cond = BITS(inst, 28, 31); |
| 2696 | inst_base->idx = index; | 2685 | inst_base->idx = index; |
| 2697 | inst_base->br = NON_BRANCH; | 2686 | inst_base->br = NON_BRANCH; |
| 2698 | inst_base->load_r15 = 0; | 2687 | inst_base->load_r15 = 0; |
| 2699 | 2688 | ||
| 2700 | inst_cream->Rd = BITS(inst, 12, 15); | 2689 | inst_cream->Rd = BITS(inst, 12, 15); |
| @@ -2710,9 +2699,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(uxtab)(unsigned int inst, int index) | |||
| 2710 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(uxtab_inst)); | 2699 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(uxtab_inst)); |
| 2711 | uxtab_inst *inst_cream = (uxtab_inst *)inst_base->component; | 2700 | uxtab_inst *inst_cream = (uxtab_inst *)inst_base->component; |
| 2712 | 2701 | ||
| 2713 | inst_base->cond = BITS(inst, 28, 31); | 2702 | inst_base->cond = BITS(inst, 28, 31); |
| 2714 | inst_base->idx = index; | 2703 | inst_base->idx = index; |
| 2715 | inst_base->br = NON_BRANCH; | 2704 | inst_base->br = NON_BRANCH; |
| 2716 | inst_base->load_r15 = 0; | 2705 | inst_base->load_r15 = 0; |
| 2717 | 2706 | ||
| 2718 | inst_cream->Rd = BITS(inst, 12, 15); | 2707 | inst_cream->Rd = BITS(inst, 12, 15); |
| @@ -2728,8 +2717,8 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(strb)(unsigned int inst, int index) | |||
| 2728 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; | 2717 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; |
| 2729 | 2718 | ||
| 2730 | inst_base->cond = BITS(inst, 28, 31); | 2719 | inst_base->cond = BITS(inst, 28, 31); |
| 2731 | inst_base->idx = index; | 2720 | inst_base->idx = index; |
| 2732 | inst_base->br = NON_BRANCH; | 2721 | inst_base->br = NON_BRANCH; |
| 2733 | 2722 | ||
| 2734 | inst_cream->inst = inst; | 2723 | inst_cream->inst = inst; |
| 2735 | inst_cream->get_addr = get_calc_addr_op(inst); | 2724 | inst_cream->get_addr = get_calc_addr_op(inst); |
| @@ -2768,8 +2757,8 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(strd)(unsigned int inst, int index){ | |||
| 2768 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; | 2757 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; |
| 2769 | 2758 | ||
| 2770 | inst_base->cond = BITS(inst, 28, 31); | 2759 | inst_base->cond = BITS(inst, 28, 31); |
| 2771 | inst_base->idx = index; | 2760 | inst_base->idx = index; |
| 2772 | inst_base->br = NON_BRANCH; | 2761 | inst_base->br = NON_BRANCH; |
| 2773 | 2762 | ||
| 2774 | inst_cream->inst = inst; | 2763 | inst_cream->inst = inst; |
| 2775 | inst_cream->get_addr = get_calc_addr_op(inst); | 2764 | inst_cream->get_addr = get_calc_addr_op(inst); |
| @@ -2812,8 +2801,8 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(strh)(unsigned int inst, int index) | |||
| 2812 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; | 2801 | ldst_inst *inst_cream = (ldst_inst *)inst_base->component; |
| 2813 | 2802 | ||
| 2814 | inst_base->cond = BITS(inst, 28, 31); | 2803 | inst_base->cond = BITS(inst, 28, 31); |
| 2815 | inst_base->idx = index; | 2804 | inst_base->idx = index; |
| 2816 | inst_base->br = NON_BRANCH; | 2805 | inst_base->br = NON_BRANCH; |
| 2817 | 2806 | ||
| 2818 | inst_cream->inst = inst; | 2807 | inst_cream->inst = inst; |
| 2819 | inst_cream->get_addr = get_calc_addr_op(inst); | 2808 | inst_cream->get_addr = get_calc_addr_op(inst); |
| @@ -2856,15 +2845,15 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(sub)(unsigned int inst, int index) | |||
| 2856 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(sub_inst)); | 2845 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(sub_inst)); |
| 2857 | sub_inst *inst_cream = (sub_inst *)inst_base->component; | 2846 | sub_inst *inst_cream = (sub_inst *)inst_base->component; |
| 2858 | 2847 | ||
| 2859 | inst_base->cond = BITS(inst, 28, 31); | 2848 | inst_base->cond = BITS(inst, 28, 31); |
| 2860 | inst_base->idx = index; | 2849 | inst_base->idx = index; |
| 2861 | inst_base->br = NON_BRANCH; | 2850 | inst_base->br = NON_BRANCH; |
| 2862 | inst_base->load_r15 = 0; | 2851 | inst_base->load_r15 = 0; |
| 2863 | 2852 | ||
| 2864 | inst_cream->I = BIT(inst, 25); | 2853 | inst_cream->I = BIT(inst, 25); |
| 2865 | inst_cream->S = BIT(inst, 20); | 2854 | inst_cream->S = BIT(inst, 20); |
| 2866 | inst_cream->Rn = BITS(inst, 16, 19); | 2855 | inst_cream->Rn = BITS(inst, 16, 19); |
| 2867 | inst_cream->Rd = BITS(inst, 12, 15); | 2856 | inst_cream->Rd = BITS(inst, 12, 15); |
| 2868 | inst_cream->shifter_operand = BITS(inst, 0, 11); | 2857 | inst_cream->shifter_operand = BITS(inst, 0, 11); |
| 2869 | inst_cream->shtop_func = get_shtop(inst); | 2858 | inst_cream->shtop_func = get_shtop(inst); |
| 2870 | if (inst_cream->Rd == 15) { | 2859 | if (inst_cream->Rd == 15) { |
| @@ -3125,9 +3114,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(umlal)(unsigned int inst, int index) | |||
| 3125 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(umlal_inst)); | 3114 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(umlal_inst)); |
| 3126 | umlal_inst *inst_cream = (umlal_inst *)inst_base->component; | 3115 | umlal_inst *inst_cream = (umlal_inst *)inst_base->component; |
| 3127 | 3116 | ||
| 3128 | inst_base->cond = BITS(inst, 28, 31); | 3117 | inst_base->cond = BITS(inst, 28, 31); |
| 3129 | inst_base->idx = index; | 3118 | inst_base->idx = index; |
| 3130 | inst_base->br = NON_BRANCH; | 3119 | inst_base->br = NON_BRANCH; |
| 3131 | inst_base->load_r15 = 0; | 3120 | inst_base->load_r15 = 0; |
| 3132 | 3121 | ||
| 3133 | inst_cream->S = BIT(inst, 20); | 3122 | inst_cream->S = BIT(inst, 20); |
| @@ -3167,10 +3156,10 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(b_2_thumb)(unsigned int tinst, int index) | |||
| 3167 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(b_2_thumb)); | 3156 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(b_2_thumb)); |
| 3168 | b_2_thumb *inst_cream = (b_2_thumb *)inst_base->component; | 3157 | b_2_thumb *inst_cream = (b_2_thumb *)inst_base->component; |
| 3169 | 3158 | ||
| 3170 | inst_cream->imm = ((tinst & 0x3FF) << 1) | ((tinst & (1 << 10)) ? 0xFFFFF800 : 0); | 3159 | inst_cream->imm = ((tinst & 0x3FF) << 1) | ((tinst & (1 << 10)) ? 0xFFFFF800 : 0); |
| 3171 | 3160 | ||
| 3172 | inst_base->idx = index; | 3161 | inst_base->idx = index; |
| 3173 | inst_base->br = DIRECT_BRANCH; | 3162 | inst_base->br = DIRECT_BRANCH; |
| 3174 | 3163 | ||
| 3175 | return inst_base; | 3164 | return inst_base; |
| 3176 | } | 3165 | } |
| @@ -3180,10 +3169,10 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(b_cond_thumb)(unsigned int tinst, int index) | |||
| 3180 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(b_cond_thumb)); | 3169 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(b_cond_thumb)); |
| 3181 | b_cond_thumb *inst_cream = (b_cond_thumb *)inst_base->component; | 3170 | b_cond_thumb *inst_cream = (b_cond_thumb *)inst_base->component; |
| 3182 | 3171 | ||
| 3183 | inst_cream->imm = (((tinst & 0x7F) << 1) | ((tinst & (1 << 7)) ? 0xFFFFFF00 : 0)); | 3172 | inst_cream->imm = (((tinst & 0x7F) << 1) | ((tinst & (1 << 7)) ? 0xFFFFFF00 : 0)); |
| 3184 | inst_cream->cond = ((tinst >> 8) & 0xf); | 3173 | inst_cream->cond = ((tinst >> 8) & 0xf); |
| 3185 | inst_base->idx = index; | 3174 | inst_base->idx = index; |
| 3186 | inst_base->br = DIRECT_BRANCH; | 3175 | inst_base->br = DIRECT_BRANCH; |
| 3187 | 3176 | ||
| 3188 | return inst_base; | 3177 | return inst_base; |
| 3189 | } | 3178 | } |
| @@ -3193,10 +3182,10 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(bl_1_thumb)(unsigned int tinst, int index) | |||
| 3193 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(bl_1_thumb)); | 3182 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(bl_1_thumb)); |
| 3194 | bl_1_thumb *inst_cream = (bl_1_thumb *)inst_base->component; | 3183 | bl_1_thumb *inst_cream = (bl_1_thumb *)inst_base->component; |
| 3195 | 3184 | ||
| 3196 | inst_cream->imm = (((tinst & 0x07FF) << 12) | ((tinst & (1 << 10)) ? 0xFF800000 : 0)); | 3185 | inst_cream->imm = (((tinst & 0x07FF) << 12) | ((tinst & (1 << 10)) ? 0xFF800000 : 0)); |
| 3197 | 3186 | ||
| 3198 | inst_base->idx = index; | 3187 | inst_base->idx = index; |
| 3199 | inst_base->br = NON_BRANCH; | 3188 | inst_base->br = NON_BRANCH; |
| 3200 | return inst_base; | 3189 | return inst_base; |
| 3201 | } | 3190 | } |
| 3202 | ARM_INST_PTR INTERPRETER_TRANSLATE(bl_2_thumb)(unsigned int tinst, int index) | 3191 | ARM_INST_PTR INTERPRETER_TRANSLATE(bl_2_thumb)(unsigned int tinst, int index) |
| @@ -3204,10 +3193,10 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(bl_2_thumb)(unsigned int tinst, int index) | |||
| 3204 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(bl_2_thumb)); | 3193 | arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(bl_2_thumb)); |
| 3205 | bl_2_thumb *inst_cream = (bl_2_thumb *)inst_base->component; | 3194 | bl_2_thumb *inst_cream = (bl_2_thumb *)inst_base->component; |
| 3206 | 3195 | ||
| 3207 | inst_cream->imm = (tinst & 0x07FF) << 1; | 3196 | inst_cream->imm = (tinst & 0x07FF) << 1; |
| 3208 | 3197 | ||
| 3209 | inst_base->idx = index; | 3198 | inst_base->idx = index; |
| 3210 | inst_base->br = DIRECT_BRANCH; | 3199 | inst_base->br = DIRECT_BRANCH; |
| 3211 | return inst_base; | 3200 | return inst_base; |
| 3212 | } | 3201 | } |
| 3213 | ARM_INST_PTR INTERPRETER_TRANSLATE(blx_1_thumb)(unsigned int tinst, int index) | 3202 | ARM_INST_PTR INTERPRETER_TRANSLATE(blx_1_thumb)(unsigned int tinst, int index) |
| @@ -3533,7 +3522,6 @@ void insert_bb(unsigned int addr, int start) { | |||
| 3533 | CreamCache[addr] = start; | 3522 | CreamCache[addr] = start; |
| 3534 | } | 3523 | } |
| 3535 | 3524 | ||
| 3536 | #define TRANS_THRESHOLD 65000 | ||
| 3537 | int find_bb(unsigned int addr, int &start) { | 3525 | int find_bb(unsigned int addr, int &start) { |
| 3538 | int ret = -1; | 3526 | int ret = -1; |
| 3539 | bb_map::const_iterator it = CreamCache.find(addr); | 3527 | bb_map::const_iterator it = CreamCache.find(addr); |