summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2015-04-06 21:21:59 -0400
committerGravatar bunnei2015-04-06 21:21:59 -0400
commit11bd6024fb2d09b11df3ef12f7188a5b3be5c577 (patch)
treed1bd33914eb7b8a0ec77ef4badefd318d2da8c5d /src
parentMerge pull request #685 from lioncash/cpregs (diff)
parentvfp: Make the FPSID values match the MPCore (diff)
downloadyuzu-11bd6024fb2d09b11df3ef12f7188a5b3be5c577.tar.gz
yuzu-11bd6024fb2d09b11df3ef12f7188a5b3be5c577.tar.xz
yuzu-11bd6024fb2d09b11df3ef12f7188a5b3be5c577.zip
Merge pull request #686 from lioncash/vfp
vfp: Minor cleanups
Diffstat (limited to '')
-rw-r--r--src/core/arm/skyeye_common/arm_regformat.h15
-rw-r--r--src/core/arm/skyeye_common/armdefs.h6
-rw-r--r--src/core/arm/skyeye_common/vfp/asm_vfp.h14
-rw-r--r--src/core/arm/skyeye_common/vfp/vfp.cpp28
-rw-r--r--src/core/arm/skyeye_common/vfp/vfp.h2
-rw-r--r--src/core/arm/skyeye_common/vfp/vfpinstr.cpp82
6 files changed, 76 insertions, 71 deletions
diff --git a/src/core/arm/skyeye_common/arm_regformat.h b/src/core/arm/skyeye_common/arm_regformat.h
index d125dc2fc..6c89774eb 100644
--- a/src/core/arm/skyeye_common/arm_regformat.h
+++ b/src/core/arm/skyeye_common/arm_regformat.h
@@ -51,13 +51,18 @@ enum {
51 EXCLUSIVE_STATE, 51 EXCLUSIVE_STATE,
52 EXCLUSIVE_RESULT, 52 EXCLUSIVE_RESULT,
53 53
54 // VFP registers 54 MAX_REG_NUM,
55 VFP_BASE, 55};
56 VFP_FPSID = VFP_BASE, 56
57// VFP system registers
58enum {
59 VFP_FPSID,
57 VFP_FPSCR, 60 VFP_FPSCR,
58 VFP_FPEXC, 61 VFP_FPEXC,
59 62
60 MAX_REG_NUM, 63 // Not an actual register.
64 // All VFP system registers should be defined above this.
65 VFP_SYSTEM_REGISTER_COUNT
61}; 66};
62 67
63enum CP15Register { 68enum CP15Register {
@@ -176,5 +181,3 @@ enum CP15Register {
176 // All registers should be defined above this. 181 // All registers should be defined above this.
177 CP15_REGISTER_COUNT, 182 CP15_REGISTER_COUNT,
178}; 183};
179
180#define VFP_OFFSET(x) (x - VFP_BASE)
diff --git a/src/core/arm/skyeye_common/armdefs.h b/src/core/arm/skyeye_common/armdefs.h
index 12fa533f7..743e935f0 100644
--- a/src/core/arm/skyeye_common/armdefs.h
+++ b/src/core/arm/skyeye_common/armdefs.h
@@ -92,13 +92,15 @@ struct ARMul_State
92 ARMword exclusive_state; 92 ARMword exclusive_state;
93 ARMword exclusive_result; 93 ARMword exclusive_result;
94 ARMword CP15[CP15_REGISTER_COUNT]; 94 ARMword CP15[CP15_REGISTER_COUNT];
95 ARMword VFP[3]; // FPSID, FPSCR, and FPEXC 95
96 // FPSID, FPSCR, and FPEXC
97 ARMword VFP[VFP_SYSTEM_REGISTER_COUNT];
96 // VFPv2 and VFPv3-D16 has 16 doubleword registers (D0-D16 or S0-S31). 98 // VFPv2 and VFPv3-D16 has 16 doubleword registers (D0-D16 or S0-S31).
97 // VFPv3-D32/ASIMD may have up to 32 doubleword registers (D0-D31), 99 // VFPv3-D32/ASIMD may have up to 32 doubleword registers (D0-D31),
98 // and only 32 singleword registers are accessible (S0-S31). 100 // and only 32 singleword registers are accessible (S0-S31).
99 ARMword ExtReg[VFP_REG_NUM]; 101 ARMword ExtReg[VFP_REG_NUM];
100 /* ---- End of the ordered registers ---- */ 102 /* ---- End of the ordered registers ---- */
101 103
102 ARMword RegBank[7][16]; // all the registers 104 ARMword RegBank[7][16]; // all the registers
103 105
104 ARMword NFlag, ZFlag, CFlag, VFlag, IFFlags; // Dummy flags for speed 106 ARMword NFlag, ZFlag, CFlag, VFlag, IFFlags; // Dummy flags for speed
diff --git a/src/core/arm/skyeye_common/vfp/asm_vfp.h b/src/core/arm/skyeye_common/vfp/asm_vfp.h
index ccb7cf4d7..1187924f4 100644
--- a/src/core/arm/skyeye_common/vfp/asm_vfp.h
+++ b/src/core/arm/skyeye_common/vfp/asm_vfp.h
@@ -7,15 +7,15 @@
7 7
8#pragma once 8#pragma once
9 9
10// FPSID Information 10// ARM11 MPCore FPSID Information
11// Note that these are used as values and not as flags. 11// Note that these are used as values and not as flags.
12enum : u32 { 12enum : u32 {
13 VFP_FPSID_IMPLMEN = 0, // Implementation code. Should be the same as cp15 0 c0 0 13 VFP_FPSID_IMPLMEN = 0x41, // Implementation code. Should be the same as cp15 0 c0 0
14 VFP_FPSID_SW = 0, // Software emulation bit value 14 VFP_FPSID_SW = 0, // Software emulation bit value
15 VFP_FPSID_SUBARCH = 0x2, // Subarchitecture version number 15 VFP_FPSID_SUBARCH = 0x1, // Subarchitecture version number
16 VFP_FPSID_PARTNUM = 0x1, // Part number 16 VFP_FPSID_PARTNUM = 0x20, // Part number
17 VFP_FPSID_VARIANT = 0x1, // Variant number 17 VFP_FPSID_VARIANT = 0xB, // Variant number
18 VFP_FPSID_REVISION = 0x1 // Revision number 18 VFP_FPSID_REVISION = 0x4 // Revision number
19}; 19};
20 20
21// FPEXC bits 21// FPEXC bits
diff --git a/src/core/arm/skyeye_common/vfp/vfp.cpp b/src/core/arm/skyeye_common/vfp/vfp.cpp
index 6286e7b62..d793261fd 100644
--- a/src/core/arm/skyeye_common/vfp/vfp.cpp
+++ b/src/core/arm/skyeye_common/vfp/vfp.cpp
@@ -29,10 +29,10 @@
29 29
30unsigned VFPInit(ARMul_State* state) 30unsigned VFPInit(ARMul_State* state)
31{ 31{
32 state->VFP[VFP_OFFSET(VFP_FPSID)] = VFP_FPSID_IMPLMEN<<24 | VFP_FPSID_SW<<23 | VFP_FPSID_SUBARCH<<16 | 32 state->VFP[VFP_FPSID] = VFP_FPSID_IMPLMEN<<24 | VFP_FPSID_SW<<23 | VFP_FPSID_SUBARCH<<16 |
33 VFP_FPSID_PARTNUM<<8 | VFP_FPSID_VARIANT<<4 | VFP_FPSID_REVISION; 33 VFP_FPSID_PARTNUM<<8 | VFP_FPSID_VARIANT<<4 | VFP_FPSID_REVISION;
34 state->VFP[VFP_OFFSET(VFP_FPEXC)] = 0; 34 state->VFP[VFP_FPEXC] = 0;
35 state->VFP[VFP_OFFSET(VFP_FPSCR)] = 0; 35 state->VFP[VFP_FPSCR] = 0;
36 36
37 return 0; 37 return 0;
38} 38}
@@ -314,11 +314,11 @@ unsigned VFPCDP(ARMul_State* state, unsigned type, u32 instr)
314 314
315 int exceptions = 0; 315 int exceptions = 0;
316 if (CoProc == 10) 316 if (CoProc == 10)
317 exceptions = vfp_single_cpdo(state, instr, state->VFP[VFP_OFFSET(VFP_FPSCR)]); 317 exceptions = vfp_single_cpdo(state, instr, state->VFP[VFP_FPSCR]);
318 else 318 else
319 exceptions = vfp_double_cpdo(state, instr, state->VFP[VFP_OFFSET(VFP_FPSCR)]); 319 exceptions = vfp_double_cpdo(state, instr, state->VFP[VFP_FPSCR]);
320 320
321 vfp_raise_exceptions(state, exceptions, instr, state->VFP[VFP_OFFSET(VFP_FPSCR)]); 321 vfp_raise_exceptions(state, exceptions, instr, state->VFP[VFP_FPSCR]);
322 322
323 return ARMul_DONE; 323 return ARMul_DONE;
324 } 324 }
@@ -344,11 +344,11 @@ void VMRS(ARMul_State* state, ARMword reg, ARMword Rt, ARMword* value)
344 { 344 {
345 if (Rt != 15) 345 if (Rt != 15)
346 { 346 {
347 *value = state->VFP[VFP_OFFSET(VFP_FPSCR)]; 347 *value = state->VFP[VFP_FPSCR];
348 } 348 }
349 else 349 else
350 { 350 {
351 *value = state->VFP[VFP_OFFSET(VFP_FPSCR)] ; 351 *value = state->VFP[VFP_FPSCR] ;
352 } 352 }
353 } 353 }
354 else 354 else
@@ -356,7 +356,7 @@ void VMRS(ARMul_State* state, ARMword reg, ARMword Rt, ARMword* value)
356 switch (reg) 356 switch (reg)
357 { 357 {
358 case 0: 358 case 0:
359 *value = state->VFP[VFP_OFFSET(VFP_FPSID)]; 359 *value = state->VFP[VFP_FPSID];
360 break; 360 break;
361 case 6: 361 case 6:
362 /* MVFR1, VFPv3 only ? */ 362 /* MVFR1, VFPv3 only ? */
@@ -367,7 +367,7 @@ void VMRS(ARMul_State* state, ARMword reg, ARMword Rt, ARMword* value)
367 LOG_TRACE(Core_ARM11, "\tr%d <= MVFR0 unimplemented\n", Rt); 367 LOG_TRACE(Core_ARM11, "\tr%d <= MVFR0 unimplemented\n", Rt);
368 break; 368 break;
369 case 8: 369 case 8:
370 *value = state->VFP[VFP_OFFSET(VFP_FPEXC)]; 370 *value = state->VFP[VFP_FPEXC];
371 break; 371 break;
372 default: 372 default:
373 LOG_TRACE(Core_ARM11, "\tSUBARCHITECTURE DEFINED\n"); 373 LOG_TRACE(Core_ARM11, "\tSUBARCHITECTURE DEFINED\n");
@@ -407,11 +407,11 @@ void VMSR(ARMul_State* state, ARMword reg, ARMword Rt)
407{ 407{
408 if (reg == 1) 408 if (reg == 1)
409 { 409 {
410 state->VFP[VFP_OFFSET(VFP_FPSCR)] = state->Reg[Rt]; 410 state->VFP[VFP_FPSCR] = state->Reg[Rt];
411 } 411 }
412 else if (reg == 8) 412 else if (reg == 8)
413 { 413 {
414 state->VFP[VFP_OFFSET(VFP_FPEXC)] = state->Reg[Rt]; 414 state->VFP[VFP_FPEXC] = state->Reg[Rt];
415 } 415 }
416} 416}
417 417
@@ -774,5 +774,5 @@ void vfp_raise_exceptions(ARMul_State* state, u32 exceptions, u32 inst, u32 fpsc
774 774
775 fpscr |= exceptions; 775 fpscr |= exceptions;
776 776
777 state->VFP[VFP_OFFSET(VFP_FPSCR)] = fpscr; 777 state->VFP[VFP_FPSCR] = fpscr;
778} 778}
diff --git a/src/core/arm/skyeye_common/vfp/vfp.h b/src/core/arm/skyeye_common/vfp/vfp.h
index 445a224bc..1b72383e7 100644
--- a/src/core/arm/skyeye_common/vfp/vfp.h
+++ b/src/core/arm/skyeye_common/vfp/vfp.h
@@ -25,7 +25,7 @@
25#define VFP_DEBUG_UNIMPLEMENTED(x) LOG_ERROR(Core_ARM11, "in func %s, " #x " unimplemented\n", __FUNCTION__); exit(-1); 25#define VFP_DEBUG_UNIMPLEMENTED(x) LOG_ERROR(Core_ARM11, "in func %s, " #x " unimplemented\n", __FUNCTION__); exit(-1);
26#define VFP_DEBUG_UNTESTED(x) LOG_TRACE(Core_ARM11, "in func %s, " #x " untested\n", __FUNCTION__); 26#define VFP_DEBUG_UNTESTED(x) LOG_TRACE(Core_ARM11, "in func %s, " #x " untested\n", __FUNCTION__);
27#define CHECK_VFP_ENABLED 27#define CHECK_VFP_ENABLED
28#define CHECK_VFP_CDP_RET vfp_raise_exceptions(cpu, ret, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); //if (ret == -1) {printf("VFP CDP FAILURE %x\n", inst_cream->instr); exit(-1);} 28#define CHECK_VFP_CDP_RET vfp_raise_exceptions(cpu, ret, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
29 29
30unsigned VFPInit(ARMul_State* state); 30unsigned VFPInit(ARMul_State* state);
31unsigned VFPMRC(ARMul_State* state, unsigned type, ARMword instr, ARMword* value); 31unsigned VFPMRC(ARMul_State* state, unsigned type, ARMword instr, ARMword* value);
diff --git a/src/core/arm/skyeye_common/vfp/vfpinstr.cpp b/src/core/arm/skyeye_common/vfp/vfpinstr.cpp
index 368b5a25d..72afe2164 100644
--- a/src/core/arm/skyeye_common/vfp/vfpinstr.cpp
+++ b/src/core/arm/skyeye_common/vfp/vfpinstr.cpp
@@ -46,9 +46,9 @@ VMLA_INST:
46 int ret; 46 int ret;
47 47
48 if (inst_cream->dp_operation) 48 if (inst_cream->dp_operation)
49 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 49 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
50 else 50 else
51 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 51 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
52 52
53 CHECK_VFP_CDP_RET; 53 CHECK_VFP_CDP_RET;
54 } 54 }
@@ -96,9 +96,9 @@ VMLS_INST:
96 int ret; 96 int ret;
97 97
98 if (inst_cream->dp_operation) 98 if (inst_cream->dp_operation)
99 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 99 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
100 else 100 else
101 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 101 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
102 102
103 CHECK_VFP_CDP_RET; 103 CHECK_VFP_CDP_RET;
104 } 104 }
@@ -146,9 +146,9 @@ VNMLA_INST:
146 int ret; 146 int ret;
147 147
148 if (inst_cream->dp_operation) 148 if (inst_cream->dp_operation)
149 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 149 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
150 else 150 else
151 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 151 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
152 152
153 CHECK_VFP_CDP_RET; 153 CHECK_VFP_CDP_RET;
154 } 154 }
@@ -197,9 +197,9 @@ VNMLS_INST:
197 int ret; 197 int ret;
198 198
199 if (inst_cream->dp_operation) 199 if (inst_cream->dp_operation)
200 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 200 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
201 else 201 else
202 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 202 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
203 203
204 CHECK_VFP_CDP_RET; 204 CHECK_VFP_CDP_RET;
205 } 205 }
@@ -247,9 +247,9 @@ VNMUL_INST:
247 int ret; 247 int ret;
248 248
249 if (inst_cream->dp_operation) 249 if (inst_cream->dp_operation)
250 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 250 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
251 else 251 else
252 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 252 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
253 253
254 CHECK_VFP_CDP_RET; 254 CHECK_VFP_CDP_RET;
255 } 255 }
@@ -297,9 +297,9 @@ VMUL_INST:
297 int ret; 297 int ret;
298 298
299 if (inst_cream->dp_operation) 299 if (inst_cream->dp_operation)
300 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 300 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
301 else 301 else
302 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 302 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
303 303
304 CHECK_VFP_CDP_RET; 304 CHECK_VFP_CDP_RET;
305 } 305 }
@@ -347,9 +347,9 @@ VADD_INST:
347 int ret; 347 int ret;
348 348
349 if (inst_cream->dp_operation) 349 if (inst_cream->dp_operation)
350 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 350 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
351 else 351 else
352 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 352 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
353 353
354 CHECK_VFP_CDP_RET; 354 CHECK_VFP_CDP_RET;
355 } 355 }
@@ -397,9 +397,9 @@ VSUB_INST:
397 int ret; 397 int ret;
398 398
399 if (inst_cream->dp_operation) 399 if (inst_cream->dp_operation)
400 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 400 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
401 else 401 else
402 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 402 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
403 403
404 CHECK_VFP_CDP_RET; 404 CHECK_VFP_CDP_RET;
405 } 405 }
@@ -447,9 +447,9 @@ VDIV_INST:
447 int ret; 447 int ret;
448 448
449 if (inst_cream->dp_operation) 449 if (inst_cream->dp_operation)
450 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 450 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
451 else 451 else
452 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 452 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
453 453
454 CHECK_VFP_CDP_RET; 454 CHECK_VFP_CDP_RET;
455 } 455 }
@@ -591,9 +591,9 @@ VABS_INST:
591 int ret; 591 int ret;
592 592
593 if (inst_cream->dp_operation) 593 if (inst_cream->dp_operation)
594 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 594 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
595 else 595 else
596 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 596 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
597 597
598 CHECK_VFP_CDP_RET; 598 CHECK_VFP_CDP_RET;
599 } 599 }
@@ -642,9 +642,9 @@ VNEG_INST:
642 int ret; 642 int ret;
643 643
644 if (inst_cream->dp_operation) 644 if (inst_cream->dp_operation)
645 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 645 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
646 else 646 else
647 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 647 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
648 648
649 CHECK_VFP_CDP_RET; 649 CHECK_VFP_CDP_RET;
650 } 650 }
@@ -692,9 +692,9 @@ VSQRT_INST:
692 int ret; 692 int ret;
693 693
694 if (inst_cream->dp_operation) 694 if (inst_cream->dp_operation)
695 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 695 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
696 else 696 else
697 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 697 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
698 698
699 CHECK_VFP_CDP_RET; 699 CHECK_VFP_CDP_RET;
700 } 700 }
@@ -742,9 +742,9 @@ VCMP_INST:
742 int ret; 742 int ret;
743 743
744 if (inst_cream->dp_operation) 744 if (inst_cream->dp_operation)
745 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 745 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
746 else 746 else
747 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 747 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
748 748
749 CHECK_VFP_CDP_RET; 749 CHECK_VFP_CDP_RET;
750 } 750 }
@@ -792,9 +792,9 @@ VCMP2_INST:
792 int ret; 792 int ret;
793 793
794 if (inst_cream->dp_operation) 794 if (inst_cream->dp_operation)
795 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 795 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
796 else 796 else
797 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 797 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
798 798
799 CHECK_VFP_CDP_RET; 799 CHECK_VFP_CDP_RET;
800 } 800 }
@@ -842,9 +842,9 @@ VCVTBDS_INST:
842 int ret; 842 int ret;
843 843
844 if (inst_cream->dp_operation) 844 if (inst_cream->dp_operation)
845 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 845 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
846 else 846 else
847 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 847 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
848 848
849 CHECK_VFP_CDP_RET; 849 CHECK_VFP_CDP_RET;
850 } 850 }
@@ -894,9 +894,9 @@ VCVTBFF_INST:
894 int ret; 894 int ret;
895 895
896 if (inst_cream->dp_operation) 896 if (inst_cream->dp_operation)
897 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 897 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
898 else 898 else
899 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 899 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
900 900
901 CHECK_VFP_CDP_RET; 901 CHECK_VFP_CDP_RET;
902 } 902 }
@@ -944,9 +944,9 @@ VCVTBFI_INST:
944 int ret; 944 int ret;
945 945
946 if (inst_cream->dp_operation) 946 if (inst_cream->dp_operation)
947 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 947 ret = vfp_double_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
948 else 948 else
949 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_OFFSET(VFP_FPSCR)]); 949 ret = vfp_single_cpdo(cpu, inst_cream->instr, cpu->VFP[VFP_FPSCR]);
950 950
951 CHECK_VFP_CDP_RET; 951 CHECK_VFP_CDP_RET;
952 } 952 }
@@ -1146,14 +1146,14 @@ VMRS_INST:
1146 { 1146 {
1147 if (inst_cream->Rt != 15) 1147 if (inst_cream->Rt != 15)
1148 { 1148 {
1149 cpu->Reg[inst_cream->Rt] = cpu->VFP[VFP_OFFSET(VFP_FPSCR)]; 1149 cpu->Reg[inst_cream->Rt] = cpu->VFP[VFP_FPSCR];
1150 } 1150 }
1151 else 1151 else
1152 { 1152 {
1153 cpu->NFlag = (cpu->VFP[VFP_OFFSET(VFP_FPSCR)] >> 31) & 1; 1153 cpu->NFlag = (cpu->VFP[VFP_FPSCR] >> 31) & 1;
1154 cpu->ZFlag = (cpu->VFP[VFP_OFFSET(VFP_FPSCR)] >> 30) & 1; 1154 cpu->ZFlag = (cpu->VFP[VFP_FPSCR] >> 30) & 1;
1155 cpu->CFlag = (cpu->VFP[VFP_OFFSET(VFP_FPSCR)] >> 29) & 1; 1155 cpu->CFlag = (cpu->VFP[VFP_FPSCR] >> 29) & 1;
1156 cpu->VFlag = (cpu->VFP[VFP_OFFSET(VFP_FPSCR)] >> 28) & 1; 1156 cpu->VFlag = (cpu->VFP[VFP_FPSCR] >> 28) & 1;
1157 } 1157 }
1158 } 1158 }
1159 else 1159 else
@@ -1161,7 +1161,7 @@ VMRS_INST:
1161 switch (inst_cream->reg) 1161 switch (inst_cream->reg)
1162 { 1162 {
1163 case 0: 1163 case 0:
1164 cpu->Reg[inst_cream->Rt] = cpu->VFP[VFP_OFFSET(VFP_FPSID)]; 1164 cpu->Reg[inst_cream->Rt] = cpu->VFP[VFP_FPSID];
1165 break; 1165 break;
1166 case 6: 1166 case 6:
1167 /* MVFR1, VFPv3 only ? */ 1167 /* MVFR1, VFPv3 only ? */
@@ -1172,7 +1172,7 @@ VMRS_INST:
1172 LOG_TRACE(Core_ARM11, "\tr%d <= MVFR0 unimplemented\n", inst_cream->Rt); 1172 LOG_TRACE(Core_ARM11, "\tr%d <= MVFR0 unimplemented\n", inst_cream->Rt);
1173 break; 1173 break;
1174 case 8: 1174 case 8:
1175 cpu->Reg[inst_cream->Rt] = cpu->VFP[VFP_OFFSET(VFP_FPEXC)]; 1175 cpu->Reg[inst_cream->Rt] = cpu->VFP[VFP_FPEXC];
1176 break; 1176 break;
1177 default: 1177 default:
1178 break; 1178 break;