diff options
| author | 2014-12-21 21:49:45 -0500 | |
|---|---|---|
| committer | 2014-12-21 21:49:45 -0500 | |
| commit | ae76469373a867ff4b50710ea1a91d2148484d17 (patch) | |
| tree | 53f0d29ef80be96f86311a694c7fbfa70f255c54 /src | |
| parent | Merge pull request #312 from Subv/still_more_savedata_stuff (diff) | |
| parent | dyncom: Move SEL over (diff) | |
| download | yuzu-ae76469373a867ff4b50710ea1a91d2148484d17.tar.gz yuzu-ae76469373a867ff4b50710ea1a91d2148484d17.tar.xz yuzu-ae76469373a867ff4b50710ea1a91d2148484d17.zip | |
Merge pull request #332 from lioncash/sel
dyncom: Move SEL over
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/arm/dyncom/arm_dyncom_interpreter.cpp | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp index b6b94b7a8..df698e8f1 100644 --- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp +++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp | |||
| @@ -2525,7 +2525,24 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(sbc)(unsigned int inst, int index) | |||
| 2525 | } | 2525 | } |
| 2526 | return inst_base; | 2526 | return inst_base; |
| 2527 | } | 2527 | } |
| 2528 | ARM_INST_PTR INTERPRETER_TRANSLATE(sel)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SEL"); } | 2528 | ARM_INST_PTR INTERPRETER_TRANSLATE(sel)(unsigned int inst, int index) |
| 2529 | { | ||
| 2530 | arm_inst* const inst_base = (arm_inst*)AllocBuffer(sizeof(arm_inst) + sizeof(generic_arm_inst)); | ||
| 2531 | generic_arm_inst* const inst_cream = (generic_arm_inst*)inst_base->component; | ||
| 2532 | |||
| 2533 | inst_base->cond = BITS(inst, 28, 31); | ||
| 2534 | inst_base->idx = index; | ||
| 2535 | inst_base->br = NON_BRANCH; | ||
| 2536 | inst_base->load_r15 = 0; | ||
| 2537 | |||
| 2538 | inst_cream->Rm = BITS(inst, 0, 3); | ||
| 2539 | inst_cream->Rn = BITS(inst, 16, 19); | ||
| 2540 | inst_cream->Rd = BITS(inst, 12, 15); | ||
| 2541 | inst_cream->op1 = BITS(inst, 20, 22); | ||
| 2542 | inst_cream->op2 = BITS(inst, 5, 7); | ||
| 2543 | |||
| 2544 | return inst_base; | ||
| 2545 | } | ||
| 2529 | ARM_INST_PTR INTERPRETER_TRANSLATE(setend)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SETEND"); } | 2546 | ARM_INST_PTR INTERPRETER_TRANSLATE(setend)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SETEND"); } |
| 2530 | ARM_INST_PTR INTERPRETER_TRANSLATE(shadd16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SHADD16"); } | 2547 | ARM_INST_PTR INTERPRETER_TRANSLATE(shadd16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SHADD16"); } |
| 2531 | ARM_INST_PTR INTERPRETER_TRANSLATE(shadd8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SHADD8"); } | 2548 | ARM_INST_PTR INTERPRETER_TRANSLATE(shadd8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SHADD8"); } |
| @@ -5764,7 +5781,47 @@ unsigned InterpreterMainLoop(ARMul_State* state) | |||
| 5764 | FETCH_INST; | 5781 | FETCH_INST; |
| 5765 | GOTO_NEXT_INST; | 5782 | GOTO_NEXT_INST; |
| 5766 | } | 5783 | } |
| 5784 | |||
| 5767 | SEL_INST: | 5785 | SEL_INST: |
| 5786 | { | ||
| 5787 | INC_ICOUNTER; | ||
| 5788 | if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) { | ||
| 5789 | generic_arm_inst* const inst_cream = (generic_arm_inst*)inst_base->component; | ||
| 5790 | |||
| 5791 | const u32 to = RM; | ||
| 5792 | const u32 from = RN; | ||
| 5793 | const u32 cpsr = cpu->Cpsr; | ||
| 5794 | |||
| 5795 | u32 result; | ||
| 5796 | if (cpsr & (1 << 16)) | ||
| 5797 | result = from & 0xff; | ||
| 5798 | else | ||
| 5799 | result = to & 0xff; | ||
| 5800 | |||
| 5801 | if (cpsr & (1 << 17)) | ||
| 5802 | result |= from & 0x0000ff00; | ||
| 5803 | else | ||
| 5804 | result |= to & 0x0000ff00; | ||
| 5805 | |||
| 5806 | if (cpsr & (1 << 18)) | ||
| 5807 | result |= from & 0x00ff0000; | ||
| 5808 | else | ||
| 5809 | result |= to & 0x00ff0000; | ||
| 5810 | |||
| 5811 | if (cpsr & (1 << 19)) | ||
| 5812 | result |= from & 0xff000000; | ||
| 5813 | else | ||
| 5814 | result |= to & 0xff000000; | ||
| 5815 | |||
| 5816 | RD = result; | ||
| 5817 | } | ||
| 5818 | |||
| 5819 | cpu->Reg[15] += GET_INST_SIZE(cpu); | ||
| 5820 | INC_PC(sizeof(generic_arm_inst)); | ||
| 5821 | FETCH_INST; | ||
| 5822 | GOTO_NEXT_INST; | ||
| 5823 | } | ||
| 5824 | |||
| 5768 | SETEND_INST: | 5825 | SETEND_INST: |
| 5769 | SHADD16_INST: | 5826 | SHADD16_INST: |
| 5770 | SHADD8_INST: | 5827 | SHADD8_INST: |