diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/arm/dyncom/arm_dyncom_dec.cpp | 4 | ||||
| -rw-r--r-- | src/core/arm/dyncom/arm_dyncom_dec.h | 37 |
2 files changed, 2 insertions, 39 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_dec.cpp b/src/core/arm/dyncom/arm_dyncom_dec.cpp index 9f3b90fd0..12181d0ec 100644 --- a/src/core/arm/dyncom/arm_dyncom_dec.cpp +++ b/src/core/arm/dyncom/arm_dyncom_dec.cpp | |||
| @@ -413,7 +413,7 @@ int decode_arm_instr(uint32_t instr, int32_t *idx) { | |||
| 413 | if (instr != arm_instruction[i].content[base + 2]) { | 413 | if (instr != arm_instruction[i].content[base + 2]) { |
| 414 | break; | 414 | break; |
| 415 | } | 415 | } |
| 416 | } else if (BITS(arm_instruction[i].content[base], arm_instruction[i].content[base + 1]) != arm_instruction[i].content[base + 2]) { | 416 | } else if (BITS(instr, arm_instruction[i].content[base], arm_instruction[i].content[base + 1]) != arm_instruction[i].content[base + 2]) { |
| 417 | break; | 417 | break; |
| 418 | } | 418 | } |
| 419 | base += 3; | 419 | base += 3; |
| @@ -429,7 +429,7 @@ int decode_arm_instr(uint32_t instr, int32_t *idx) { | |||
| 429 | if (n != 0) { | 429 | if (n != 0) { |
| 430 | base = 0; | 430 | base = 0; |
| 431 | while (n) { | 431 | while (n) { |
| 432 | if (BITS(arm_exclusion_code[i].content[base], arm_exclusion_code[i].content[base + 1]) != arm_exclusion_code[i].content[base + 2]) { | 432 | if (BITS(instr, arm_exclusion_code[i].content[base], arm_exclusion_code[i].content[base + 1]) != arm_exclusion_code[i].content[base + 2]) { |
| 433 | break; | 433 | break; |
| 434 | } | 434 | } |
| 435 | base += 3; | 435 | base += 3; |
diff --git a/src/core/arm/dyncom/arm_dyncom_dec.h b/src/core/arm/dyncom/arm_dyncom_dec.h index ee8ff5992..4b5f5ad7e 100644 --- a/src/core/arm/dyncom/arm_dyncom_dec.h +++ b/src/core/arm/dyncom/arm_dyncom_dec.h | |||
| @@ -4,43 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #define BITS(a,b) ((instr >> (a)) & ((1 << (1+(b)-(a)))-1)) | ||
| 8 | #define BIT(n) ((instr >> (n)) & 1) | ||
| 9 | |||
| 10 | // For MUL instructions | ||
| 11 | #define RDHi ((instr >> 16) & 0xF) | ||
| 12 | #define RDLo ((instr >> 12) & 0xF) | ||
| 13 | #define MUL_RD ((instr >> 16) & 0xF) | ||
| 14 | #define MUL_RN ((instr >> 12) & 0xF) | ||
| 15 | #define RS ((instr >> 8) & 0xF) | ||
| 16 | #define RD ((instr >> 12) & 0xF) | ||
| 17 | #define RN ((instr >> 16) & 0xF) | ||
| 18 | #define RM (instr & 0xF) | ||
| 19 | |||
| 20 | // CP15 registers | ||
| 21 | #define OPCODE_1 BITS(21, 23) | ||
| 22 | #define CRn BITS(16, 19) | ||
| 23 | #define CRm BITS(0, 3) | ||
| 24 | #define OPCODE_2 BITS(5, 7) | ||
| 25 | |||
| 26 | #define I BIT(25) | ||
| 27 | #define S BIT(20) | ||
| 28 | |||
| 29 | #define SHIFT BITS(5,6) | ||
| 30 | #define SHIFT_IMM BITS(7,11) | ||
| 31 | #define IMMH BITS(8,11) | ||
| 32 | #define IMML BITS(0,3) | ||
| 33 | |||
| 34 | #define LSPBIT BIT(24) | ||
| 35 | #define LSUBIT BIT(23) | ||
| 36 | #define LSBBIT BIT(22) | ||
| 37 | #define LSWBIT BIT(21) | ||
| 38 | #define LSLBIT BIT(20) | ||
| 39 | #define LSSHBITS BITS(5,6) | ||
| 40 | #define OFFSET12 BITS(0,11) | ||
| 41 | #define SBIT BIT(20) | ||
| 42 | #define DESTReg (BITS (12, 15)) | ||
| 43 | |||
| 44 | int decode_arm_instr(uint32_t instr, int32_t *idx); | 7 | int decode_arm_instr(uint32_t instr, int32_t *idx); |
| 45 | 8 | ||
| 46 | enum DECODE_STATUS { | 9 | enum DECODE_STATUS { |