mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-12-25 02:29:49 +00:00
Use symbolic constants for Jcc and SETcc instructions. Don't emit extraneous REX bits for JMP and CALL instructions.
This commit is contained in:
parent
3ea69bfc5c
commit
250366fd94
@ -1250,7 +1250,7 @@ enum {
|
||||
// FIXME: no prefix is availble to encode a 32-bit operand size in 64-bit mode
|
||||
#define CALLm(M) _O_D32 (0xe8 ,(int)(M) )
|
||||
#define _CALLLsr(R) (_REXLrr(0, R), _O_Mrm (0xff ,_b11,_b010,_r4(R) ))
|
||||
#define _CALLQsr(R) (_REXQrr(0, R), _O_Mrm (0xff ,_b11,_b010,_r8(R) ))
|
||||
#define _CALLQsr(R) (_REXLrr(0, R), _O_Mrm (0xff ,_b11,_b010,_r8(R) ))
|
||||
#define CALLsr(R) ( X86_TARGET_64BIT ? _CALLQsr(R) : _CALLLsr(R))
|
||||
#define CALLsm(D,B,I,S) (_REXLrm(0, B, I), _O_r_X (0xff ,_b010 ,(int)(D),B,I,S ))
|
||||
|
||||
@ -1258,135 +1258,135 @@ enum {
|
||||
#define JMPSm(M) _O_D8 (0xeb ,(int)(M) )
|
||||
#define JMPm(M) _O_D32 (0xe9 ,(int)(M) )
|
||||
#define _JMPLsr(R) (_REXLrr(0, R), _O_Mrm (0xff ,_b11,_b100,_r4(R) ))
|
||||
#define _JMPQsr(R) (_REXQrr(0, R), _O_Mrm (0xff ,_b11,_b100,_r8(R) ))
|
||||
#define _JMPQsr(R) (_REXLrr(0, R), _O_Mrm (0xff ,_b11,_b100,_r8(R) ))
|
||||
#define JMPsr(R) ( X86_TARGET_64BIT ? _JMPQsr(R) : _JMPLsr(R))
|
||||
#define JMPsm(D,B,I,S) (_REXLrm(0, B, I), _O_r_X (0xff ,_b100 ,(int)(D),B,I,S ))
|
||||
|
||||
/* _format Opcd ,Mod ,r ,m ,mem=dsp+sib ,imm... */
|
||||
#define JCCSii(CC, D) _O_B (0x70|(CC) ,(_sc)(int)(D) )
|
||||
#define JCCSim(CC, D) _O_D8 (0x70|(CC) ,(int)(D) )
|
||||
#define JOSm(D) JCCSim(0x0, D)
|
||||
#define JNOSm(D) JCCSim(0x1, D)
|
||||
#define JBSm(D) JCCSim(0x2, D)
|
||||
#define JNAESm(D) JCCSim(0x2, D)
|
||||
#define JNBSm(D) JCCSim(0x3, D)
|
||||
#define JAESm(D) JCCSim(0x3, D)
|
||||
#define JESm(D) JCCSim(0x4, D)
|
||||
#define JZSm(D) JCCSim(0x4, D)
|
||||
#define JNESm(D) JCCSim(0x5, D)
|
||||
#define JNZSm(D) JCCSim(0x5, D)
|
||||
#define JBESm(D) JCCSim(0x6, D)
|
||||
#define JNASm(D) JCCSim(0x6, D)
|
||||
#define JNBESm(D) JCCSim(0x7, D)
|
||||
#define JASm(D) JCCSim(0x7, D)
|
||||
#define JSSm(D) JCCSim(0x8, D)
|
||||
#define JNSSm(D) JCCSim(0x9, D)
|
||||
#define JPSm(D) JCCSim(0xa, D)
|
||||
#define JPESm(D) JCCSim(0xa, D)
|
||||
#define JNPSm(D) JCCSim(0xb, D)
|
||||
#define JPOSm(D) JCCSim(0xb, D)
|
||||
#define JLSm(D) JCCSim(0xc, D)
|
||||
#define JNGESm(D) JCCSim(0xc, D)
|
||||
#define JNLSm(D) JCCSim(0xd, D)
|
||||
#define JGESm(D) JCCSim(0xd, D)
|
||||
#define JLESm(D) JCCSim(0xe, D)
|
||||
#define JNGSm(D) JCCSim(0xe, D)
|
||||
#define JNLESm(D) JCCSim(0xf, D)
|
||||
#define JGSm(D) JCCSim(0xf, D)
|
||||
#define JOSm(D) JCCSim(X86_CC_O, D)
|
||||
#define JNOSm(D) JCCSim(X86_CC_NO, D)
|
||||
#define JBSm(D) JCCSim(X86_CC_B, D)
|
||||
#define JNAESm(D) JCCSim(X86_CC_NAE, D)
|
||||
#define JNBSm(D) JCCSim(X86_CC_NB, D)
|
||||
#define JAESm(D) JCCSim(X86_CC_AE, D)
|
||||
#define JESm(D) JCCSim(X86_CC_E, D)
|
||||
#define JZSm(D) JCCSim(X86_CC_Z, D)
|
||||
#define JNESm(D) JCCSim(X86_CC_NE, D)
|
||||
#define JNZSm(D) JCCSim(X86_CC_NZ, D)
|
||||
#define JBESm(D) JCCSim(X86_CC_BE, D)
|
||||
#define JNASm(D) JCCSim(X86_CC_NA, D)
|
||||
#define JNBESm(D) JCCSim(X86_CC_NBE, D)
|
||||
#define JASm(D) JCCSim(X86_CC_A, D)
|
||||
#define JSSm(D) JCCSim(X86_CC_S, D)
|
||||
#define JNSSm(D) JCCSim(X86_CC_NS, D)
|
||||
#define JPSm(D) JCCSim(X86_CC_P, D)
|
||||
#define JPESm(D) JCCSim(X86_CC_PE, D)
|
||||
#define JNPSm(D) JCCSim(X86_CC_NP, D)
|
||||
#define JPOSm(D) JCCSim(X86_CC_PO, D)
|
||||
#define JLSm(D) JCCSim(X86_CC_L, D)
|
||||
#define JNGESm(D) JCCSim(X86_CC_NGE, D)
|
||||
#define JNLSm(D) JCCSim(X86_CC_NL, D)
|
||||
#define JGESm(D) JCCSim(X86_CC_GE, D)
|
||||
#define JLESm(D) JCCSim(X86_CC_LE, D)
|
||||
#define JNGSm(D) JCCSim(X86_CC_NG, D)
|
||||
#define JNLESm(D) JCCSim(X86_CC_NLE, D)
|
||||
#define JGSm(D) JCCSim(X86_CC_G, D)
|
||||
|
||||
/* _format Opcd ,Mod ,r ,m ,mem=dsp+sib ,imm... */
|
||||
#define JCCii(CC, D) _OO_L (0x0f80|(CC) ,(int)(D) )
|
||||
#define JCCim(CC, D) _OO_D32 (0x0f80|(CC) ,(int)(D) )
|
||||
#define JOm(D) JCCim(0x0, D)
|
||||
#define JNOm(D) JCCim(0x1, D)
|
||||
#define JBm(D) JCCim(0x2, D)
|
||||
#define JNAEm(D) JCCim(0x2, D)
|
||||
#define JNBm(D) JCCim(0x3, D)
|
||||
#define JAEm(D) JCCim(0x3, D)
|
||||
#define JEm(D) JCCim(0x4, D)
|
||||
#define JZm(D) JCCim(0x4, D)
|
||||
#define JNEm(D) JCCim(0x5, D)
|
||||
#define JNZm(D) JCCim(0x5, D)
|
||||
#define JBEm(D) JCCim(0x6, D)
|
||||
#define JNAm(D) JCCim(0x6, D)
|
||||
#define JNBEm(D) JCCim(0x7, D)
|
||||
#define JAm(D) JCCim(0x7, D)
|
||||
#define JSm(D) JCCim(0x8, D)
|
||||
#define JNSm(D) JCCim(0x9, D)
|
||||
#define JPm(D) JCCim(0xa, D)
|
||||
#define JPEm(D) JCCim(0xa, D)
|
||||
#define JNPm(D) JCCim(0xb, D)
|
||||
#define JPOm(D) JCCim(0xb, D)
|
||||
#define JLm(D) JCCim(0xc, D)
|
||||
#define JNGEm(D) JCCim(0xc, D)
|
||||
#define JNLm(D) JCCim(0xd, D)
|
||||
#define JGEm(D) JCCim(0xd, D)
|
||||
#define JLEm(D) JCCim(0xe, D)
|
||||
#define JNGm(D) JCCim(0xe, D)
|
||||
#define JNLEm(D) JCCim(0xf, D)
|
||||
#define JGm(D) JCCim(0xf, D)
|
||||
#define JOm(D) JCCim(X86_CC_O, D)
|
||||
#define JNOm(D) JCCim(X86_CC_NO, D)
|
||||
#define JBm(D) JCCim(X86_CC_B, D)
|
||||
#define JNAEm(D) JCCim(X86_CC_NAE, D)
|
||||
#define JNBm(D) JCCim(X86_CC_NB, D)
|
||||
#define JAEm(D) JCCim(X86_CC_AE, D)
|
||||
#define JEm(D) JCCim(X86_CC_E, D)
|
||||
#define JZm(D) JCCim(X86_CC_Z, D)
|
||||
#define JNEm(D) JCCim(X86_CC_NE, D)
|
||||
#define JNZm(D) JCCim(X86_CC_NZ, D)
|
||||
#define JBEm(D) JCCim(X86_CC_BE, D)
|
||||
#define JNAm(D) JCCim(X86_CC_NA, D)
|
||||
#define JNBEm(D) JCCim(X86_CC_NBE, D)
|
||||
#define JAm(D) JCCim(X86_CC_A, D)
|
||||
#define JSm(D) JCCim(X86_CC_S, D)
|
||||
#define JNSm(D) JCCim(X86_CC_NS, D)
|
||||
#define JPm(D) JCCim(X86_CC_P, D)
|
||||
#define JPEm(D) JCCim(X86_CC_PE, D)
|
||||
#define JNPm(D) JCCim(X86_CC_NP, D)
|
||||
#define JPOm(D) JCCim(X86_CC_PO, D)
|
||||
#define JLm(D) JCCim(X86_CC_L, D)
|
||||
#define JNGEm(D) JCCim(X86_CC_NGE, D)
|
||||
#define JNLm(D) JCCim(X86_CC_NL, D)
|
||||
#define JGEm(D) JCCim(X86_CC_GE, D)
|
||||
#define JLEm(D) JCCim(X86_CC_LE, D)
|
||||
#define JNGm(D) JCCim(X86_CC_NG, D)
|
||||
#define JNLEm(D) JCCim(X86_CC_NLE, D)
|
||||
#define JGm(D) JCCim(X86_CC_G, D)
|
||||
|
||||
/* _format Opcd ,Mod ,r ,m ,mem=dsp+sib ,imm... */
|
||||
#define SETCCir(CC, RD) (_REXBrr(0, RD), _OO_Mrm (0x0f90|(CC) ,_b11,_b000,_r1(RD) ))
|
||||
#define SETOr(RD) SETCCir(0x0,RD)
|
||||
#define SETNOr(RD) SETCCir(0x1,RD)
|
||||
#define SETBr(RD) SETCCir(0x2,RD)
|
||||
#define SETNAEr(RD) SETCCir(0x2,RD)
|
||||
#define SETNBr(RD) SETCCir(0x3,RD)
|
||||
#define SETAEr(RD) SETCCir(0x3,RD)
|
||||
#define SETEr(RD) SETCCir(0x4,RD)
|
||||
#define SETZr(RD) SETCCir(0x4,RD)
|
||||
#define SETNEr(RD) SETCCir(0x5,RD)
|
||||
#define SETNZr(RD) SETCCir(0x5,RD)
|
||||
#define SETBEr(RD) SETCCir(0x6,RD)
|
||||
#define SETNAr(RD) SETCCir(0x6,RD)
|
||||
#define SETNBEr(RD) SETCCir(0x7,RD)
|
||||
#define SETAr(RD) SETCCir(0x7,RD)
|
||||
#define SETSr(RD) SETCCir(0x8,RD)
|
||||
#define SETNSr(RD) SETCCir(0x9,RD)
|
||||
#define SETPr(RD) SETCCir(0xa,RD)
|
||||
#define SETPEr(RD) SETCCir(0xa,RD)
|
||||
#define SETNPr(RD) SETCCir(0xb,RD)
|
||||
#define SETPOr(RD) SETCCir(0xb,RD)
|
||||
#define SETLr(RD) SETCCir(0xc,RD)
|
||||
#define SETNGEr(RD) SETCCir(0xc,RD)
|
||||
#define SETNLr(RD) SETCCir(0xd,RD)
|
||||
#define SETGEr(RD) SETCCir(0xd,RD)
|
||||
#define SETLEr(RD) SETCCir(0xe,RD)
|
||||
#define SETNGr(RD) SETCCir(0xe,RD)
|
||||
#define SETNLEr(RD) SETCCir(0xf,RD)
|
||||
#define SETGr(RD) SETCCir(0xf,RD)
|
||||
#define SETOr(RD) SETCCir(X86_CC_O, RD)
|
||||
#define SETNOr(RD) SETCCir(X86_CC_NO, RD)
|
||||
#define SETBr(RD) SETCCir(X86_CC_B, RD)
|
||||
#define SETNAEr(RD) SETCCir(X86_CC_NAE, RD)
|
||||
#define SETNBr(RD) SETCCir(X86_CC_NB, RD)
|
||||
#define SETAEr(RD) SETCCir(X86_CC_AE, RD)
|
||||
#define SETEr(RD) SETCCir(X86_CC_E, RD)
|
||||
#define SETZr(RD) SETCCir(X86_CC_Z, RD)
|
||||
#define SETNEr(RD) SETCCir(X86_CC_NE, RD)
|
||||
#define SETNZr(RD) SETCCir(X86_CC_NZ, RD)
|
||||
#define SETBEr(RD) SETCCir(X86_CC_BE, RD)
|
||||
#define SETNAr(RD) SETCCir(X86_CC_NA, RD)
|
||||
#define SETNBEr(RD) SETCCir(X86_CC_NBE, RD)
|
||||
#define SETAr(RD) SETCCir(X86_CC_A, RD)
|
||||
#define SETSr(RD) SETCCir(X86_CC_S, RD)
|
||||
#define SETNSr(RD) SETCCir(X86_CC_NS, RD)
|
||||
#define SETPr(RD) SETCCir(X86_CC_P, RD)
|
||||
#define SETPEr(RD) SETCCir(X86_CC_PE, RD)
|
||||
#define SETNPr(RD) SETCCir(X86_CC_NP, RD)
|
||||
#define SETPOr(RD) SETCCir(X86_CC_PO, RD)
|
||||
#define SETLr(RD) SETCCir(X86_CC_L, RD)
|
||||
#define SETNGEr(RD) SETCCir(X86_CC_NGE, RD)
|
||||
#define SETNLr(RD) SETCCir(X86_CC_NL, RD)
|
||||
#define SETGEr(RD) SETCCir(X86_CC_GE, RD)
|
||||
#define SETLEr(RD) SETCCir(X86_CC_LE, RD)
|
||||
#define SETNGr(RD) SETCCir(X86_CC_NG, RD)
|
||||
#define SETNLEr(RD) SETCCir(X86_CC_NLE, RD)
|
||||
#define SETGr(RD) SETCCir(X86_CC_G, RD)
|
||||
|
||||
/* _format Opcd ,Mod ,r ,m ,mem=dsp+sib ,imm... */
|
||||
#define SETCCim(CC,MD,MB,MI,MS) (_REXBrm(0, MB, MI), _OO_r_X (0x0f90|(CC) ,_b000 ,MD,MB,MI,MS ))
|
||||
#define SETOm(D, B, I, S) SETCCim(0x0, D, B, I, S)
|
||||
#define SETNOm(D, B, I, S) SETCCim(0x1, D, B, I, S)
|
||||
#define SETBm(D, B, I, S) SETCCim(0x2, D, B, I, S)
|
||||
#define SETNAEm(D, B, I, S) SETCCim(0x2, D, B, I, S)
|
||||
#define SETNBm(D, B, I, S) SETCCim(0x3, D, B, I, S)
|
||||
#define SETAEm(D, B, I, S) SETCCim(0x3, D, B, I, S)
|
||||
#define SETEm(D, B, I, S) SETCCim(0x4, D, B, I, S)
|
||||
#define SETZm(D, B, I, S) SETCCim(0x4, D, B, I, S)
|
||||
#define SETNEm(D, B, I, S) SETCCim(0x5, D, B, I, S)
|
||||
#define SETNZm(D, B, I, S) SETCCim(0x5, D, B, I, S)
|
||||
#define SETBEm(D, B, I, S) SETCCim(0x6, D, B, I, S)
|
||||
#define SETNAm(D, B, I, S) SETCCim(0x6, D, B, I, S)
|
||||
#define SETNBEm(D, B, I, S) SETCCim(0x7, D, B, I, S)
|
||||
#define SETAm(D, B, I, S) SETCCim(0x7, D, B, I, S)
|
||||
#define SETSm(D, B, I, S) SETCCim(0x8, D, B, I, S)
|
||||
#define SETNSm(D, B, I, S) SETCCim(0x9, D, B, I, S)
|
||||
#define SETPm(D, B, I, S) SETCCim(0xa, D, B, I, S)
|
||||
#define SETPEm(D, B, I, S) SETCCim(0xa, D, B, I, S)
|
||||
#define SETNPm(D, B, I, S) SETCCim(0xb, D, B, I, S)
|
||||
#define SETPOm(D, B, I, S) SETCCim(0xb, D, B, I, S)
|
||||
#define SETLm(D, B, I, S) SETCCim(0xc, D, B, I, S)
|
||||
#define SETNGEm(D, B, I, S) SETCCim(0xc, D, B, I, S)
|
||||
#define SETNLm(D, B, I, S) SETCCim(0xd, D, B, I, S)
|
||||
#define SETGEm(D, B, I, S) SETCCim(0xd, D, B, I, S)
|
||||
#define SETLEm(D, B, I, S) SETCCim(0xe, D, B, I, S)
|
||||
#define SETNGm(D, B, I, S) SETCCim(0xe, D, B, I, S)
|
||||
#define SETNLEm(D, B, I, S) SETCCim(0xf, D, B, I, S)
|
||||
#define SETGm(D, B, I, S) SETCCim(0xf, D, B, I, S)
|
||||
#define SETOm(D, B, I, S) SETCCim(X86_CC_O, D, B, I, S)
|
||||
#define SETNOm(D, B, I, S) SETCCim(X86_CC_NO, D, B, I, S)
|
||||
#define SETBm(D, B, I, S) SETCCim(X86_CC_B, D, B, I, S)
|
||||
#define SETNAEm(D, B, I, S) SETCCim(X86_CC_NAE, D, B, I, S)
|
||||
#define SETNBm(D, B, I, S) SETCCim(X86_CC_NB, D, B, I, S)
|
||||
#define SETAEm(D, B, I, S) SETCCim(X86_CC_AE, D, B, I, S)
|
||||
#define SETEm(D, B, I, S) SETCCim(X86_CC_E, D, B, I, S)
|
||||
#define SETZm(D, B, I, S) SETCCim(X86_CC_Z, D, B, I, S)
|
||||
#define SETNEm(D, B, I, S) SETCCim(X86_CC_NE, D, B, I, S)
|
||||
#define SETNZm(D, B, I, S) SETCCim(X86_CC_NZ, D, B, I, S)
|
||||
#define SETBEm(D, B, I, S) SETCCim(X86_CC_BE, D, B, I, S)
|
||||
#define SETNAm(D, B, I, S) SETCCim(X86_CC_NA, D, B, I, S)
|
||||
#define SETNBEm(D, B, I, S) SETCCim(X86_CC_NBE, D, B, I, S)
|
||||
#define SETAm(D, B, I, S) SETCCim(X86_CC_A, D, B, I, S)
|
||||
#define SETSm(D, B, I, S) SETCCim(X86_CC_S, D, B, I, S)
|
||||
#define SETNSm(D, B, I, S) SETCCim(X86_CC_NS, D, B, I, S)
|
||||
#define SETPm(D, B, I, S) SETCCim(X86_CC_P, D, B, I, S)
|
||||
#define SETPEm(D, B, I, S) SETCCim(X86_CC_PE, D, B, I, S)
|
||||
#define SETNPm(D, B, I, S) SETCCim(X86_CC_NP, D, B, I, S)
|
||||
#define SETPOm(D, B, I, S) SETCCim(X86_CC_PO, D, B, I, S)
|
||||
#define SETLm(D, B, I, S) SETCCim(X86_CC_L, D, B, I, S)
|
||||
#define SETNGEm(D, B, I, S) SETCCim(X86_CC_NGE, D, B, I, S)
|
||||
#define SETNLm(D, B, I, S) SETCCim(X86_CC_NL, D, B, I, S)
|
||||
#define SETGEm(D, B, I, S) SETCCim(X86_CC_GE, D, B, I, S)
|
||||
#define SETLEm(D, B, I, S) SETCCim(X86_CC_LE, D, B, I, S)
|
||||
#define SETNGm(D, B, I, S) SETCCim(X86_CC_NG, D, B, I, S)
|
||||
#define SETNLEm(D, B, I, S) SETCCim(X86_CC_NLE, D, B, I, S)
|
||||
#define SETGm(D, B, I, S) SETCCim(X86_CC_G, D, B, I, S)
|
||||
|
||||
/* _format Opcd ,Mod ,r ,m ,mem=dsp+sib ,imm... */
|
||||
#define CMOVWrr(CC,RS,RD) (_d16(), _REXLrr(RD, RS), _OO_Mrm (0x0f40|(CC) ,_b11,_r2(RD),_r2(RS) ))
|
||||
|
Loading…
Reference in New Issue
Block a user