all repos — mgba @ f30a625b5191a20978bdb955e838111abf809fe6

mGBA Game Boy Advance Emulator

Reduce size of ARMInstructionInfo
Jeffrey Pfau jeffrey@endrift.com
Thu, 02 Oct 2014 04:38:50 -0700
commit

f30a625b5191a20978bdb955e838111abf809fe6

parent

c6954bcb4aee26ba951f4a2b5dfcfa1f30bdd2c8

1 files changed, 14 insertions(+), 14 deletions(-)

jump to
M src/arm/decoder.hsrc/arm/decoder.h

@@ -89,7 +89,7 @@

union ARMOperand { struct { uint8_t reg; - enum ARMShifterOperation shifterOp; + uint8_t shifterOp; union { uint8_t shifterReg; uint8_t shifterImm;

@@ -110,9 +110,9 @@ };

struct ARMMemoryAccess { uint8_t baseReg; + uint8_t width; uint16_t format; union ARMOperand offset; - enum ARMMemoryAccessType width; }; enum ARMMnemonic {

@@ -167,25 +167,25 @@ ARM_SPSR = 17

}; struct ARMInstructionInfo { - enum ExecutionMode execMode; uint32_t opcode; - enum ARMMnemonic mnemonic; union ARMOperand op1; union ARMOperand op2; union ARMOperand op3; union ARMOperand op4; struct ARMMemoryAccess memory; int operandFormat; - int branches; - int traps; - int affectsCPSR; - int condition; - int sDataCycles; - int nDataCycles; - int sInstructionCycles; - int nInstructionCycles; - int iCycles; - int cCycles; + unsigned execMode : 1; + bool branches : 1; + bool traps : 1; + bool affectsCPSR : 1; + unsigned condition : 4; + unsigned mnemonic : 6; + unsigned iCycles : 2; + unsigned cCycles : 4; + unsigned sDataCycles : 10; + unsigned nDataCycles : 10; + unsigned sInstructionCycles : 4; + unsigned nInstructionCycles : 4; }; void ARMDecodeARM(uint32_t opcode, struct ARMInstructionInfo* info);