diff options
author | Lioncash <mathew1800@gmail.com> | 2015-07-27 23:45:24 -0400 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2015-07-28 02:27:57 -0400 |
commit | 89540ea7618fbaca1c9cd332b24aff7f2865d324 (patch) | |
tree | d5e25da76e20be36e3016beb363b2c25071d9c36 /src/core/arm/dyncom/arm_dyncom_dec.cpp | |
parent | 7e4fb4db193433c77ffd707b62d11e58e46c684e (diff) |
dyncom: Use enum class for instruction decoding results
Diffstat (limited to 'src/core/arm/dyncom/arm_dyncom_dec.cpp')
-rw-r--r-- | src/core/arm/dyncom/arm_dyncom_dec.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_dec.cpp b/src/core/arm/dyncom/arm_dyncom_dec.cpp index 3ab9f2c1..48fc1c68 100644 --- a/src/core/arm/dyncom/arm_dyncom_dec.cpp +++ b/src/core/arm/dyncom/arm_dyncom_dec.cpp @@ -414,14 +414,13 @@ const ISEITEM arm_exclusion_code[] = { { "invalid", 0, INVALID, { 0 }} }; -int decode_arm_instr(u32 instr, s32* idx) { +ARMDecodeStatus DecodeARMInstruction(u32 instr, s32* idx) { int n = 0; int base = 0; - int ret = DECODE_FAILURE; - int i = 0; int instr_slots = sizeof(arm_instruction) / sizeof(ISEITEM); + ARMDecodeStatus ret = ARMDecodeStatus::FAILURE; - for (i = 0; i < instr_slots; i++) { + for (int i = 0; i < instr_slots; i++) { n = arm_instruction[i].attribute_value; base = 0; @@ -438,11 +437,11 @@ int decode_arm_instr(u32 instr, s32* idx) { n--; } - // All conditions is satisfied. + // All conditions are satisfied. if (n == 0) - ret = DECODE_SUCCESS; + ret = ARMDecodeStatus::SUCCESS; - if (ret == DECODE_SUCCESS) { + if (ret == ARMDecodeStatus::SUCCESS) { n = arm_exclusion_code[i].attribute_value; if (n != 0) { base = 0; @@ -454,13 +453,13 @@ int decode_arm_instr(u32 instr, s32* idx) { n--; } - // All conditions is satisfied. + // All conditions are satisfied. if (n == 0) - ret = DECODE_FAILURE; + ret = ARMDecodeStatus::FAILURE; } } - if (ret == DECODE_SUCCESS) { + if (ret == ARMDecodeStatus::SUCCESS) { *idx = i; return ret; } |