summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2015-03-10 08:13:56 -0400
committerGravatar Lioncash2015-03-10 08:13:58 -0400
commite34ba68e1fb33bbc024c718d76db9f09e3264990 (patch)
tree3aa8b3a16c7ae0e4347e28d429584f3a75eacfa3 /src
parentMerge pull request #643 from Subv/dem_feels (diff)
downloadyuzu-e34ba68e1fb33bbc024c718d76db9f09e3264990.tar.gz
yuzu-e34ba68e1fb33bbc024c718d76db9f09e3264990.tar.xz
yuzu-e34ba68e1fb33bbc024c718d76db9f09e3264990.zip
dyncom: Minor cleanup
Assemblers will exit with an error when trying to assemble instructions with disallowed registers.
Diffstat (limited to 'src')
-rw-r--r--src/core/arm/dyncom/arm_dyncom_interpreter.cpp33
1 files changed, 7 insertions, 26 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
index 2f72f5077..d953adba9 100644
--- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
+++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
@@ -4488,10 +4488,6 @@ unsigned InterpreterMainLoop(ARMul_State* state) {
4488 unsigned int operand2 = ROTATE_RIGHT_32(RM, 8 * inst_cream->rotate) & 0xffff; 4488 unsigned int operand2 = ROTATE_RIGHT_32(RM, 8 * inst_cream->rotate) & 0xffff;
4489 4489
4490 RD = RN + operand2; 4490 RD = RN + operand2;
4491 if (inst_cream->Rn == 15 || inst_cream->Rm == 15) {
4492 LOG_ERROR(Core_ARM11, "invalid operands for UXTAH");
4493 CITRA_IGNORE_EXIT(-1);
4494 }
4495 } 4491 }
4496 cpu->Reg[15] += GET_INST_SIZE(cpu); 4492 cpu->Reg[15] += GET_INST_SIZE(cpu);
4497 INC_PC(sizeof(uxtah_inst)); 4493 INC_PC(sizeof(uxtah_inst));
@@ -4822,10 +4818,7 @@ unsigned InterpreterMainLoop(ARMul_State* state) {
4822 uint64_t rm = RM; 4818 uint64_t rm = RM;
4823 uint64_t rs = RS; 4819 uint64_t rs = RS;
4824 uint64_t rn = RN; 4820 uint64_t rn = RN;
4825 if (inst_cream->Rm == 15 || inst_cream->Rs == 15 || inst_cream->Rn == 15) { 4821
4826 LOG_ERROR(Core_ARM11, "invalid operands for MLA");
4827 CITRA_IGNORE_EXIT(-1);
4828 }
4829 RD = static_cast<uint32_t>((rm * rs + rn) & 0xffffffff); 4822 RD = static_cast<uint32_t>((rm * rs + rn) & 0xffffffff);
4830 if (inst_cream->S) { 4823 if (inst_cream->S) {
4831 UPDATE_NFLAG(RD); 4824 UPDATE_NFLAG(RD);
@@ -5104,10 +5097,10 @@ unsigned InterpreterMainLoop(ARMul_State* state) {
5104 5097
5105 PLD_INST: 5098 PLD_INST:
5106 { 5099 {
5107 // Instruction not implemented 5100 // Not implemented. PLD is a hint instruction, so it's optional.
5108 //LOG_CRITICAL(Core_ARM11, "unimplemented instruction"); 5101
5109 cpu->Reg[15] += GET_INST_SIZE(cpu); 5102 cpu->Reg[15] += GET_INST_SIZE(cpu);
5110 INC_PC(sizeof(stc_inst)); 5103 INC_PC(sizeof(pld_inst));
5111 FETCH_INST; 5104 FETCH_INST;
5112 GOTO_NEXT_INST; 5105 GOTO_NEXT_INST;
5113 } 5106 }
@@ -6033,15 +6026,12 @@ unsigned InterpreterMainLoop(ARMul_State* state) {
6033 if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) { 6026 if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) {
6034 sxtb_inst* inst_cream = (sxtb_inst*)inst_base->component; 6027 sxtb_inst* inst_cream = (sxtb_inst*)inst_base->component;
6035 6028
6036 if (inst_cream->Rm == 15) {
6037 LOG_ERROR(Core_ARM11, "invalid operand for SXTB");
6038 CITRA_IGNORE_EXIT(-1);
6039 }
6040 unsigned int operand2 = ROTATE_RIGHT_32(RM, 8 * inst_cream->rotate); 6029 unsigned int operand2 = ROTATE_RIGHT_32(RM, 8 * inst_cream->rotate);
6041 if (BIT(operand2, 7)) { 6030 if (BIT(operand2, 7)) {
6042 operand2 |= 0xffffff00; 6031 operand2 |= 0xffffff00;
6043 } else 6032 } else {
6044 operand2 &= 0xff; 6033 operand2 &= 0xff;
6034 }
6045 RD = operand2; 6035 RD = operand2;
6046 } 6036 }
6047 cpu->Reg[15] += GET_INST_SIZE(cpu); 6037 cpu->Reg[15] += GET_INST_SIZE(cpu);
@@ -6299,8 +6289,7 @@ unsigned InterpreterMainLoop(ARMul_State* state) {
6299 swp_inst* inst_cream = (swp_inst*)inst_base->component; 6289 swp_inst* inst_cream = (swp_inst*)inst_base->component;
6300 6290
6301 addr = RN; 6291 addr = RN;
6302 unsigned int value; 6292 unsigned int value = Memory::Read32(addr);
6303 value = Memory::Read32(addr);
6304 Memory::Write32(addr, RM); 6293 Memory::Write32(addr, RM);
6305 6294
6306 RD = value; 6295 RD = value;
@@ -6329,10 +6318,6 @@ unsigned InterpreterMainLoop(ARMul_State* state) {
6329 if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) { 6318 if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) {
6330 sxtab_inst* inst_cream = (sxtab_inst*)inst_base->component; 6319 sxtab_inst* inst_cream = (sxtab_inst*)inst_base->component;
6331 6320
6332 // R15 should be check
6333 if(inst_cream->Rn == 15 || inst_cream->Rm == 15 || inst_cream->Rd ==15){
6334 CITRA_IGNORE_EXIT(-1);
6335 }
6336 unsigned int operand2 = ROTATE_RIGHT_32(RM, 8 * inst_cream->rotate) & 0xff; 6321 unsigned int operand2 = ROTATE_RIGHT_32(RM, 8 * inst_cream->rotate) & 0xff;
6337 6322
6338 // Sign extend for byte 6323 // Sign extend for byte
@@ -6383,10 +6368,6 @@ unsigned InterpreterMainLoop(ARMul_State* state) {
6383 if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) { 6368 if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) {
6384 sxtah_inst* inst_cream = (sxtah_inst*)inst_base->component; 6369 sxtah_inst* inst_cream = (sxtah_inst*)inst_base->component;
6385 6370
6386 // R15 should be check
6387 if(inst_cream->Rn == 15 || inst_cream->Rm == 15 || inst_cream->Rd ==15) {
6388 CITRA_IGNORE_EXIT(-1);
6389 }
6390 unsigned int operand2 = ROTATE_RIGHT_32(RM, 8 * inst_cream->rotate) & 0xffff; 6371 unsigned int operand2 = ROTATE_RIGHT_32(RM, 8 * inst_cream->rotate) & 0xffff;
6391 // Sign extend for half 6372 // Sign extend for half
6392 operand2 = (0x8000 & operand2) ? (0xFFFF0000 | operand2) : operand2; 6373 operand2 = (0x8000 & operand2) ? (0xFFFF0000 | operand2) : operand2;