summaryrefslogtreecommitdiff
path: root/src/core/arm/dyncom
diff options
context:
space:
mode:
authorGravatar Lioncash2015-07-25 20:52:10 -0400
committerGravatar Lioncash2015-07-25 20:52:10 -0400
commit4bb1a5ca47c4135e867cd611c0e097f570bc721d (patch)
tree7928d289f223941e64bb2a0e918401611a3998a5 /src/core/arm/dyncom
parentdyncom: Move helper functions to their own header (diff)
downloadyuzu-4bb1a5ca47c4135e867cd611c0e097f570bc721d.tar.gz
yuzu-4bb1a5ca47c4135e867cd611c0e097f570bc721d.tar.xz
yuzu-4bb1a5ca47c4135e867cd611c0e097f570bc721d.zip
dyncom: Get rid of skyeye typedefs
Diffstat (limited to 'src/core/arm/dyncom')
-rw-r--r--src/core/arm/dyncom/arm_dyncom_interpreter.cpp9
-rw-r--r--src/core/arm/dyncom/arm_dyncom_thumb.cpp22
2 files changed, 15 insertions, 16 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
index d9db0daa0..a81bb8e91 100644
--- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
+++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
@@ -51,22 +51,21 @@ typedef unsigned int (*shtop_fp_t)(ARMul_State* cpu, unsigned int sht_oper);
51// Defines a reservation granule of 2 words, which protects the first 2 words starting at the tag. 51// Defines a reservation granule of 2 words, which protects the first 2 words starting at the tag.
52// This is the smallest granule allowed by the v7 spec, and is coincidentally just large enough to 52// This is the smallest granule allowed by the v7 spec, and is coincidentally just large enough to
53// support LDR/STREXD. 53// support LDR/STREXD.
54static const ARMword RESERVATION_GRANULE_MASK = 0xFFFFFFF8; 54static const u32 RESERVATION_GRANULE_MASK = 0xFFFFFFF8;
55 55
56// Exclusive memory access 56// Exclusive memory access
57static int exclusive_detect(ARMul_State* state, ARMword addr) { 57static int exclusive_detect(ARMul_State* state, u32 addr) {
58 if(state->exclusive_tag == (addr & RESERVATION_GRANULE_MASK)) 58 if(state->exclusive_tag == (addr & RESERVATION_GRANULE_MASK))
59 return 0; 59 return 0;
60 else 60 else
61 return -1; 61 return -1;
62} 62}
63 63
64static void add_exclusive_addr(ARMul_State* state, ARMword addr){ 64static void add_exclusive_addr(ARMul_State* state, u32 addr){
65 state->exclusive_tag = addr & RESERVATION_GRANULE_MASK; 65 state->exclusive_tag = addr & RESERVATION_GRANULE_MASK;
66 return;
67} 66}
68 67
69static void remove_exclusive(ARMul_State* state, ARMword addr){ 68static void remove_exclusive(ARMul_State* state, u32 addr){
70 state->exclusive_tag = 0xFFFFFFFF; 69 state->exclusive_tag = 0xFFFFFFFF;
71} 70}
72 71
diff --git a/src/core/arm/dyncom/arm_dyncom_thumb.cpp b/src/core/arm/dyncom/arm_dyncom_thumb.cpp
index 13cc34be4..2860af376 100644
--- a/src/core/arm/dyncom/arm_dyncom_thumb.cpp
+++ b/src/core/arm/dyncom/arm_dyncom_thumb.cpp
@@ -14,7 +14,7 @@
14 14
15tdstate thumb_translate(u32 addr, u32 instr, u32* ainstr, u32* inst_size) { 15tdstate thumb_translate(u32 addr, u32 instr, u32* ainstr, u32* inst_size) {
16 tdstate valid = t_uninitialized; 16 tdstate valid = t_uninitialized;
17 ARMword tinstr = instr; 17 u32 tinstr = instr;
18 18
19 // The endian should be judge here 19 // The endian should be judge here
20 if((addr & 0x3) != 0) 20 if((addr & 0x3) != 0)
@@ -37,7 +37,7 @@ tdstate thumb_translate(u32 addr, u32 instr, u32* ainstr, u32* inst_size) {
37 37
38 case 3: // ADD/SUB 38 case 3: // ADD/SUB
39 { 39 {
40 static const ARMword subset[4] = { 40 static const u32 subset[4] = {
41 0xE0900000, // ADDS Rd,Rs,Rn 41 0xE0900000, // ADDS Rd,Rs,Rn
42 0xE0500000, // SUBS Rd,Rs,Rn 42 0xE0500000, // SUBS Rd,Rs,Rn
43 0xE2900000, // ADDS Rd,Rs,#imm3 43 0xE2900000, // ADDS Rd,Rs,#imm3
@@ -56,7 +56,7 @@ tdstate thumb_translate(u32 addr, u32 instr, u32* ainstr, u32* inst_size) {
56 case 6: // ADD 56 case 6: // ADD
57 case 7: // SUB 57 case 7: // SUB
58 { 58 {
59 static const ARMword subset[4] = { 59 static const u32 subset[4] = {
60 0xE3B00000, // MOVS Rd,#imm8 60 0xE3B00000, // MOVS Rd,#imm8
61 0xE3500000, // CMP Rd,#imm8 61 0xE3500000, // CMP Rd,#imm8
62 0xE2900000, // ADDS Rd,Rd,#imm8 62 0xE2900000, // ADDS Rd,Rd,#imm8
@@ -85,7 +85,7 @@ tdstate thumb_translate(u32 addr, u32 instr, u32* ainstr, u32* inst_size) {
85 }; 85 };
86 86
87 static const struct { 87 static const struct {
88 ARMword opcode; 88 u32 opcode;
89 otype type; 89 otype type;
90 } subset[16] = { 90 } subset[16] = {
91 { 0xE0100000, t_norm }, // ANDS Rd,Rd,Rs 91 { 0xE0100000, t_norm }, // ANDS Rd,Rd,Rs
@@ -130,8 +130,8 @@ tdstate thumb_translate(u32 addr, u32 instr, u32* ainstr, u32* inst_size) {
130 break; 130 break;
131 } 131 }
132 } else { 132 } else {
133 ARMword Rd = ((tinstr & 0x0007) >> 0); 133 u32 Rd = ((tinstr & 0x0007) >> 0);
134 ARMword Rs = ((tinstr & 0x0078) >> 3); 134 u32 Rs = ((tinstr & 0x0078) >> 3);
135 135
136 if (tinstr & (1 << 7)) 136 if (tinstr & (1 << 7))
137 Rd += 8; 137 Rd += 8;
@@ -185,7 +185,7 @@ tdstate thumb_translate(u32 addr, u32 instr, u32* ainstr, u32* inst_size) {
185 case 10: 185 case 10:
186 case 11: 186 case 11:
187 { 187 {
188 static const ARMword subset[8] = { 188 static const u32 subset[8] = {
189 0xE7800000, // STR Rd,[Rb,Ro] 189 0xE7800000, // STR Rd,[Rb,Ro]
190 0xE18000B0, // STRH Rd,[Rb,Ro] 190 0xE18000B0, // STRH Rd,[Rb,Ro]
191 0xE7C00000, // STRB Rd,[Rb,Ro] 191 0xE7C00000, // STRB Rd,[Rb,Ro]
@@ -208,7 +208,7 @@ tdstate thumb_translate(u32 addr, u32 instr, u32* ainstr, u32* inst_size) {
208 case 14: // STRB Rd,[Rb,#imm5] 208 case 14: // STRB Rd,[Rb,#imm5]
209 case 15: // LDRB Rd,[Rb,#imm5] 209 case 15: // LDRB Rd,[Rb,#imm5]
210 { 210 {
211 static const ARMword subset[4] = { 211 static const u32 subset[4] = {
212 0xE5800000, // STR Rd,[Rb,#imm5] 212 0xE5800000, // STR Rd,[Rb,#imm5]
213 0xE5900000, // LDR Rd,[Rb,#imm5] 213 0xE5900000, // LDR Rd,[Rb,#imm5]
214 0xE5C00000, // STRB Rd,[Rb,#imm5] 214 0xE5C00000, // STRB Rd,[Rb,#imm5]
@@ -275,7 +275,7 @@ tdstate thumb_translate(u32 addr, u32 instr, u32* ainstr, u32* inst_size) {
275 | BITS(tinstr, 0, 3) // imm4 field; 275 | BITS(tinstr, 0, 3) // imm4 field;
276 | (BITS(tinstr, 4, 7) << 8); // beginning 4 bits of imm12 276 | (BITS(tinstr, 4, 7) << 8); // beginning 4 bits of imm12
277 } else if ((tinstr & 0x0F00) == 0x0200) { 277 } else if ((tinstr & 0x0F00) == 0x0200) {
278 static const ARMword subset[4] = { 278 static const u32 subset[4] = {
279 0xE6BF0070, // SXTH 279 0xE6BF0070, // SXTH
280 0xE6AF0070, // SXTB 280 0xE6AF0070, // SXTB
281 0xE6FF0070, // UXTH 281 0xE6FF0070, // UXTH
@@ -299,7 +299,7 @@ tdstate thumb_translate(u32 addr, u32 instr, u32* ainstr, u32* inst_size) {
299 | (BIT(tinstr, 4) << 18); // enable bit 299 | (BIT(tinstr, 4) << 18); // enable bit
300 } 300 }
301 } else if ((tinstr & 0x0F00) == 0x0a00) { 301 } else if ((tinstr & 0x0F00) == 0x0a00) {
302 static const ARMword subset[3] = { 302 static const u32 subset[3] = {
303 0xE6BF0F30, // REV 303 0xE6BF0F30, // REV
304 0xE6BF0FB0, // REV16 304 0xE6BF0FB0, // REV16
305 0xE6FF0FB0, // REVSH 305 0xE6FF0FB0, // REVSH
@@ -309,7 +309,7 @@ tdstate thumb_translate(u32 addr, u32 instr, u32* ainstr, u32* inst_size) {
309 | (BITS(tinstr, 0, 2) << 12) // Rd 309 | (BITS(tinstr, 0, 2) << 12) // Rd
310 | BITS(tinstr, 3, 5); // Rm 310 | BITS(tinstr, 3, 5); // Rm
311 } else { 311 } else {
312 static const ARMword subset[4] = { 312 static const u32 subset[4] = {
313 0xE92D0000, // STMDB sp!,{rlist} 313 0xE92D0000, // STMDB sp!,{rlist}
314 0xE92D4000, // STMDB sp!,{rlist,lr} 314 0xE92D4000, // STMDB sp!,{rlist,lr}
315 0xE8BD0000, // LDMIA sp!,{rlist} 315 0xE8BD0000, // LDMIA sp!,{rlist}