summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2014-12-30 11:27:30 -0500
committerGravatar bunnei2014-12-30 11:27:30 -0500
commitc5c35c85e5a67ddfb721d63d15dbce21b2b28a1b (patch)
tree2070f7d5801855fde50a45089d53d13091eb7a77 /src
parentMerge pull request #370 from lioncash/moresat (diff)
parentvfp: Implement VMOVBRRSS (diff)
downloadyuzu-c5c35c85e5a67ddfb721d63d15dbce21b2b28a1b.tar.gz
yuzu-c5c35c85e5a67ddfb721d63d15dbce21b2b28a1b.tar.xz
yuzu-c5c35c85e5a67ddfb721d63d15dbce21b2b28a1b.zip
Merge pull request #371 from lioncash/vfp
vfp: Implement VMOVBRRSS
Diffstat (limited to 'src')
-rw-r--r--src/core/arm/skyeye_common/vfp/vfp.cpp20
-rw-r--r--src/core/arm/skyeye_common/vfp/vfp.h1
-rw-r--r--src/core/arm/skyeye_common/vfp/vfpinstr.cpp35
3 files changed, 44 insertions, 12 deletions
diff --git a/src/core/arm/skyeye_common/vfp/vfp.cpp b/src/core/arm/skyeye_common/vfp/vfp.cpp
index 5c036caeb..10d640f37 100644
--- a/src/core/arm/skyeye_common/vfp/vfp.cpp
+++ b/src/core/arm/skyeye_common/vfp/vfp.cpp
@@ -141,7 +141,7 @@ unsigned VFPMRRC(ARMul_State* state, unsigned type, u32 instr, u32* value1, u32*
141 { 141 {
142 if (CoProc == 10 && (OPC_1 & 0xD) == 1) 142 if (CoProc == 10 && (OPC_1 & 0xD) == 1)
143 { 143 {
144 VFP_DEBUG_UNIMPLEMENTED(VMOVBRRSS); 144 VMOVBRRSS(state, BIT(20), Rt, Rt2, BIT(5)<<4|CRm, value1, value2);
145 return ARMul_DONE; 145 return ARMul_DONE;
146 } 146 }
147 147
@@ -175,7 +175,7 @@ unsigned VFPMCRR(ARMul_State* state, unsigned type, u32 instr, u32 value1, u32 v
175 { 175 {
176 if (CoProc == 10 && (OPC_1 & 0xD) == 1) 176 if (CoProc == 10 && (OPC_1 & 0xD) == 1)
177 { 177 {
178 VFP_DEBUG_UNIMPLEMENTED(VMOVBRRSS); 178 VMOVBRRSS(state, BIT(20), Rt, Rt2, BIT(5)<<4|CRm, &value1, &value2);
179 return ARMul_DONE; 179 return ARMul_DONE;
180 } 180 }
181 181
@@ -504,6 +504,22 @@ void VMOVBRRD(ARMul_State* state, ARMword to_arm, ARMword t, ARMword t2, ARMword
504 state->ExtReg[n*2] = *value1; 504 state->ExtReg[n*2] = *value1;
505 } 505 }
506} 506}
507void VMOVBRRSS(ARMul_State* state, ARMword to_arm, ARMword t, ARMword t2, ARMword n, ARMword* value1, ARMword* value2)
508{
509 DBG("VMOV(BRRSS) :\n");
510 if (to_arm)
511 {
512 DBG("\tr[%d-%d] <= s[%d-%d]=[%x-%x]\n", t2, t, n+1, n, state->ExtReg[n+1], state->ExtReg[n]);
513 *value1 = state->ExtReg[n+0];
514 *value2 = state->ExtReg[n+1];
515 }
516 else
517 {
518 DBG("\ts[%d-%d] <= r[%d-%d]=[%x-%x]\n", n+1, n, t2, t, *value2, *value1);
519 state->ExtReg[n+0] = *value1;
520 state->ExtReg[n+1] = *value2;
521 }
522}
507 523
508/* ----------- MCR ------------ */ 524/* ----------- MCR ------------ */
509void VMSR(ARMul_State* state, ARMword reg, ARMword Rt) 525void VMSR(ARMul_State* state, ARMword reg, ARMword Rt)
diff --git a/src/core/arm/skyeye_common/vfp/vfp.h b/src/core/arm/skyeye_common/vfp/vfp.h
index f9e8d521d..539fb0131 100644
--- a/src/core/arm/skyeye_common/vfp/vfp.h
+++ b/src/core/arm/skyeye_common/vfp/vfp.h
@@ -97,6 +97,7 @@ u32 vfp_double_cpdo(ARMul_State* state, u32 inst, u32 fpscr);
97void VMRS(ARMul_State * state, ARMword reg, ARMword Rt, ARMword *value); 97void VMRS(ARMul_State * state, ARMword reg, ARMword Rt, ARMword *value);
98void VMOVBRS(ARMul_State * state, ARMword to_arm, ARMword t, ARMword n, ARMword *value); 98void VMOVBRS(ARMul_State * state, ARMword to_arm, ARMword t, ARMword n, ARMword *value);
99void VMOVBRRD(ARMul_State * state, ARMword to_arm, ARMword t, ARMword t2, ARMword n, ARMword *value1, ARMword *value2); 99void VMOVBRRD(ARMul_State * state, ARMword to_arm, ARMword t, ARMword t2, ARMword n, ARMword *value1, ARMword *value2);
100void VMOVBRRSS(ARMul_State* state, ARMword to_arm, ARMword t, ARMword t2, ARMword n, ARMword* value1, ARMword* value2);
100void VMOVI(ARMul_State * state, ARMword single, ARMword d, ARMword imm); 101void VMOVI(ARMul_State * state, ARMword single, ARMword d, ARMword imm);
101void VMOVR(ARMul_State * state, ARMword single, ARMword d, ARMword imm); 102void VMOVR(ARMul_State * state, ARMword single, ARMword d, ARMword imm);
102/* MCR */ 103/* MCR */
diff --git a/src/core/arm/skyeye_common/vfp/vfpinstr.cpp b/src/core/arm/skyeye_common/vfp/vfpinstr.cpp
index 27dc8a008..cc70fc33c 100644
--- a/src/core/arm/skyeye_common/vfp/vfpinstr.cpp
+++ b/src/core/arm/skyeye_common/vfp/vfpinstr.cpp
@@ -2702,7 +2702,7 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(vmovbrrss)(unsigned int inst, int index)
2702 inst_cream->t = BITS(inst, 12, 15); 2702 inst_cream->t = BITS(inst, 12, 15);
2703 inst_cream->t2 = BITS(inst, 16, 19); 2703 inst_cream->t2 = BITS(inst, 16, 19);
2704 inst_cream->m = BITS(inst, 0, 3)<<1|BIT(inst, 5); 2704 inst_cream->m = BITS(inst, 0, 3)<<1|BIT(inst, 5);
2705 2705
2706 return inst_base; 2706 return inst_base;
2707} 2707}
2708#endif 2708#endif
@@ -2711,10 +2711,11 @@ VMOVBRRSS_INST:
2711{ 2711{
2712 if ((inst_base->cond == 0xe) || CondPassed(cpu, inst_base->cond)) { 2712 if ((inst_base->cond == 0xe) || CondPassed(cpu, inst_base->cond)) {
2713 CHECK_VFP_ENABLED; 2713 CHECK_VFP_ENABLED;
2714 2714
2715 vmovbrrss_inst *inst_cream = (vmovbrrss_inst *)inst_base->component; 2715 vmovbrrss_inst* const inst_cream = (vmovbrrss_inst*)inst_base->component;
2716 2716
2717 VFP_DEBUG_UNIMPLEMENTED(VMOVBRRSS); 2717 VMOVBRRSS(cpu, inst_cream->to_arm, inst_cream->t, inst_cream->t2, inst_cream->m,
2718 &cpu->Reg[inst_cream->t], &cpu->Reg[inst_cream->t2]);
2718 } 2719 }
2719 cpu->Reg[15] += GET_INST_SIZE(cpu); 2720 cpu->Reg[15] += GET_INST_SIZE(cpu);
2720 INC_PC(sizeof(vmovbrrss_inst)); 2721 INC_PC(sizeof(vmovbrrss_inst));
@@ -2729,15 +2730,29 @@ DYNCOM_FILL_ACTION(vmovbrrss),
2729int DYNCOM_TAG(vmovbrrss)(cpu_t *cpu, addr_t pc, uint32_t instr, tag_t *tag, addr_t *new_pc, addr_t *next_pc) 2730int DYNCOM_TAG(vmovbrrss)(cpu_t *cpu, addr_t pc, uint32_t instr, tag_t *tag, addr_t *new_pc, addr_t *next_pc)
2730{ 2731{
2731 int instr_size = INSTR_SIZE; 2732 int instr_size = INSTR_SIZE;
2732 DBG("\t\tin %s instruction is not implemented.\n", __FUNCTION__); 2733
2733 arm_tag_trap(cpu, pc, instr, tag, new_pc, next_pc); 2734 arm_tag_continue(cpu, pc, instr, tag, new_pc, next_pc);
2735 if (instr >> 28 != 0xE)
2736 *tag |= TAG_CONDITIONAL;
2737
2734 return instr_size; 2738 return instr_size;
2735} 2739}
2736#endif 2740#endif
2737#ifdef VFP_DYNCOM_TRANS 2741#ifdef VFP_DYNCOM_TRANS
2738int DYNCOM_TRANS(vmovbrrss)(cpu_t *cpu, uint32_t instr, BasicBlock *bb, addr_t pc){ 2742int DYNCOM_TRANS(vmovbrrss)(cpu_t *cpu, uint32_t instr, BasicBlock *bb, addr_t pc)
2739 DBG("\t\tin %s instruction is not implemented.\n", __FUNCTION__); 2743{
2740 arch_arm_undef(cpu, bb, instr); 2744 int to_arm = BIT(20) == 1;
2745 int t = BITS(12, 15);
2746 int t2 = BITS(16, 19);
2747 int n = BIT(5)<<4 | BITS(0, 3);
2748 if (to_arm) {
2749 LET(t, IBITCAST32(FR32(n + 0)));
2750 LET(t2, IBITCAST32(FR32(n + 1)));
2751 }
2752 else {
2753 LETFPS(n + 0, FPBITCAST32(R(t)));
2754 LETFPS(n + 1, FPBITCAST32(R(t2)));
2755 }
2741 return No_exp; 2756 return No_exp;
2742} 2757}
2743#endif 2758#endif