diff options
| author | 2015-08-11 22:32:39 +0100 | |
|---|---|---|
| committer | 2015-08-11 22:38:44 +0100 | |
| commit | 5115d0177ed9f77b091adbbbfd22f2f0a568a4bb (patch) | |
| tree | 3a243eee2146980bcbd708a552ca082d172eeda7 /src/core/arm/dyncom | |
| parent | Merge pull request #1028 from aroulin/arm-disas-media-instr (diff) | |
| download | yuzu-5115d0177ed9f77b091adbbbfd22f2f0a568a4bb.tar.gz yuzu-5115d0177ed9f77b091adbbbfd22f2f0a568a4bb.tar.xz yuzu-5115d0177ed9f77b091adbbbfd22f2f0a568a4bb.zip | |
ARM Core, Video Core, CitraQt, Citrace: Use CommonTypes types instead of the standard u?int*_t types.
Diffstat (limited to 'src/core/arm/dyncom')
| -rw-r--r-- | src/core/arm/dyncom/arm_dyncom_interpreter.cpp | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp index b88b74752..422e80b50 100644 --- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp +++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <algorithm> | 7 | #include <algorithm> |
| 8 | #include <cstdio> | 8 | #include <cstdio> |
| 9 | 9 | ||
| 10 | #include "common/common_types.h" | ||
| 10 | #include "common/logging/log.h" | 11 | #include "common/logging/log.h" |
| 11 | #include "common/profiler.h" | 12 | #include "common/profiler.h" |
| 12 | 13 | ||
| @@ -759,8 +760,8 @@ struct bx_inst { | |||
| 759 | 760 | ||
| 760 | struct blx_inst { | 761 | struct blx_inst { |
| 761 | union { | 762 | union { |
| 762 | int32_t signed_immed_24; | 763 | s32 signed_immed_24; |
| 763 | uint32_t Rm; | 764 | u32 Rm; |
| 764 | } val; | 765 | } val; |
| 765 | unsigned int inst; | 766 | unsigned int inst; |
| 766 | }; | 767 | }; |
| @@ -3544,7 +3545,7 @@ static int InterpreterTranslate(ARMul_State* cpu, int& bb_start, u32 addr) { | |||
| 3544 | size++; | 3545 | size++; |
| 3545 | // If we are in Thumb mode, we'll translate one Thumb instruction to the corresponding ARM instruction | 3546 | // If we are in Thumb mode, we'll translate one Thumb instruction to the corresponding ARM instruction |
| 3546 | if (cpu->TFlag) { | 3547 | if (cpu->TFlag) { |
| 3547 | uint32_t arm_inst; | 3548 | u32 arm_inst; |
| 3548 | ThumbDecodeStatus state = DecodeThumbInstruction(inst, phys_addr, &arm_inst, &inst_size, &inst_base); | 3549 | ThumbDecodeStatus state = DecodeThumbInstruction(inst, phys_addr, &arm_inst, &inst_size, &inst_base); |
| 3549 | 3550 | ||
| 3550 | // We have translated the Thumb branch instruction in the Thumb decoder | 3551 | // We have translated the Thumb branch instruction in the Thumb decoder |
| @@ -4215,8 +4216,8 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { | |||
| 4215 | CPS_INST: | 4216 | CPS_INST: |
| 4216 | { | 4217 | { |
| 4217 | cps_inst *inst_cream = (cps_inst *)inst_base->component; | 4218 | cps_inst *inst_cream = (cps_inst *)inst_base->component; |
| 4218 | uint32_t aif_val = 0; | 4219 | u32 aif_val = 0; |
| 4219 | uint32_t aif_mask = 0; | 4220 | u32 aif_mask = 0; |
| 4220 | if (cpu->InAPrivilegedMode()) { | 4221 | if (cpu->InAPrivilegedMode()) { |
| 4221 | if (inst_cream->imod1) { | 4222 | if (inst_cream->imod1) { |
| 4222 | if (inst_cream->A) { | 4223 | if (inst_cream->A) { |
| @@ -4710,11 +4711,11 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { | |||
| 4710 | if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) { | 4711 | if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) { |
| 4711 | mla_inst* inst_cream = (mla_inst*)inst_base->component; | 4712 | mla_inst* inst_cream = (mla_inst*)inst_base->component; |
| 4712 | 4713 | ||
| 4713 | uint64_t rm = RM; | 4714 | u64 rm = RM; |
| 4714 | uint64_t rs = RS; | 4715 | u64 rs = RS; |
| 4715 | uint64_t rn = RN; | 4716 | u64 rn = RN; |
| 4716 | 4717 | ||
| 4717 | RD = static_cast<uint32_t>((rm * rs + rn) & 0xffffffff); | 4718 | RD = static_cast<u32>((rm * rs + rn) & 0xffffffff); |
| 4718 | if (inst_cream->S) { | 4719 | if (inst_cream->S) { |
| 4719 | UPDATE_NFLAG(RD); | 4720 | UPDATE_NFLAG(RD); |
| 4720 | UPDATE_ZFLAG(RD); | 4721 | UPDATE_ZFLAG(RD); |
| @@ -4819,7 +4820,7 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { | |||
| 4819 | { | 4820 | { |
| 4820 | if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) { | 4821 | if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) { |
| 4821 | msr_inst* inst_cream = (msr_inst*)inst_base->component; | 4822 | msr_inst* inst_cream = (msr_inst*)inst_base->component; |
| 4822 | const uint32_t UserMask = 0xf80f0200, PrivMask = 0x000001df, StateMask = 0x01000020; | 4823 | const u32 UserMask = 0xf80f0200, PrivMask = 0x000001df, StateMask = 0x01000020; |
| 4823 | unsigned int inst = inst_cream->inst; | 4824 | unsigned int inst = inst_cream->inst; |
| 4824 | unsigned int operand; | 4825 | unsigned int operand; |
| 4825 | 4826 | ||
| @@ -4829,9 +4830,9 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { | |||
| 4829 | } else { | 4830 | } else { |
| 4830 | operand = cpu->Reg[BITS(inst, 0, 3)]; | 4831 | operand = cpu->Reg[BITS(inst, 0, 3)]; |
| 4831 | } | 4832 | } |
| 4832 | uint32_t byte_mask = (BIT(inst, 16) ? 0xff : 0) | (BIT(inst, 17) ? 0xff00 : 0) | 4833 | u32 byte_mask = (BIT(inst, 16) ? 0xff : 0) | (BIT(inst, 17) ? 0xff00 : 0) |
| 4833 | | (BIT(inst, 18) ? 0xff0000 : 0) | (BIT(inst, 19) ? 0xff000000 : 0); | 4834 | | (BIT(inst, 18) ? 0xff0000 : 0) | (BIT(inst, 19) ? 0xff000000 : 0); |
| 4834 | uint32_t mask = 0; | 4835 | u32 mask = 0; |
| 4835 | if (!inst_cream->R) { | 4836 | if (!inst_cream->R) { |
| 4836 | if (cpu->InAPrivilegedMode()) { | 4837 | if (cpu->InAPrivilegedMode()) { |
| 4837 | if ((operand & StateMask) != 0) { | 4838 | if ((operand & StateMask) != 0) { |
| @@ -4864,9 +4865,9 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { | |||
| 4864 | if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) { | 4865 | if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) { |
| 4865 | mul_inst* inst_cream = (mul_inst*)inst_base->component; | 4866 | mul_inst* inst_cream = (mul_inst*)inst_base->component; |
| 4866 | 4867 | ||
| 4867 | uint64_t rm = RM; | 4868 | u64 rm = RM; |
| 4868 | uint64_t rs = RS; | 4869 | u64 rs = RS; |
| 4869 | RD = static_cast<uint32_t>((rm * rs) & 0xffffffff); | 4870 | RD = static_cast<u32>((rm * rs) & 0xffffffff); |
| 4870 | if (inst_cream->S) { | 4871 | if (inst_cream->S) { |
| 4871 | UPDATE_NFLAG(RD); | 4872 | UPDATE_NFLAG(RD); |
| 4872 | UPDATE_ZFLAG(RD); | 4873 | UPDATE_ZFLAG(RD); |
| @@ -5532,7 +5533,7 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { | |||
| 5532 | { | 5533 | { |
| 5533 | if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) { | 5534 | if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) { |
| 5534 | smla_inst* inst_cream = (smla_inst*)inst_base->component; | 5535 | smla_inst* inst_cream = (smla_inst*)inst_base->component; |
| 5535 | int32_t operand1, operand2; | 5536 | s32 operand1, operand2; |
| 5536 | if (inst_cream->x == 0) | 5537 | if (inst_cream->x == 0) |
| 5537 | operand1 = (BIT(RM, 15)) ? (BITS(RM, 0, 15) | 0xffff0000) : BITS(RM, 0, 15); | 5538 | operand1 = (BIT(RM, 15)) ? (BITS(RM, 0, 15) | 0xffff0000) : BITS(RM, 0, 15); |
| 5538 | else | 5539 | else |
| @@ -5771,7 +5772,7 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { | |||
| 5771 | { | 5772 | { |
| 5772 | if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) { | 5773 | if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) { |
| 5773 | smul_inst* inst_cream = (smul_inst*)inst_base->component; | 5774 | smul_inst* inst_cream = (smul_inst*)inst_base->component; |
| 5774 | uint32_t operand1, operand2; | 5775 | u32 operand1, operand2; |
| 5775 | if (inst_cream->x == 0) | 5776 | if (inst_cream->x == 0) |
| 5776 | operand1 = (BIT(RM, 15)) ? (BITS(RM, 0, 15) | 0xffff0000) : BITS(RM, 0, 15); | 5777 | operand1 = (BIT(RM, 15)) ? (BITS(RM, 0, 15) | 0xffff0000) : BITS(RM, 0, 15); |
| 5777 | else | 5778 | else |
| @@ -5792,15 +5793,15 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { | |||
| 5792 | { | 5793 | { |
| 5793 | if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) { | 5794 | if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) { |
| 5794 | umull_inst* inst_cream = (umull_inst*)inst_base->component; | 5795 | umull_inst* inst_cream = (umull_inst*)inst_base->component; |
| 5795 | int64_t rm = RM; | 5796 | s64 rm = RM; |
| 5796 | int64_t rs = RS; | 5797 | s64 rs = RS; |
| 5797 | if (BIT(rm, 31)) { | 5798 | if (BIT(rm, 31)) { |
| 5798 | rm |= 0xffffffff00000000LL; | 5799 | rm |= 0xffffffff00000000LL; |
| 5799 | } | 5800 | } |
| 5800 | if (BIT(rs, 31)) { | 5801 | if (BIT(rs, 31)) { |
| 5801 | rs |= 0xffffffff00000000LL; | 5802 | rs |= 0xffffffff00000000LL; |
| 5802 | } | 5803 | } |
| 5803 | int64_t rst = rm * rs; | 5804 | s64 rst = rm * rs; |
| 5804 | RDHI = BITS(rst, 32, 63); | 5805 | RDHI = BITS(rst, 32, 63); |
| 5805 | RDLO = BITS(rst, 0, 31); | 5806 | RDLO = BITS(rst, 0, 31); |
| 5806 | 5807 | ||