diff options
| -rw-r--r-- | src/core/arm/dyncom/arm_dyncom_interpreter.cpp | 57 |
1 files changed, 55 insertions, 2 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp index b4ee64203..45e7b441f 100644 --- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp +++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp | |||
| @@ -3343,10 +3343,28 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(usat16)(unsigned int inst, int index) { UN | |||
| 3343 | ARM_INST_PTR INTERPRETER_TRANSLATE(usub16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("USUB16"); } | 3343 | ARM_INST_PTR INTERPRETER_TRANSLATE(usub16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("USUB16"); } |
| 3344 | ARM_INST_PTR INTERPRETER_TRANSLATE(usub8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("USUB8"); } | 3344 | ARM_INST_PTR INTERPRETER_TRANSLATE(usub8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("USUB8"); } |
| 3345 | ARM_INST_PTR INTERPRETER_TRANSLATE(usubaddx)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("USUBADDX"); } | 3345 | ARM_INST_PTR INTERPRETER_TRANSLATE(usubaddx)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("USUBADDX"); } |
| 3346 | ARM_INST_PTR INTERPRETER_TRANSLATE(uxtab16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UXTAB16"); } | ||
| 3347 | ARM_INST_PTR INTERPRETER_TRANSLATE(uxtb16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UXTB16"); } | ||
| 3348 | 3346 | ||
| 3347 | ARM_INST_PTR INTERPRETER_TRANSLATE(uxtab16)(unsigned int inst, int index) | ||
| 3348 | { | ||
| 3349 | arm_inst* const inst_base = (arm_inst*)AllocBuffer(sizeof(arm_inst) + sizeof(uxtab_inst)); | ||
| 3350 | uxtab_inst* const inst_cream = (uxtab_inst*)inst_base->component; | ||
| 3351 | |||
| 3352 | inst_base->cond = BITS(inst, 28, 31); | ||
| 3353 | inst_base->idx = index; | ||
| 3354 | inst_base->br = NON_BRANCH; | ||
| 3355 | inst_base->load_r15 = 0; | ||
| 3356 | |||
| 3357 | inst_cream->Rm = BITS(inst, 0, 3); | ||
| 3358 | inst_cream->Rn = BITS(inst, 16, 19); | ||
| 3359 | inst_cream->Rd = BITS(inst, 12, 15); | ||
| 3360 | inst_cream->rotate = BITS(inst, 10, 11); | ||
| 3349 | 3361 | ||
| 3362 | return inst_base; | ||
| 3363 | } | ||
| 3364 | ARM_INST_PTR INTERPRETER_TRANSLATE(uxtb16)(unsigned int inst, int index) | ||
| 3365 | { | ||
| 3366 | return INTERPRETER_TRANSLATE(uxtab16)(inst, index); | ||
| 3367 | } | ||
| 3350 | 3368 | ||
| 3351 | /* Floating point VFPv3 structures and instructions */ | 3369 | /* Floating point VFPv3 structures and instructions */ |
| 3352 | 3370 | ||
| @@ -7116,8 +7134,43 @@ unsigned InterpreterMainLoop(ARMul_State* state) | |||
| 7116 | USUB16_INST: | 7134 | USUB16_INST: |
| 7117 | USUB8_INST: | 7135 | USUB8_INST: |
| 7118 | USUBADDX_INST: | 7136 | USUBADDX_INST: |
| 7137 | |||
| 7119 | UXTAB16_INST: | 7138 | UXTAB16_INST: |
| 7120 | UXTB16_INST: | 7139 | UXTB16_INST: |
| 7140 | { | ||
| 7141 | INC_ICOUNTER; | ||
| 7142 | |||
| 7143 | if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) { | ||
| 7144 | uxtab_inst* const inst_cream = (uxtab_inst*)inst_base->component; | ||
| 7145 | |||
| 7146 | const u8 rn_idx = inst_cream->Rn; | ||
| 7147 | const u32 rm_val = RM; | ||
| 7148 | const u32 rotation = inst_cream->rotate * 8; | ||
| 7149 | const u32 rotated_rm = ((rm_val << (32 - rotation)) | (rm_val >> rotation)); | ||
| 7150 | |||
| 7151 | // UXTB16, otherwise UXTAB16 | ||
| 7152 | if (rn_idx == 15) { | ||
| 7153 | RD = rotated_rm & 0x00FF00FF; | ||
| 7154 | } | ||
| 7155 | else { | ||
| 7156 | const u32 rn_val = RN; | ||
| 7157 | |||
| 7158 | const u8 lo_rotated = (rotated_rm & 0xFF); | ||
| 7159 | const u16 lo_result = (rn_val & 0xFFFF) + (u16)lo_rotated; | ||
| 7160 | |||
| 7161 | const u8 hi_rotated = (rotated_rm >> 16) & 0xFF; | ||
| 7162 | const u16 hi_result = (rn_val >> 16) + (u16)hi_rotated; | ||
| 7163 | |||
| 7164 | RD = ((hi_result << 16) | (lo_result & 0xFFFF)); | ||
| 7165 | } | ||
| 7166 | } | ||
| 7167 | |||
| 7168 | cpu->Reg[15] += GET_INST_SIZE(cpu); | ||
| 7169 | INC_PC(sizeof(uxtab_inst)); | ||
| 7170 | FETCH_INST; | ||
| 7171 | GOTO_NEXT_INST; | ||
| 7172 | } | ||
| 7173 | |||
| 7121 | #define VFP_INTERPRETER_IMPL | 7174 | #define VFP_INTERPRETER_IMPL |
| 7122 | #include "core/arm/skyeye_common/vfp/vfpinstr.cpp" | 7175 | #include "core/arm/skyeye_common/vfp/vfpinstr.cpp" |
| 7123 | #undef VFP_INTERPRETER_IMPL | 7176 | #undef VFP_INTERPRETER_IMPL |