diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-05-27 07:05:13 +0200 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-05-27 07:05:13 +0200 |
commit | ad883db7a92dd48761982923c5ec594d268a2aff (patch) | |
tree | 453c17964c53eab0e44cac1aae67c949f23c47ca /src/core | |
parent | Merge pull request #825 from lioncash/dync (diff) | |
parent | arm_dyncom_thumb: Merge STR/LDR table subsets. (diff) | |
download | yuzu-ad883db7a92dd48761982923c5ec594d268a2aff.tar yuzu-ad883db7a92dd48761982923c5ec594d268a2aff.tar.gz yuzu-ad883db7a92dd48761982923c5ec594d268a2aff.tar.bz2 yuzu-ad883db7a92dd48761982923c5ec594d268a2aff.tar.lz yuzu-ad883db7a92dd48761982923c5ec594d268a2aff.tar.xz yuzu-ad883db7a92dd48761982923c5ec594d268a2aff.tar.zst yuzu-ad883db7a92dd48761982923c5ec594d268a2aff.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/arm/dyncom/arm_dyncom_thumb.cpp | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_thumb.cpp b/src/core/arm/dyncom/arm_dyncom_thumb.cpp index 08b5c0b77..cdaf21450 100644 --- a/src/core/arm/dyncom/arm_dyncom_thumb.cpp +++ b/src/core/arm/dyncom/arm_dyncom_thumb.cpp @@ -189,33 +189,22 @@ tdstate thumb_translate(u32 addr, u32 instr, u32* ainstr, u32* inst_size) { case 10: case 11: - // TODO: Format 7 and Format 8 perform the same ARM encoding, so the following could be - // merged into a single subset, saving on the following boolean: - - if ((tinstr & (1 << 9)) == 0) { - static const ARMword subset[4] = { - 0xE7800000, // STR Rd,[Rb,Ro] - 0xE7C00000, // STRB Rd,[Rb,Ro] - 0xE7900000, // LDR Rd,[Rb,Ro] - 0xE7D00000 // LDRB Rd,[Rb,Ro] - }; - - *ainstr = subset[(tinstr & 0x0C00) >> 10] // base - |((tinstr & 0x0007) << (12 - 0)) // Rd - |((tinstr & 0x0038) << (16 - 3)) // Rb - |((tinstr & 0x01C0) >> 6); // Ro - - } else { - static const ARMword subset[4] = { + { + static const ARMword subset[8] = { + 0xE7800000, // STR Rd,[Rb,Ro] 0xE18000B0, // STRH Rd,[Rb,Ro] + 0xE7C00000, // STRB Rd,[Rb,Ro] 0xE19000D0, // LDRSB Rd,[Rb,Ro] + 0xE7900000, // LDR Rd,[Rb,Ro] 0xE19000B0, // LDRH Rd,[Rb,Ro] + 0xE7D00000, // LDRB Rd,[Rb,Ro] 0xE19000F0 // LDRSH Rd,[Rb,Ro] }; - *ainstr = subset[(tinstr & 0x0C00) >> 10] // base - |((tinstr & 0x0007) << (12 - 0)) // Rd - |((tinstr & 0x0038) << (16 - 3)) // Rb - |((tinstr & 0x01C0) >> 6); // Ro + + *ainstr = subset[(tinstr & 0xE00) >> 9] // base + |((tinstr & 0x0007) << (12 - 0)) // Rd + |((tinstr & 0x0038) << (16 - 3)) // Rb + |((tinstr & 0x01C0) >> 6); // Ro } break; |