📄 dynamicarmcode.h
字号:
WLDRD_POST = 0xFCF00100,
WSTRB_POST = 0xFCA00000,
WSTRH_POST = 0xFCE00000,
WSTRW_POST = 0xFCA00100,
WSTRD_POST = 0xFCE00100,
WLDRB_POSTSUB = 0xFC300000,
WLDRH_POSTSUB = 0xFC700000,
WLDRW_POSTSUB = 0xFC300100,
WLDRD_POSTSUB = 0xFC700100,
WSTRB_POSTSUB = 0xFC200000,
WSTRH_POSTSUB = 0xFC600000,
WSTRW_POSTSUB = 0xFC200100,
WSTRD_POSTSUB = 0xFC600100,
WMACU = 0x7E400100,
WMACS = 0x7E600100,
WMACUZ = 0x7E500100,
WMACSZ = 0x7E700100,
WMADDU = 0x7E800100,
WMADDS = 0x7EA00100,
WMAXUB = 0x7E000160,
WMAXUH = 0x7E400160,
WMAXUW = 0x7E800160,
WMAXSB = 0x7E200160,
WMAXSH = 0x7E600160,
WMAXSW = 0x7EA00160,
WMINUB = 0x7E100160,
WMINUH = 0x7E500160,
WMINUW = 0x7E900160,
WMINSB = 0x7E300160,
WMINSH = 0x7E700160,
WMINSW = 0x7EB00160,
WMULUL = 0x7E000100,
WMULUM = 0x7E100100,
WMULSL = 0x7E200100,
WMULSM = 0x7E300100,
WOR = 0x7E000000,
WPACKHUS = 0x7E500080,
WPACKWUS = 0x7E900080,
WPACKDUS = 0x7ED00080,
WPACKHSS = 0x7E700080,
WPACKWSS = 0x7EB00080,
WPACKDSS = 0x7EF00080,
WRORH = 0x7E700040,
WRORW = 0x7EB00040,
WRORD = 0x7EF00040,
WRORHG = 0x7E700140,
WRORWG = 0x7EB00140,
WRORDG = 0x7EF00140,
WSADB = 0x7E000120,
WSADBZ = 0x7E100120,
WSADH = 0x7E400120,
WSADHZ = 0x7E500120,
WSHUFH = 0x9E0001E0,
WSLLH = 0x7E500040,
WSLLW = 0x7E900040,
WSLLD = 0x7ED00040,
WSLLHG = 0x7E500140,
WSLLWG = 0x7E900140,
WSLLDG = 0x7ED00140,
WSRAH = 0x7E400040,
WSRAW = 0x7E800040,
WSRAD = 0x7EC00040,
WSRAHG = 0x7E400140,
WSRAWG = 0x7E800140,
WSRADG = 0x7EC00140,
WSRLH = 0x7E600040,
WSRLW = 0x7EA00040,
WSRLD = 0x7EE00040,
WSRLHG = 0x7E600140,
WSRLWG = 0x7EA00140,
WSRLDG = 0x7EE00140,
WSUBB = 0x7E0001A0,
WSUBH = 0x7E4001A0,
WSUBW = 0x7E8001A0,
WSUBBUS = 0x7E1001A0,
WSUBHUS = 0x7E5001A0,
WSUBWUS = 0x7E9001A0,
WSUBBSS = 0x7E3001A0,
WSUBHSS = 0x7E7001A0,
WSUBWSS = 0x7EB001A0,
WUNPCKEHUB = 0x6E0000C0,
WUNPCKEHUH = 0x6E4000C0,
WUNPCKEHUW = 0x6E8000C0,
WUNPCKEHSB = 0x6E2000C0,
WUNPCKEHSH = 0x6E6000C0,
WUNPCKEHSW = 0x6EA000C0,
WUNPCKIHB = 0x7E1000C0,
WUNPCKIHH = 0x7E5000C0,
WUNPCKIHW = 0x7E9000C0,
WUNPCKELUB = 0x6E0000E0,
WUNPCKELUH = 0x6E4000E0,
WUNPCKELUW = 0x6E8000E0,
WUNPCKELSB = 0x6E2000E0,
WUNPCKELSH = 0x6E6000E0,
WUNPCKELSW = 0x6EA000E0,
WUNPCKILB = 0x7E1000E0,
WUNPCKILH = 0x7E5000E0,
WUNPCKILW = 0x7E9000E0,
WXOR = 0x7E100000,
};
//----------------------------
virtual ~C_dyn_code(){}
//----------------------------
// Beginning of function - save all regs.
virtual void FunctionBegin(dword local_vars_size = 0) = 0;
//----------------------------
// End of function - restore regs and return to caller.
virtual void FunctionEnd() = 0;
//----------------------------
// Align code to specified byt boundary.
virtual void Align(dword bytes) = 0;
//----------------------------
// Insert instructions.
virtual void I3C(int code, byte Dest, byte op_1, byte Op2, int constant) = 0;
virtual void I3(int code, byte Dest, byte op_1, byte Op2) = 0;
virtual void I3S(int code, byte Dest, byte op_1, byte Op2, E_SHIFT_TYPE ShiftType, int Shift) = 0;
virtual void I4(int code, byte Dest, byte op_1, byte Op2, byte Op3) = 0;
virtual void IConst(byte Dest, int constant) = 0;
virtual void I2(int code, byte Dest, byte op_1) = 0;
virtual void I2C(int code, byte Dest, byte op_1, int constant) = 0;
virtual void I1P(int code, byte Dest, void *label, int Ofs) = 0;
virtual void I0P(int code, int Cond, void *label) = 0;
//----------------------------
// ARM instructions:
inline void Mov(E_REGISTER dst, E_REGISTER src, E_SHIFT_TYPE shift_type = LSL, int shift_count = 0){ I3S(MOV, dst, NONE, src, shift_type, shift_count); }
inline void Mov(E_REGISTER dst, dword v){ I2C(MOV, dst, NONE, v); }
inline void Mvn(E_REGISTER dst, E_REGISTER src, E_SHIFT_TYPE shift_type = LSL, int shift_count = 0){ I3S(MVN, dst, NONE, src, shift_type, shift_count); }
inline void Mvn(E_REGISTER dst, dword v){ I2C(MVN, dst, NONE, v); }
inline void MovLabel(E_REGISTER dst, void *label){ I1P(MOV, dst, label, 0); }
inline void Add(E_REGISTER dst, E_REGISTER src1, E_REGISTER src2, E_SHIFT_TYPE shift_type = LSL, int shift_count = 0){ I3S(ADD, dst, src1, src2, shift_type, shift_count); }
inline void Add(E_REGISTER dst, E_REGISTER src, dword v){ I2C(ADD, dst, src, v); }
inline void And(E_REGISTER dst, E_REGISTER src1, E_REGISTER src2, E_SHIFT_TYPE shift_type = LSL, int shift_count = 0){ I3S(AND, dst, src1, src2, shift_type, shift_count); }
inline void And(E_REGISTER dst, E_REGISTER src, dword v){ I2C(AND, dst, src, v); }
inline void Orr(E_REGISTER dst, E_REGISTER src1, E_REGISTER src2, E_SHIFT_TYPE shift_type = LSL, int shift_count = 0){ I3S(ORR, dst, src1, src2, shift_type, shift_count); }
inline void Orr(E_REGISTER dst, E_REGISTER src, dword v){ I2C(ORR, dst, src, v); }
inline void Eor(E_REGISTER dst, E_REGISTER src1, E_REGISTER src2, E_SHIFT_TYPE shift_type = LSL, int shift_count = 0){ I3S(EOR, dst, src1, src2, shift_type, shift_count); }
inline void Eor(E_REGISTER dst, E_REGISTER src, dword v){ I2C(EOR, dst, src, v); }
inline void Bic(E_REGISTER dst, E_REGISTER src1, E_REGISTER src2, E_SHIFT_TYPE shift_type = LSL, int shift_count = 0){ I3S(BIC, dst, src1, src2, shift_type, shift_count); }
inline void Bic(E_REGISTER dst, E_REGISTER src, dword v){ I2C(BIC, dst, src, v); }
inline void Sub(E_REGISTER dst, E_REGISTER src1, E_REGISTER src2, E_SHIFT_TYPE shift_type = LSL, int shift_count = 0){ I3S(SUB, dst, src1, src2, shift_type, shift_count); }
inline void Sub(E_REGISTER dst, E_REGISTER src, dword v){ I2C(SUB, dst, src, v); }
inline void Rsb(E_REGISTER dst, E_REGISTER src1, E_REGISTER src2, E_SHIFT_TYPE shift_type = LSL, int shift_count = 0){ I3S(RSB, dst, src1, src2, shift_type, shift_count); }
inline void Rsb(E_REGISTER dst, E_REGISTER src, dword v){ I2C(RSB, dst, src, v); }
inline void Ldr(E_REGISTER dst, E_REGISTER src_ptr, int offs){ I2C(LDR, dst, src_ptr, offs); }
inline void Ldr(E_REGISTER dst, E_REGISTER src_ptr, E_REGISTER offs, E_SHIFT_TYPE shift_type = LSL, int shift_count = 0){ I3S(LDR, dst, src_ptr, offs, shift_type, shift_count); }
inline void LdrAdvance(E_REGISTER dst, E_REGISTER src_ptr, E_REGISTER offs, E_SHIFT_TYPE shift_type = LSL, int shift_count = 0){ I3S(LDR_POST, dst, src_ptr, offs, shift_type, shift_count); }
inline void LdrAdvance(E_REGISTER dst, E_REGISTER src_ptr, int offs){ I2C(LDR_POST, dst, src_ptr, offs); }
inline void Ldr(E_REGISTER dst, void *label, int offs = 0){ I1P(LDR, dst, label, offs); }
inline void Str(E_REGISTER src, E_REGISTER dst_ptr, int offs){ I2C(STR, src, dst_ptr, offs); }
inline void Str(E_REGISTER src, E_REGISTER dst_ptr, E_REGISTER offs, E_SHIFT_TYPE shift_type = LSL, int shift_count = 0){ I3S(STR, src, dst_ptr, offs, shift_type, shift_count); }
inline void Cmp(E_REGISTER r1, E_REGISTER r2){ I3(CMP, NONE, r1, r2); }
inline void Cmp(E_REGISTER r1, dword v){ I2C(CMP, NONE, r1, v); }
inline void Tst(E_REGISTER r1, E_REGISTER r2){ I3(TST, NONE, r1, r2); }
inline void Tst(E_REGISTER r1, dword v){ I2C(TST, NONE, r1, v); }
inline void Mul(E_REGISTER dst, E_REGISTER src1, E_REGISTER src2, E_SHIFT_TYPE shift_type = LSL, int shift_count = 0){ I3S(MUL, dst, src1, src2, shift_type, shift_count); }
virtual void MulC(E_REGISTER dst, E_REGISTER src, int constant) = 0;
inline void Mla(E_REGISTER dst, E_REGISTER mul1, E_REGISTER mul2, E_REGISTER add){ I4(MLA, dst, mul1, mul2, add); }
inline void StrAdvance(E_REGISTER src, E_REGISTER dst_ptr, E_REGISTER offs, E_SHIFT_TYPE shift_type = LSL, int shift_count = 0){ I3S(STR_POST, src, dst_ptr, offs, shift_type, shift_count); }
inline void StrAdvance(E_REGISTER src, E_REGISTER dst_ptr, int offs){ I2C(STR_POST, src, dst_ptr, offs); }
inline void Pld(E_REGISTER dst, int offs){ I2C(PLD, NONE, dst, offs); }
inline void Pld(E_REGISTER dst, E_REGISTER offs, E_SHIFT_TYPE shift_type = LSL, int shift_count = 0){ I3S(PLD, NONE, dst, offs, shift_type, shift_count); }
inline void Branch(E_CONDITION cond, void *label){ I0P(B, cond, label); }
inline void Branch(void *label){ I0P(B, AL, label); }
inline void BranchLink(void *label){ I0P(BL, AL, label); }
/*
ADC, SBC, RSC, TEQ, CMN,
QADD, QSUB, QDADD, QDSUB,
LDR_PRE, STR_PRE,
LDR_POSTSUB, STR_POSTSUB, LDR_PRESUB, STR_PRESUB,
*/
//----------------------------
// Transfer the contents of the src ARM registers to a 32-bit dst WMMX control register.
inline void Tmcr(E_WMMX_GENERAL_REGISTER dst, E_REGISTER src){ I2(TMCR, dst, src); }
inline void Tmcrr(E_WMMX_GENERAL_REGISTER dst, E_REGISTER src1, E_REGISTER src2){ I3(TMCRR, dst, src1, src2); }
//----------------------------
// Transfer the contents of the 32-bit WMMX control register to the dst ARM register.
inline void Tmrc(E_REGISTER dst, E_WMMX_GENERAL_REGISTER src){ I2(TMRC, dst, src); }
inline void Tmrrc(E_REGISTER dst1, E_REGISTER dst2, E_WMMX_GENERAL_REGISTER src){ I3(TMRRC, dst1, dst2, src); }
//----------------------------
// Transfer and insert 8-/16-/32-bit data from ARM* src register to the position in WMMX dst register, specified by the 3-bit Immediate.
inline void Tinsrb(E_WMMX_REGISTER dst, E_REGISTER src, byte c){ I2C(TINSRB, dst, src, c); }
inline void Tinsrh(E_WMMX_REGISTER dst, E_REGISTER src, byte c){ I2C(TINSRH, dst, src, c); }
inline void Tinsrw(E_WMMX_REGISTER dst, E_REGISTER src, byte c){ I2C(TINSRW, dst, src, c); }
//----------------------------
// Broadcast a value from the ARM* src to every SIMD position in the WMMX dst register, can operate on 8-, 16-, and 32-bit data values.
inline void Tbcstb(E_WMMX_REGISTER dst, E_REGISTER src){ I2(TBCSTB, dst, src); }
inline void Tbcsth(E_WMMX_REGISTER dst, E_REGISTER src){ I2(TBCSTH, dst, src); }
inline void Tbcstw(E_WMMX_REGISTER dst, E_REGISTER src){ I2(TBCSTW, dst, src); }
//----------------------------
inline void Wldrb(E_WMMX_REGISTER dst, E_REGISTER src, int offs){ I2C(WLDRB, dst, src, offs); }
inline void Wldrh(E_WMMX_REGISTER dst, E_REGISTER src, int offs){ I2C(WLDRH, dst, src, offs); }
inline void Wldrw(E_WMMX_REGISTER dst, E_REGISTER src, int offs){ I2C(WLDRW, dst, src, offs); }
inline void Wldrd(E_WMMX_REGISTER dst, E_REGISTER src, int offs){ I2C(WLDRD, dst, src, offs); }
inline void Wldrd(E_WMMX_REGISTER dst, void *label, int offs){ I1P(WLDRD, dst, label, offs); }
inline void Wstrb(E_WMMX_REGISTER src, E_REGISTER dst, int offs){ I2C(WSTRB, src, dst, offs); }
inline void Wstrh(E_WMMX_REGISTER src, E_REGISTER dst, int offs){ I2C(WSTRH, src, dst, offs); }
inline void Wstrw(E_WMMX_REGISTER src, E_REGISTER dst, int offs){ I2C(WSTRW, src, dst, offs); }
inline void Wstrd(E_WMMX_REGISTER src, E_REGISTER dst, int offs){ I2C(WSTRD, src, dst, offs); }
inline void Wstrd(E_WMMX_REGISTER src, void *label, int offs){ I1P(WSTRD, src, label, offs); }
inline void WldrbAdvance(E_WMMX_REGISTER src, E_REGISTER dst, int offs){ I2C(WLDRB_POST, src, dst, offs); }
inline void WldrhAdvance(E_WMMX_REGISTER src, E_REGISTER dst, int offs){ I2C(WLDRH_POST, src, dst, offs); }
inline void WldrwAdvance(E_WMMX_REGISTER src, E_REGISTER dst, int offs){ I2C(WLDRW_POST, src, dst, offs); }
inline void WldrdAdvance(E_WMMX_REGISTER src, E_REGISTER dst, int offs){ I2C(WLDRD_POST, src, dst, offs); }
inline void WstrbAdvance(E_WMMX_REGISTER src, E_REGISTER dst, int offs){ I2C(WSTRB_POST, src, dst, offs); }
inline void WstrhAdvance(E_WMMX_REGISTER src, E_REGISTER dst, int offs){ I2C(WSTRH_POST, src, dst, offs); }
inline void WstrwAdvance(E_WMMX_REGISTER src, E_REGISTER dst, int offs){ I2C(WSTRW_POST, src, dst, offs); }
inline void WstrdAdvance(E_WMMX_REGISTER src, E_REGISTER dst, int offs){ I2C(WSTRD_POST, src, dst, offs); }
inline void WldrbPreAdvance(E_WMMX_REGISTER dst, E_REGISTER src, int offs){ I2C(WLDRB_PRE, dst, src, offs); }
inline void WldrhPreAdvance(E_WMMX_REGISTER dst, E_REGISTER src, int offs){ I2C(WLDRH_PRE, dst, src, offs); }
inline void WldrwPreAdvance(E_WMMX_REGISTER dst, E_REGISTER src, int offs){ I2C(WLDRW_PRE, dst, src, offs); }
inline void WldrdPreAdvance(E_WMMX_REGISTER dst, E_REGISTER src, int offs){ I2C(WLDRD_PRE, dst, src, offs); }
inline void WstrbPreAdvance(E_WMMX_REGISTER src, E_REGISTER dst, int offs){ I2C(WSTRB_PRE, src, dst, offs); }
inline void WstrhPreAdvance(E_WMMX_REGISTER src, E_REGISTER dst, int offs){ I2C(WSTRH_PRE, src, dst, offs); }
inline void WstrwPreAdvance(E_WMMX_REGISTER src, E_REGISTER dst, int offs){ I2C(WSTRW_PRE, src, dst, offs); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -