ARMv7 interpreter refactoring

This commit is contained in:
Nekotekina 2015-01-23 20:25:36 +03:00
parent f2e2786959
commit 47e2e0bd58
2 changed files with 648 additions and 603 deletions

File diff suppressed because it is too large Load diff

View file

@ -28,71 +28,6 @@ enum SRType : u32
namespace ARMv7_instrs
{
template<typename T>
static bool IsZero(T x)
{
return x == T(0);
}
template<typename T>
static bool IsOnes(T x)
{
return x == ~T(0);
}
template<typename T>
static u8 IsZeroBit(T x)
{
return IsZero(x) ? 1 : 0;
}
template<typename T>
static bool IsOnesBit(T x, u8 len = sizeof(T) * 8)
{
return IsOnes(x) ? 1 : 0;
}
template<typename T>
u8 BitCount(T x, u8 len = sizeof(T) * 8);
template<typename T>
s8 LowestSetBit(T x, u8 len = sizeof(T) * 8);
template<typename T>
s8 HighestSetBit(T x, u8 len = sizeof(T) * 8);
template<typename T>
s8 CountLeadingZeroBits(T x, u8 len = sizeof(T) * 8);
SRType DecodeImmShift(u32 type, u32 imm5, u32* shift_n);
SRType DecodeRegShift(u8 type);
u32 LSL_C(u32 x, s32 shift, bool& carry_out);
u32 LSL_(u32 x, s32 shift);
u32 LSR_C(u32 x, s32 shift, bool& carry_out);
u32 LSR_(u32 x, s32 shift);
s32 ASR_C(s32 x, s32 shift, bool& carry_out);
s32 ASR_(s32 x, s32 shift);
u32 ROR_C(u32 x, s32 shift, bool& carry_out);
u32 ROR_(u32 x, s32 shift);
u32 RRX_C(u32 x, bool carry_in, bool& carry_out);
u32 RRX_(u32 x, bool carry_in);
template<typename T> T Shift_C(T value, SRType type, s32 amount, bool carry_in, bool& carry_out);
template<typename T> T Shift(T value, SRType type, s32 amount, bool carry_in);
template<typename T> T AddWithCarry(T x, T y, bool carry_in, bool& carry_out, bool& overflow);
u32 ThumbExpandImm_C(u32 imm12, bool carry_in, bool& carry_out);
u32 ThumbExpandImm(ARMv7Context& context, u32 imm12);
bool ConditionPassed(ARMv7Context& context, u32 cond);
// instructions
void UNK(ARMv7Context& context, const ARMv7Code code);
void NULL_OP(ARMv7Context& context, const ARMv7Code code, const ARMv7_encoding type);