CACAO
Macros
codegen.hpp File Reference

Go to the source code of this file.

Macros

#define gen_bound_check
 
#define MCODECHECK(icnt)
 
#define ALIGNCODENOP
 
#define ICONST(d, c)   emit_iconst(cd, (d), (c))
 
#define LCONST(d, c)   emit_lconst(cd, (d), (c))
 
#define BRANCH_NOPS
 
#define PATCHER_CALL_SIZE   1 * 4 /* an instruction is 4-bytes long */
 
#define PATCHER_NOPS
 
#define M_MEM(Opcode, Ra, Rb, Memory_disp)
 
#define M_MEM_GET_Opcode(x)   ( (((x) >> 26) & 0x3f ))
 
#define M_MEM_GET_Ra(x)   ( (((x) >> 21) & 0x1f ))
 
#define M_MEM_GET_Rb(x)   ( (((x) >> 16) & 0x1f ))
 
#define M_MEM_GET_Memory_disp(x)   ((int16_t) ( (x) & 0xffff))
 
#define M_BRA(Opcode, Ra, Branch_disp)
 
#define REG   0
 
#define CONST   1
 
#define M_OP3(op, fu, a, b, c, const)
 
#define M_OP3_GET_Opcode(x)   ( (((x) >> 26) & 0x3f ))
 
#define M_FOP3(op, fu, a, b, c)
 
#define M_LDA_INTERN(a, b, disp)   M_MEM(0x08,a,b,disp) /* low const */
 
#define M_LDA(a, b, disp)
 
#define M_LDAH(a, b, disp)   M_MEM (0x09,a,b,disp) /* high const */
 
#define M_BLDU(a, b, disp)   M_MEM (0x0a,a,b,disp) /* 8 load */
 
#define M_SLDU(a, b, disp)   M_MEM (0x0c,a,b,disp) /* 16 load */
 
#define M_ILD_INTERN(a, b, disp)   M_MEM(0x28,a,b,disp) /* 32 load */
 
#define M_LLD_INTERN(a, b, disp)   M_MEM(0x29,a,b,disp) /* 64 load */
 
#define M_ILD(a, b, disp)
 
#define M_LLD(a, b, disp)
 
#define M_ALD_INTERN(a, b, disp)   M_LLD_INTERN(a,b,disp)
 
#define M_ALD(a, b, disp)   M_LLD(a,b,disp) /* addr load */
 
#define M_ALD_DSEG(a, disp)   M_LLD(a,REG_PV,disp)
 
#define M_BST(a, b, disp)   M_MEM(0x0e,a,b,disp) /* 8 store */
 
#define M_SST(a, b, disp)   M_MEM(0x0d,a,b,disp) /* 16 store */
 
#define M_IST_INTERN(a, b, disp)   M_MEM(0x2c,a,b,disp) /* 32 store */
 
#define M_LST_INTERN(a, b, disp)   M_MEM(0x2d,a,b,disp) /* 64 store */
 
#define M_IST(a, b, disp)
 
#define M_LST(a, b, disp)
 
#define M_AST(a, b, disp)   M_LST(a,b,disp) /* addr store */
 
#define M_BSEXT(b, c)   M_OP3 (0x1c,0x0,REG_ZERO,b,c,0) /* 8 signext */
 
#define M_SSEXT(b, c)   M_OP3 (0x1c,0x1,REG_ZERO,b,c,0) /* 16 signext */
 
#define M_BR(disp)   M_BRA (0x30,REG_ZERO,disp) /* branch */
 
#define M_BSR(ra, disp)   M_BRA (0x34,ra,disp) /* branch sbr */
 
#define M_BEQZ(a, disp)   M_BRA (0x39,a,disp) /* br a == 0 */
 
#define M_BLTZ(a, disp)   M_BRA (0x3a,a,disp) /* br a < 0 */
 
#define M_BLEZ(a, disp)   M_BRA (0x3b,a,disp) /* br a <= 0 */
 
#define M_BNEZ(a, disp)   M_BRA (0x3d,a,disp) /* br a != 0 */
 
#define M_BGEZ(a, disp)   M_BRA (0x3e,a,disp) /* br a >= 0 */
 
#define M_BGTZ(a, disp)   M_BRA (0x3f,a,disp) /* br a > 0 */
 
#define M_JMP(a, b)   M_MEM (0x1a,a,b,0x0000) /* jump */
 
#define M_JSR(a, b)   M_MEM (0x1a,a,b,0x4000) /* call sbr */
 
#define M_RET(a, b)   M_MEM (0x1a,a,b,0x8000) /* return */
 
#define M_IADD(a, b, c)   M_OP3 (0x10,0x0, a,b,c,0) /* 32 add */
 
#define M_LADD(a, b, c)   M_OP3 (0x10,0x20, a,b,c,0) /* 64 add */
 
#define M_ISUB(a, b, c)   M_OP3 (0x10,0x09, a,b,c,0) /* 32 sub */
 
#define M_LSUB(a, b, c)   M_OP3 (0x10,0x29, a,b,c,0) /* 64 sub */
 
#define M_IMUL(a, b, c)   M_OP3 (0x13,0x00, a,b,c,0) /* 32 mul */
 
#define M_LMUL(a, b, c)   M_OP3 (0x13,0x20, a,b,c,0) /* 64 mul */
 
#define M_IADD_IMM(a, b, c)   M_OP3 (0x10,0x0, a,b,c,1) /* 32 add */
 
#define M_LADD_IMM(a, b, c)   M_OP3 (0x10,0x20, a,b,c,1) /* 64 add */
 
#define M_ISUB_IMM(a, b, c)   M_OP3 (0x10,0x09, a,b,c,1) /* 32 sub */
 
#define M_LSUB_IMM(a, b, c)   M_OP3 (0x10,0x29, a,b,c,1) /* 64 sub */
 
#define M_IMUL_IMM(a, b, c)   M_OP3 (0x13,0x00, a,b,c,1) /* 32 mul */
 
#define M_LMUL_IMM(a, b, c)   M_OP3 (0x13,0x20, a,b,c,1) /* 64 mul */
 
#define M_AADD_IMM(a, b, c)   M_LADD_IMM(a,b,c)
 
#define M_ASUB_IMM(a, b, c)   M_LSUB_IMM(a,b,c)
 
#define M_CMPEQ(a, b, c)   M_OP3 (0x10,0x2d, a,b,c,0) /* c = a == b */
 
#define M_CMPLT(a, b, c)   M_OP3 (0x10,0x4d, a,b,c,0) /* c = a < b */
 
#define M_CMPLE(a, b, c)   M_OP3 (0x10,0x6d, a,b,c,0) /* c = a <= b */
 
#define M_CMPULE(a, b, c)   M_OP3 (0x10,0x3d, a,b,c,0) /* c = a <= b */
 
#define M_CMPULT(a, b, c)   M_OP3 (0x10,0x1d, a,b,c,0) /* c = a <= b */
 
#define M_CMPEQ_IMM(a, b, c)   M_OP3 (0x10,0x2d, a,b,c,1) /* c = a == b */
 
#define M_CMPLT_IMM(a, b, c)   M_OP3 (0x10,0x4d, a,b,c,1) /* c = a < b */
 
#define M_CMPLE_IMM(a, b, c)   M_OP3 (0x10,0x6d, a,b,c,1) /* c = a <= b */
 
#define M_CMPULE_IMM(a, b, c)   M_OP3 (0x10,0x3d, a,b,c,1) /* c = a <= b */
 
#define M_CMPULT_IMM(a, b, c)   M_OP3 (0x10,0x1d, a,b,c,1) /* c = a <= b */
 
#define M_AND(a, b, c)   M_OP3 (0x11,0x00, a,b,c,0) /* c = a & b */
 
#define M_OR(a, b, c)   M_OP3 (0x11,0x20, a,b,c,0) /* c = a | b */
 
#define M_XOR(a, b, c)   M_OP3 (0x11,0x40, a,b,c,0) /* c = a ^ b */
 
#define M_AND_IMM(a, b, c)   M_OP3 (0x11,0x00, a,b,c,1) /* c = a & b */
 
#define M_OR_IMM(a, b, c)   M_OP3 (0x11,0x20, a,b,c,1) /* c = a | b */
 
#define M_XOR_IMM(a, b, c)   M_OP3 (0x11,0x40, a,b,c,1) /* c = a ^ b */
 
#define M_MOV(a, c)   M_OR (a,a,c) /* c = a */
 
#define M_CLR(c)   M_OR (31,31,c) /* c = 0 */
 
#define M_NOP   M_OR (31,31,31) /* ; */
 
#define M_SLL(a, b, c)   M_OP3 (0x12,0x39, a,b,c,0) /* c = a << b */
 
#define M_SRA(a, b, c)   M_OP3 (0x12,0x3c, a,b,c,0) /* c = a >> b */
 
#define M_SRL(a, b, c)   M_OP3 (0x12,0x34, a,b,c,0) /* c = a >>>b */
 
#define M_SLL_IMM(a, b, c)   M_OP3 (0x12,0x39, a,b,c,1) /* c = a << b */
 
#define M_SRA_IMM(a, b, c)   M_OP3 (0x12,0x3c, a,b,c,1) /* c = a >> b */
 
#define M_SRL_IMM(a, b, c)   M_OP3 (0x12,0x34, a,b,c,1) /* c = a >>>b */
 
#define M_FLD_INTERN(a, b, disp)   M_MEM(0x22,a,b,disp) /* load flt */
 
#define M_DLD_INTERN(a, b, disp)   M_MEM(0x23,a,b,disp) /* load dbl */
 
#define M_FLD(a, b, disp)
 
#define M_DLD(a, b, disp)
 
#define M_FST_INTERN(a, b, disp)   M_MEM(0x26,a,b,disp) /* store flt */
 
#define M_DST_INTERN(a, b, disp)   M_MEM(0x27,a,b,disp) /* store dbl */
 
#define M_FST(a, b, disp)
 
#define M_DST(a, b, disp)
 
#define M_FADD(a, b, c)   M_FOP3 (0x16, 0x080, a,b,c) /* flt add */
 
#define M_DADD(a, b, c)   M_FOP3 (0x16, 0x0a0, a,b,c) /* dbl add */
 
#define M_FSUB(a, b, c)   M_FOP3 (0x16, 0x081, a,b,c) /* flt sub */
 
#define M_DSUB(a, b, c)   M_FOP3 (0x16, 0x0a1, a,b,c) /* dbl sub */
 
#define M_FMUL(a, b, c)   M_FOP3 (0x16, 0x082, a,b,c) /* flt mul */
 
#define M_DMUL(a, b, c)   M_FOP3 (0x16, 0x0a2, a,b,c) /* dbl mul */
 
#define M_FDIV(a, b, c)   M_FOP3 (0x16, 0x083, a,b,c) /* flt div */
 
#define M_DDIV(a, b, c)   M_FOP3 (0x16, 0x0a3, a,b,c) /* dbl div */
 
#define M_FADDS(a, b, c)   M_FOP3 (0x16, 0x580, a,b,c) /* flt add */
 
#define M_DADDS(a, b, c)   M_FOP3 (0x16, 0x5a0, a,b,c) /* dbl add */
 
#define M_FSUBS(a, b, c)   M_FOP3 (0x16, 0x581, a,b,c) /* flt sub */
 
#define M_DSUBS(a, b, c)   M_FOP3 (0x16, 0x5a1, a,b,c) /* dbl sub */
 
#define M_FMULS(a, b, c)   M_FOP3 (0x16, 0x582, a,b,c) /* flt mul */
 
#define M_DMULS(a, b, c)   M_FOP3 (0x16, 0x5a2, a,b,c) /* dbl mul */
 
#define M_FDIVS(a, b, c)   M_FOP3 (0x16, 0x583, a,b,c) /* flt div */
 
#define M_DDIVS(a, b, c)   M_FOP3 (0x16, 0x5a3, a,b,c) /* dbl div */
 
#define M_CVTDF(b, c)   M_FOP3 (0x16, 0x0ac, 31,b,c) /* dbl2flt */
 
#define M_CVTLF(b, c)   M_FOP3 (0x16, 0x0bc, 31,b,c) /* long2flt */
 
#define M_CVTLD(b, c)   M_FOP3 (0x16, 0x0be, 31,b,c) /* long2dbl */
 
#define M_CVTDL(b, c)   M_FOP3 (0x16, 0x1af, 31,b,c) /* dbl2long */
 
#define M_CVTDL_C(b, c)   M_FOP3 (0x16, 0x12f, 31,b,c) /* dbl2long */
 
#define M_CVTLI(b, c)   M_FOP3 (0x17, 0x130, 31,b,c) /* long2int */
 
#define M_CVTDFS(b, c)   M_FOP3 (0x16, 0x5ac, 31,b,c) /* dbl2flt */
 
#define M_CVTFDS(b, c)   M_FOP3 (0x16, 0x6ac, 31,b,c) /* flt2dbl */
 
#define M_CVTDLS(b, c)   M_FOP3 (0x16, 0x5af, 31,b,c) /* dbl2long */
 
#define M_CVTDL_CS(b, c)   M_FOP3 (0x16, 0x52f, 31,b,c) /* dbl2long */
 
#define M_CVTLIS(b, c)   M_FOP3 (0x17, 0x530, 31,b,c) /* long2int */
 
#define M_FCMPEQ(a, b, c)   M_FOP3 (0x16, 0x0a5, a,b,c) /* c = a==b */
 
#define M_FCMPLT(a, b, c)   M_FOP3 (0x16, 0x0a6, a,b,c) /* c = a<b */
 
#define M_FCMPEQS(a, b, c)   M_FOP3 (0x16, 0x5a5, a,b,c) /* c = a==b */
 
#define M_FCMPLTS(a, b, c)   M_FOP3 (0x16, 0x5a6, a,b,c) /* c = a<b */
 
#define M_FMOV(fa, fb)   M_FOP3 (0x17, 0x020, fa,fa,fb) /* b = a */
 
#define M_DMOV(fa, fb)   M_FMOV (fa,fb)
 
#define M_FMOVN(fa, fb)   M_FOP3 (0x17, 0x021, fa,fa,fb) /* b = -a */
 
#define M_FNOP   M_FMOV (31,31)
 
#define M_FBEQZ(fa, disp)   M_BRA (0x31,fa,disp) /* br a == 0.0*/
 
#define M_TRAPB   M_MEM (0x18,0,0,0x0000) /* trap barrier*/
 
#define M_S4ADDL(a, b, c)   M_OP3 (0x10,0x02, a,b,c,0) /* c = a*4 + b */
 
#define M_S4ADDQ(a, b, c)   M_OP3 (0x10,0x22, a,b,c,0) /* c = a*4 + b */
 
#define M_S4SUBL(a, b, c)   M_OP3 (0x10,0x0b, a,b,c,0) /* c = a*4 - b */
 
#define M_S4SUBQ(a, b, c)   M_OP3 (0x10,0x2b, a,b,c,0) /* c = a*4 - b */
 
#define M_S8ADDL(a, b, c)   M_OP3 (0x10,0x12, a,b,c,0) /* c = a*8 + b */
 
#define M_S8ADDQ(a, b, c)   M_OP3 (0x10,0x32, a,b,c,0) /* c = a*8 + b */
 
#define M_S8SUBL(a, b, c)   M_OP3 (0x10,0x1b, a,b,c,0) /* c = a*8 - b */
 
#define M_S8SUBQ(a, b, c)   M_OP3 (0x10,0x3b, a,b,c,0) /* c = a*8 - b */
 
#define M_SAADDQ(a, b, c)   M_S8ADDQ(a,b,c) /* c = a*8 + b */
 
#define M_S4ADDL_IMM(a, b, c)   M_OP3 (0x10,0x02, a,b,c,1) /* c = a*4 + b */
 
#define M_S4ADDQ_IMM(a, b, c)   M_OP3 (0x10,0x22, a,b,c,1) /* c = a*4 + b */
 
#define M_S4SUBL_IMM(a, b, c)   M_OP3 (0x10,0x0b, a,b,c,1) /* c = a*4 - b */
 
#define M_S4SUBQ_IMM(a, b, c)   M_OP3 (0x10,0x2b, a,b,c,1) /* c = a*4 - b */
 
#define M_S8ADDL_IMM(a, b, c)   M_OP3 (0x10,0x12, a,b,c,1) /* c = a*8 + b */
 
#define M_S8ADDQ_IMM(a, b, c)   M_OP3 (0x10,0x32, a,b,c,1) /* c = a*8 + b */
 
#define M_S8SUBL_IMM(a, b, c)   M_OP3 (0x10,0x1b, a,b,c,1) /* c = a*8 - b */
 
#define M_S8SUBQ_IMM(a, b, c)   M_OP3 (0x10,0x3b, a,b,c,1) /* c = a*8 - b */
 
#define M_LLD_U(a, b, disp)   M_MEM (0x0b,a,b,disp) /* unalign ld */
 
#define M_LST_U(a, b, disp)   M_MEM (0x0f,a,b,disp) /* unalign st */
 
#define M_ZAP(a, b, c)   M_OP3 (0x12,0x30, a,b,c,0)
 
#define M_ZAPNOT(a, b, c)   M_OP3 (0x12,0x31, a,b,c,0)
 
#define M_ZAP_IMM(a, b, c)   M_OP3 (0x12,0x30, a,b,c,1)
 
#define M_ZAPNOT_IMM(a, b, c)   M_OP3 (0x12,0x31, a,b,c,1)
 
#define M_BZEXT(a, b)   M_ZAPNOT_IMM(a, 0x01, b) /* 8 zeroext */
 
#define M_CZEXT(a, b)   M_ZAPNOT_IMM(a, 0x03, b) /* 16 zeroext */
 
#define M_IZEXT(a, b)   M_ZAPNOT_IMM(a, 0x0f, b) /* 32 zeroext */
 
#define M_EXTBL(a, b, c)   M_OP3 (0x12,0x06, a,b,c,0)
 
#define M_EXTWL(a, b, c)   M_OP3 (0x12,0x16, a,b,c,0)
 
#define M_EXTLL(a, b, c)   M_OP3 (0x12,0x26, a,b,c,0)
 
#define M_EXTQL(a, b, c)   M_OP3 (0x12,0x36, a,b,c,0)
 
#define M_EXTWH(a, b, c)   M_OP3 (0x12,0x5a, a,b,c,0)
 
#define M_EXTLH(a, b, c)   M_OP3 (0x12,0x6a, a,b,c,0)
 
#define M_EXTQH(a, b, c)   M_OP3 (0x12,0x7a, a,b,c,0)
 
#define M_INSBL(a, b, c)   M_OP3 (0x12,0x0b, a,b,c,0)
 
#define M_INSWL(a, b, c)   M_OP3 (0x12,0x1b, a,b,c,0)
 
#define M_INSLL(a, b, c)   M_OP3 (0x12,0x2b, a,b,c,0)
 
#define M_INSQL(a, b, c)   M_OP3 (0x12,0x3b, a,b,c,0)
 
#define M_INSWH(a, b, c)   M_OP3 (0x12,0x57, a,b,c,0)
 
#define M_INSLH(a, b, c)   M_OP3 (0x12,0x67, a,b,c,0)
 
#define M_INSQH(a, b, c)   M_OP3 (0x12,0x77, a,b,c,0)
 
#define M_MSKBL(a, b, c)   M_OP3 (0x12,0x02, a,b,c,0)
 
#define M_MSKWL(a, b, c)   M_OP3 (0x12,0x12, a,b,c,0)
 
#define M_MSKLL(a, b, c)   M_OP3 (0x12,0x22, a,b,c,0)
 
#define M_MSKQL(a, b, c)   M_OP3 (0x12,0x32, a,b,c,0)
 
#define M_MSKWH(a, b, c)   M_OP3 (0x12,0x52, a,b,c,0)
 
#define M_MSKLH(a, b, c)   M_OP3 (0x12,0x62, a,b,c,0)
 
#define M_MSKQH(a, b, c)   M_OP3 (0x12,0x72, a,b,c,0)
 
#define M_EXTBL_IMM(a, b, c)   M_OP3 (0x12,0x06, a,b,c,1)
 
#define M_EXTWL_IMM(a, b, c)   M_OP3 (0x12,0x16, a,b,c,1)
 
#define M_EXTLL_IMM(a, b, c)   M_OP3 (0x12,0x26, a,b,c,1)
 
#define M_EXTQL_IMM(a, b, c)   M_OP3 (0x12,0x36, a,b,c,1)
 
#define M_EXTWH_IMM(a, b, c)   M_OP3 (0x12,0x5a, a,b,c,1)
 
#define M_EXTLH_IMM(a, b, c)   M_OP3 (0x12,0x6a, a,b,c,1)
 
#define M_EXTQH_IMM(a, b, c)   M_OP3 (0x12,0x7a, a,b,c,1)
 
#define M_INSBL_IMM(a, b, c)   M_OP3 (0x12,0x0b, a,b,c,1)
 
#define M_INSWL_IMM(a, b, c)   M_OP3 (0x12,0x1b, a,b,c,1)
 
#define M_INSLL_IMM(a, b, c)   M_OP3 (0x12,0x2b, a,b,c,1)
 
#define M_INSQL_IMM(a, b, c)   M_OP3 (0x12,0x3b, a,b,c,1)
 
#define M_INSWH_IMM(a, b, c)   M_OP3 (0x12,0x57, a,b,c,1)
 
#define M_INSLH_IMM(a, b, c)   M_OP3 (0x12,0x67, a,b,c,1)
 
#define M_INSQH_IMM(a, b, c)   M_OP3 (0x12,0x77, a,b,c,1)
 
#define M_MSKBL_IMM(a, b, c)   M_OP3 (0x12,0x02, a,b,c,1)
 
#define M_MSKWL_IMM(a, b, c)   M_OP3 (0x12,0x12, a,b,c,1)
 
#define M_MSKLL_IMM(a, b, c)   M_OP3 (0x12,0x22, a,b,c,1)
 
#define M_MSKQL_IMM(a, b, c)   M_OP3 (0x12,0x32, a,b,c,1)
 
#define M_MSKWH_IMM(a, b, c)   M_OP3 (0x12,0x52, a,b,c,1)
 
#define M_MSKLH_IMM(a, b, c)   M_OP3 (0x12,0x62, a,b,c,1)
 
#define M_MSKQH_IMM(a, b, c)   M_OP3 (0x12,0x72, a,b,c,1)
 
#define M_UMULH(a, b, c)   M_OP3 (0x13,0x30, a,b,c,0) /* 64 umulh */
 
#define M_UMULH_IMM(a, b, c)   M_OP3 (0x13,0x30, a,b,c,1) /* 64 umulh */
 
#define M_CMOVEQ(a, b, c)   M_OP3 (0x11,0x24, a,b,c,0) /* a==0 ? c=b */
 
#define M_CMOVNE(a, b, c)   M_OP3 (0x11,0x26, a,b,c,0) /* a!=0 ? c=b */
 
#define M_CMOVLT(a, b, c)   M_OP3 (0x11,0x44, a,b,c,0) /* a< 0 ? c=b */
 
#define M_CMOVGE(a, b, c)   M_OP3 (0x11,0x46, a,b,c,0) /* a>=0 ? c=b */
 
#define M_CMOVLE(a, b, c)   M_OP3 (0x11,0x64, a,b,c,0) /* a<=0 ? c=b */
 
#define M_CMOVGT(a, b, c)   M_OP3 (0x11,0x66, a,b,c,0) /* a> 0 ? c=b */
 
#define M_CMOVEQ_IMM(a, b, c)   M_OP3 (0x11,0x24, a,b,c,1) /* a==0 ? c=b */
 
#define M_CMOVNE_IMM(a, b, c)   M_OP3 (0x11,0x26, a,b,c,1) /* a!=0 ? c=b */
 
#define M_CMOVLT_IMM(a, b, c)   M_OP3 (0x11,0x44, a,b,c,1) /* a< 0 ? c=b */
 
#define M_CMOVGE_IMM(a, b, c)   M_OP3 (0x11,0x46, a,b,c,1) /* a>=0 ? c=b */
 
#define M_CMOVLE_IMM(a, b, c)   M_OP3 (0x11,0x64, a,b,c,1) /* a<=0 ? c=b */
 
#define M_CMOVGT_IMM(a, b, c)   M_OP3 (0x11,0x66, a,b,c,1) /* a> 0 ? c=b */
 
#define M_UNDEFINED   M_OP3(0x04, 0, 0, 0, 0, 0)
 
#define M_ANDNOT(a, b, c, const)   M_OP3 (0x11,0x08, a,b,c,const) /* c = a &~ b */
 
#define M_ORNOT(a, b, c, const)   M_OP3 (0x11,0x28, a,b,c,const) /* c = a |~ b */
 
#define M_XORNOT(a, b, c, const)   M_OP3 (0x11,0x48, a,b,c,const) /* c = a ^~ b */
 
#define M_CMPBGE(a, b, c, const)   M_OP3 (0x10,0x0f, a,b,c,const)
 
#define M_FCMPUN(a, b, c)   M_FOP3 (0x16, 0x0a4, a,b,c) /* unordered */
 
#define M_FCMPLE(a, b, c)   M_FOP3 (0x16, 0x0a7, a,b,c) /* c = a<=b */
 
#define M_FCMPUNS(a, b, c)   M_FOP3 (0x16, 0x5a4, a,b,c) /* unordered */
 
#define M_FCMPLES(a, b, c)   M_FOP3 (0x16, 0x5a7, a,b,c) /* c = a<=b */
 
#define M_FBNEZ(fa, disp)   M_BRA (0x35,fa,disp)
 
#define M_FBLEZ(fa, disp)   M_BRA (0x33,fa,disp)
 
#define M_JMP_CO(a, b)   M_MEM (0x1a,a,b,0xc000) /* call cosub */
 

Macro Definition Documentation

#define ALIGNCODENOP
Value:
if ((s4) ((ptrint) cd->mcodeptr & 7)) { \
}
#define M_NOP
Definition: codegen.hpp:304
int32_t s4
Definition: types.hpp:45
uintptr_t ptrint
Definition: types.hpp:54

Definition at line 56 of file codegen.hpp.

#define BRANCH_NOPS
Value:
do { \
} while (0)
#define M_NOP
Definition: codegen.hpp:304

Definition at line 68 of file codegen.hpp.

#define CONST   1

Definition at line 123 of file codegen.hpp.

#define gen_bound_check
Value:
if (checkbounds) { \
M_ILD(REG_ITMP3, s1, OFFSET(java_arrayheader, size));\
codegen_add_arrayindexoutofboundsexception_ref(cd, s2); \
}
#define M_BEQZ(a, disp)
Definition: codegen.hpp:252
JNIEnv jthread jobject jclass jlong size
Definition: jvmti.h:387
#define M_CMPULT(a, b, c)
Definition: codegen.hpp:285
bool checkbounds
Definition: options.cpp:89
int8_t s1
Definition: types.hpp:39
int16_t s2
Definition: types.hpp:42
#define REG_ITMP3
Definition: md-abi.hpp:48
#define M_ILD(a, b, disp)
Definition: codegen.hpp:183
#define OFFSET(s, el)
Definition: memory.hpp:90

Definition at line 38 of file codegen.hpp.

#define ICONST (   d,
 
)    emit_iconst(cd, (d), (c))

Definition at line 62 of file codegen.hpp.

#define LCONST (   d,
 
)    emit_lconst(cd, (d), (c))

Definition at line 63 of file codegen.hpp.

#define M_AADD_IMM (   a,
  b,
 
)    M_LADD_IMM(a,b,c)

Definition at line 277 of file codegen.hpp.

#define M_ALD (   a,
  b,
  disp 
)    M_LLD(a,b,disp) /* addr load */

Definition at line 208 of file codegen.hpp.

#define M_ALD_DSEG (   a,
  disp 
)    M_LLD(a,REG_PV,disp)

Definition at line 209 of file codegen.hpp.

#define M_ALD_INTERN (   a,
  b,
  disp 
)    M_LLD_INTERN(a,b,disp)

Definition at line 207 of file codegen.hpp.

#define M_AND (   a,
  b,
 
)    M_OP3 (0x11,0x00, a,b,c,0) /* c = a & b */

Definition at line 294 of file codegen.hpp.

#define M_AND_IMM (   a,
  b,
 
)    M_OP3 (0x11,0x00, a,b,c,1) /* c = a & b */

Definition at line 298 of file codegen.hpp.

#define M_ANDNOT (   a,
  b,
  c,
  const 
)    M_OP3 (0x11,0x08, a,b,c,const) /* c = a &~ b */

Definition at line 522 of file codegen.hpp.

#define M_AST (   a,
  b,
  disp 
)    M_LST(a,b,disp) /* addr store */

Definition at line 245 of file codegen.hpp.

#define M_ASUB_IMM (   a,
  b,
 
)    M_LSUB_IMM(a,b,c)

Definition at line 278 of file codegen.hpp.

#define M_BEQZ (   a,
  disp 
)    M_BRA (0x39,a,disp) /* br a == 0 */

Definition at line 252 of file codegen.hpp.

#define M_BGEZ (   a,
  disp 
)    M_BRA (0x3e,a,disp) /* br a >= 0 */

Definition at line 256 of file codegen.hpp.

#define M_BGTZ (   a,
  disp 
)    M_BRA (0x3f,a,disp) /* br a > 0 */

Definition at line 257 of file codegen.hpp.

#define M_BLDU (   a,
  b,
  disp 
)    M_MEM (0x0a,a,b,disp) /* 8 load */

Definition at line 177 of file codegen.hpp.

#define M_BLEZ (   a,
  disp 
)    M_BRA (0x3b,a,disp) /* br a <= 0 */

Definition at line 254 of file codegen.hpp.

#define M_BLTZ (   a,
  disp 
)    M_BRA (0x3a,a,disp) /* br a < 0 */

Definition at line 253 of file codegen.hpp.

#define M_BNEZ (   a,
  disp 
)    M_BRA (0x3d,a,disp) /* br a != 0 */

Definition at line 255 of file codegen.hpp.

#define M_BR (   disp)    M_BRA (0x30,REG_ZERO,disp) /* branch */

Definition at line 250 of file codegen.hpp.

#define M_BRA (   Opcode,
  Ra,
  Branch_disp 
)
Value:
do { \
*((uint32_t *) cd->mcodeptr) = ((((Opcode)) << 26) | ((Ra) << 21) | ((Branch_disp) & 0x1fffff)); \
cd->mcodeptr += 4; \
} while (0)

Definition at line 115 of file codegen.hpp.

#define M_BSEXT (   b,
 
)    M_OP3 (0x1c,0x0,REG_ZERO,b,c,0) /* 8 signext */

Definition at line 247 of file codegen.hpp.

#define M_BSR (   ra,
  disp 
)    M_BRA (0x34,ra,disp) /* branch sbr */

Definition at line 251 of file codegen.hpp.

#define M_BST (   a,
  b,
  disp 
)    M_MEM(0x0e,a,b,disp) /* 8 store */

Definition at line 211 of file codegen.hpp.

#define M_BZEXT (   a,
 
)    M_ZAPNOT_IMM(a, 0x01, b) /* 8 zeroext */

Definition at line 450 of file codegen.hpp.

#define M_CLR (   c)    M_OR (31,31,c) /* c = 0 */

Definition at line 303 of file codegen.hpp.

#define M_CMOVEQ (   a,
  b,
 
)    M_OP3 (0x11,0x24, a,b,c,0) /* a==0 ? c=b */

Definition at line 502 of file codegen.hpp.

#define M_CMOVEQ_IMM (   a,
  b,
 
)    M_OP3 (0x11,0x24, a,b,c,1) /* a==0 ? c=b */

Definition at line 509 of file codegen.hpp.

#define M_CMOVGE (   a,
  b,
 
)    M_OP3 (0x11,0x46, a,b,c,0) /* a>=0 ? c=b */

Definition at line 505 of file codegen.hpp.

#define M_CMOVGE_IMM (   a,
  b,
 
)    M_OP3 (0x11,0x46, a,b,c,1) /* a>=0 ? c=b */

Definition at line 512 of file codegen.hpp.

#define M_CMOVGT (   a,
  b,
 
)    M_OP3 (0x11,0x66, a,b,c,0) /* a> 0 ? c=b */

Definition at line 507 of file codegen.hpp.

#define M_CMOVGT_IMM (   a,
  b,
 
)    M_OP3 (0x11,0x66, a,b,c,1) /* a> 0 ? c=b */

Definition at line 514 of file codegen.hpp.

#define M_CMOVLE (   a,
  b,
 
)    M_OP3 (0x11,0x64, a,b,c,0) /* a<=0 ? c=b */

Definition at line 506 of file codegen.hpp.

#define M_CMOVLE_IMM (   a,
  b,
 
)    M_OP3 (0x11,0x64, a,b,c,1) /* a<=0 ? c=b */

Definition at line 513 of file codegen.hpp.

#define M_CMOVLT (   a,
  b,
 
)    M_OP3 (0x11,0x44, a,b,c,0) /* a< 0 ? c=b */

Definition at line 504 of file codegen.hpp.

#define M_CMOVLT_IMM (   a,
  b,
 
)    M_OP3 (0x11,0x44, a,b,c,1) /* a< 0 ? c=b */

Definition at line 511 of file codegen.hpp.

#define M_CMOVNE (   a,
  b,
 
)    M_OP3 (0x11,0x26, a,b,c,0) /* a!=0 ? c=b */

Definition at line 503 of file codegen.hpp.

#define M_CMOVNE_IMM (   a,
  b,
 
)    M_OP3 (0x11,0x26, a,b,c,1) /* a!=0 ? c=b */

Definition at line 510 of file codegen.hpp.

#define M_CMPBGE (   a,
  b,
  c,
  const 
)    M_OP3 (0x10,0x0f, a,b,c,const)

Definition at line 526 of file codegen.hpp.

#define M_CMPEQ (   a,
  b,
 
)    M_OP3 (0x10,0x2d, a,b,c,0) /* c = a == b */

Definition at line 280 of file codegen.hpp.

#define M_CMPEQ_IMM (   a,
  b,
 
)    M_OP3 (0x10,0x2d, a,b,c,1) /* c = a == b */

Definition at line 287 of file codegen.hpp.

#define M_CMPLE (   a,
  b,
 
)    M_OP3 (0x10,0x6d, a,b,c,0) /* c = a <= b */

Definition at line 282 of file codegen.hpp.

#define M_CMPLE_IMM (   a,
  b,
 
)    M_OP3 (0x10,0x6d, a,b,c,1) /* c = a <= b */

Definition at line 289 of file codegen.hpp.

#define M_CMPLT (   a,
  b,
 
)    M_OP3 (0x10,0x4d, a,b,c,0) /* c = a < b */

Definition at line 281 of file codegen.hpp.

#define M_CMPLT_IMM (   a,
  b,
 
)    M_OP3 (0x10,0x4d, a,b,c,1) /* c = a < b */

Definition at line 288 of file codegen.hpp.

#define M_CMPULE (   a,
  b,
 
)    M_OP3 (0x10,0x3d, a,b,c,0) /* c = a <= b */

Definition at line 284 of file codegen.hpp.

#define M_CMPULE_IMM (   a,
  b,
 
)    M_OP3 (0x10,0x3d, a,b,c,1) /* c = a <= b */

Definition at line 291 of file codegen.hpp.

#define M_CMPULT (   a,
  b,
 
)    M_OP3 (0x10,0x1d, a,b,c,0) /* c = a <= b */

Definition at line 285 of file codegen.hpp.

#define M_CMPULT_IMM (   a,
  b,
 
)    M_OP3 (0x10,0x1d, a,b,c,1) /* c = a <= b */

Definition at line 292 of file codegen.hpp.

#define M_CVTDF (   b,
 
)    M_FOP3 (0x16, 0x0ac, 31,b,c) /* dbl2flt */

Definition at line 391 of file codegen.hpp.

#define M_CVTDFS (   b,
 
)    M_FOP3 (0x16, 0x5ac, 31,b,c) /* dbl2flt */

Definition at line 398 of file codegen.hpp.

#define M_CVTDL (   b,
 
)    M_FOP3 (0x16, 0x1af, 31,b,c) /* dbl2long */

Definition at line 394 of file codegen.hpp.

#define M_CVTDL_C (   b,
 
)    M_FOP3 (0x16, 0x12f, 31,b,c) /* dbl2long */

Definition at line 395 of file codegen.hpp.

#define M_CVTDL_CS (   b,
 
)    M_FOP3 (0x16, 0x52f, 31,b,c) /* dbl2long */

Definition at line 401 of file codegen.hpp.

#define M_CVTDLS (   b,
 
)    M_FOP3 (0x16, 0x5af, 31,b,c) /* dbl2long */

Definition at line 400 of file codegen.hpp.

#define M_CVTFDS (   b,
 
)    M_FOP3 (0x16, 0x6ac, 31,b,c) /* flt2dbl */

Definition at line 399 of file codegen.hpp.

#define M_CVTLD (   b,
 
)    M_FOP3 (0x16, 0x0be, 31,b,c) /* long2dbl */

Definition at line 393 of file codegen.hpp.

#define M_CVTLF (   b,
 
)    M_FOP3 (0x16, 0x0bc, 31,b,c) /* long2flt */

Definition at line 392 of file codegen.hpp.

#define M_CVTLI (   b,
 
)    M_FOP3 (0x17, 0x130, 31,b,c) /* long2int */

Definition at line 396 of file codegen.hpp.

#define M_CVTLIS (   b,
 
)    M_FOP3 (0x17, 0x530, 31,b,c) /* long2int */

Definition at line 402 of file codegen.hpp.

#define M_CZEXT (   a,
 
)    M_ZAPNOT_IMM(a, 0x03, b) /* 16 zeroext */

Definition at line 451 of file codegen.hpp.

#define M_DADD (   a,
  b,
 
)    M_FOP3 (0x16, 0x0a0, a,b,c) /* dbl add */

Definition at line 374 of file codegen.hpp.

#define M_DADDS (   a,
  b,
 
)    M_FOP3 (0x16, 0x5a0, a,b,c) /* dbl add */

Definition at line 383 of file codegen.hpp.

#define M_DDIV (   a,
  b,
 
)    M_FOP3 (0x16, 0x0a3, a,b,c) /* dbl div */

Definition at line 380 of file codegen.hpp.

#define M_DDIVS (   a,
  b,
 
)    M_FOP3 (0x16, 0x5a3, a,b,c) /* dbl div */

Definition at line 389 of file codegen.hpp.

#define M_DLD (   a,
  b,
  disp 
)
Value:
do { \
s4 lo = (short) (disp); \
s4 hi = (short) (((disp) - lo) >> 16); \
if (hi == 0) { \
M_DLD_INTERN(a,b,lo); \
} else { \
} \
} while (0)
int32_t s4
Definition: types.hpp:45
#define M_DLD_INTERN(a, b, disp)
Definition: codegen.hpp:315
#define REG_ITMP3
Definition: md-abi.hpp:48
#define M_LDAH(a, b, disp)
Definition: codegen.hpp:175

Definition at line 329 of file codegen.hpp.

#define M_DLD_INTERN (   a,
  b,
  disp 
)    M_MEM(0x23,a,b,disp) /* load dbl */

Definition at line 315 of file codegen.hpp.

#define M_DMOV (   fa,
  fb 
)    M_FMOV (fa,fb)

Definition at line 411 of file codegen.hpp.

#define M_DMUL (   a,
  b,
 
)    M_FOP3 (0x16, 0x0a2, a,b,c) /* dbl mul */

Definition at line 378 of file codegen.hpp.

#define M_DMULS (   a,
  b,
 
)    M_FOP3 (0x16, 0x5a2, a,b,c) /* dbl mul */

Definition at line 387 of file codegen.hpp.

#define M_DST (   a,
  b,
  disp 
)
Value:
do { \
s4 lo = (short) (disp); \
s4 hi = (short) (((disp) - lo) >> 16); \
if (hi == 0) { \
M_DST_INTERN(a,b,lo); \
} else { \
} \
} while (0)
int32_t s4
Definition: types.hpp:45
#define REG_ITMP3
Definition: md-abi.hpp:48
#define M_LDAH(a, b, disp)
Definition: codegen.hpp:175
#define M_DST_INTERN(a, b, disp)
Definition: codegen.hpp:342

Definition at line 360 of file codegen.hpp.

#define M_DST_INTERN (   a,
  b,
  disp 
)    M_MEM(0x27,a,b,disp) /* store dbl */

Definition at line 342 of file codegen.hpp.

#define M_DSUB (   a,
  b,
 
)    M_FOP3 (0x16, 0x0a1, a,b,c) /* dbl sub */

Definition at line 376 of file codegen.hpp.

#define M_DSUBS (   a,
  b,
 
)    M_FOP3 (0x16, 0x5a1, a,b,c) /* dbl sub */

Definition at line 385 of file codegen.hpp.

#define M_EXTBL (   a,
  b,
 
)    M_OP3 (0x12,0x06, a,b,c,0)

Definition at line 454 of file codegen.hpp.

#define M_EXTBL_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x06, a,b,c,1)

Definition at line 476 of file codegen.hpp.

#define M_EXTLH (   a,
  b,
 
)    M_OP3 (0x12,0x6a, a,b,c,0)

Definition at line 459 of file codegen.hpp.

#define M_EXTLH_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x6a, a,b,c,1)

Definition at line 481 of file codegen.hpp.

#define M_EXTLL (   a,
  b,
 
)    M_OP3 (0x12,0x26, a,b,c,0)

Definition at line 456 of file codegen.hpp.

#define M_EXTLL_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x26, a,b,c,1)

Definition at line 478 of file codegen.hpp.

#define M_EXTQH (   a,
  b,
 
)    M_OP3 (0x12,0x7a, a,b,c,0)

Definition at line 460 of file codegen.hpp.

#define M_EXTQH_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x7a, a,b,c,1)

Definition at line 482 of file codegen.hpp.

#define M_EXTQL (   a,
  b,
 
)    M_OP3 (0x12,0x36, a,b,c,0)

Definition at line 457 of file codegen.hpp.

#define M_EXTQL_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x36, a,b,c,1)

Definition at line 479 of file codegen.hpp.

#define M_EXTWH (   a,
  b,
 
)    M_OP3 (0x12,0x5a, a,b,c,0)

Definition at line 458 of file codegen.hpp.

#define M_EXTWH_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x5a, a,b,c,1)

Definition at line 480 of file codegen.hpp.

#define M_EXTWL (   a,
  b,
 
)    M_OP3 (0x12,0x16, a,b,c,0)

Definition at line 455 of file codegen.hpp.

#define M_EXTWL_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x16, a,b,c,1)

Definition at line 477 of file codegen.hpp.

#define M_FADD (   a,
  b,
 
)    M_FOP3 (0x16, 0x080, a,b,c) /* flt add */

Definition at line 373 of file codegen.hpp.

#define M_FADDS (   a,
  b,
 
)    M_FOP3 (0x16, 0x580, a,b,c) /* flt add */

Definition at line 382 of file codegen.hpp.

#define M_FBEQZ (   fa,
  disp 
)    M_BRA (0x31,fa,disp) /* br a == 0.0*/

Definition at line 416 of file codegen.hpp.

#define M_FBLEZ (   fa,
  disp 
)    M_BRA (0x33,fa,disp)

Definition at line 535 of file codegen.hpp.

#define M_FBNEZ (   fa,
  disp 
)    M_BRA (0x35,fa,disp)

Definition at line 534 of file codegen.hpp.

#define M_FCMPEQ (   a,
  b,
 
)    M_FOP3 (0x16, 0x0a5, a,b,c) /* c = a==b */

Definition at line 404 of file codegen.hpp.

#define M_FCMPEQS (   a,
  b,
 
)    M_FOP3 (0x16, 0x5a5, a,b,c) /* c = a==b */

Definition at line 407 of file codegen.hpp.

#define M_FCMPLE (   a,
  b,
 
)    M_FOP3 (0x16, 0x0a7, a,b,c) /* c = a<=b */

Definition at line 529 of file codegen.hpp.

#define M_FCMPLES (   a,
  b,
 
)    M_FOP3 (0x16, 0x5a7, a,b,c) /* c = a<=b */

Definition at line 532 of file codegen.hpp.

#define M_FCMPLT (   a,
  b,
 
)    M_FOP3 (0x16, 0x0a6, a,b,c) /* c = a<b */

Definition at line 405 of file codegen.hpp.

#define M_FCMPLTS (   a,
  b,
 
)    M_FOP3 (0x16, 0x5a6, a,b,c) /* c = a<b */

Definition at line 408 of file codegen.hpp.

#define M_FCMPUN (   a,
  b,
 
)    M_FOP3 (0x16, 0x0a4, a,b,c) /* unordered */

Definition at line 528 of file codegen.hpp.

#define M_FCMPUNS (   a,
  b,
 
)    M_FOP3 (0x16, 0x5a4, a,b,c) /* unordered */

Definition at line 531 of file codegen.hpp.

#define M_FDIV (   a,
  b,
 
)    M_FOP3 (0x16, 0x083, a,b,c) /* flt div */

Definition at line 379 of file codegen.hpp.

#define M_FDIVS (   a,
  b,
 
)    M_FOP3 (0x16, 0x583, a,b,c) /* flt div */

Definition at line 388 of file codegen.hpp.

#define M_FLD (   a,
  b,
  disp 
)
Value:
do { \
s4 lo = (short) (disp); \
s4 hi = (short) (((disp) - lo) >> 16); \
if (hi == 0) { \
M_FLD_INTERN(a,b,lo); \
} else { \
} \
} while (0)
#define M_FLD_INTERN(a, b, disp)
Definition: codegen.hpp:314
int32_t s4
Definition: types.hpp:45
#define REG_ITMP3
Definition: md-abi.hpp:48
#define M_LDAH(a, b, disp)
Definition: codegen.hpp:175

Definition at line 317 of file codegen.hpp.

#define M_FLD_INTERN (   a,
  b,
  disp 
)    M_MEM(0x22,a,b,disp) /* load flt */

Definition at line 314 of file codegen.hpp.

#define M_FMOV (   fa,
  fb 
)    M_FOP3 (0x17, 0x020, fa,fa,fb) /* b = a */

Definition at line 410 of file codegen.hpp.

#define M_FMOVN (   fa,
  fb 
)    M_FOP3 (0x17, 0x021, fa,fa,fb) /* b = -a */

Definition at line 412 of file codegen.hpp.

#define M_FMUL (   a,
  b,
 
)    M_FOP3 (0x16, 0x082, a,b,c) /* flt mul */

Definition at line 377 of file codegen.hpp.

#define M_FMULS (   a,
  b,
 
)    M_FOP3 (0x16, 0x582, a,b,c) /* flt mul */

Definition at line 386 of file codegen.hpp.

#define M_FNOP   M_FMOV (31,31)

Definition at line 414 of file codegen.hpp.

#define M_FOP3 (   op,
  fu,
  a,
  b,
 
)
Value:
do { \
*((u4 *) cd->mcodeptr) = ((((s4) (op)) << 26) | ((a) << 21) | ((b) << 16) | ((fu) << 5) | (c)); \
cd->mcodeptr += 4; \
} while (0)
u2 op
Definition: disass.cpp:129
int32_t s4
Definition: types.hpp:45
uint32_t u4
Definition: types.hpp:46

Definition at line 152 of file codegen.hpp.

#define M_FST (   a,
  b,
  disp 
)
Value:
do { \
s4 lo = (short) (disp); \
s4 hi = (short) (((disp) - lo) >> 16); \
if (hi == 0) { \
M_FST_INTERN(a,b,lo); \
} else { \
} \
} while (0)
int32_t s4
Definition: types.hpp:45
#define M_FST_INTERN(a, b, disp)
Definition: codegen.hpp:341
#define REG_ITMP3
Definition: md-abi.hpp:48
#define M_LDAH(a, b, disp)
Definition: codegen.hpp:175

Definition at line 348 of file codegen.hpp.

#define M_FST_INTERN (   a,
  b,
  disp 
)    M_MEM(0x26,a,b,disp) /* store flt */

Definition at line 341 of file codegen.hpp.

#define M_FSUB (   a,
  b,
 
)    M_FOP3 (0x16, 0x081, a,b,c) /* flt sub */

Definition at line 375 of file codegen.hpp.

#define M_FSUBS (   a,
  b,
 
)    M_FOP3 (0x16, 0x581, a,b,c) /* flt sub */

Definition at line 384 of file codegen.hpp.

#define M_IADD (   a,
  b,
 
)    M_OP3 (0x10,0x0, a,b,c,0) /* 32 add */

Definition at line 263 of file codegen.hpp.

#define M_IADD_IMM (   a,
  b,
 
)    M_OP3 (0x10,0x0, a,b,c,1) /* 32 add */

Definition at line 270 of file codegen.hpp.

#define M_ILD (   a,
  b,
  disp 
)
Value:
do { \
s4 lo = (short) (disp); \
s4 hi = (short) (((disp) - lo) >> 16); \
if (hi == 0) { \
M_ILD_INTERN(a,b,lo); \
} else { \
M_LDAH(a,b,hi); \
M_ILD_INTERN(a,a,lo); \
} \
} while (0)
int32_t s4
Definition: types.hpp:45
#define M_LDAH(a, b, disp)
Definition: codegen.hpp:175
#define M_ILD_INTERN(a, b, disp)
Definition: codegen.hpp:180

Definition at line 183 of file codegen.hpp.

#define M_ILD_INTERN (   a,
  b,
  disp 
)    M_MEM(0x28,a,b,disp) /* 32 load */

Definition at line 180 of file codegen.hpp.

#define M_IMUL (   a,
  b,
 
)    M_OP3 (0x13,0x00, a,b,c,0) /* 32 mul */

Definition at line 267 of file codegen.hpp.

#define M_IMUL_IMM (   a,
  b,
 
)    M_OP3 (0x13,0x00, a,b,c,1) /* 32 mul */

Definition at line 274 of file codegen.hpp.

#define M_INSBL (   a,
  b,
 
)    M_OP3 (0x12,0x0b, a,b,c,0)

Definition at line 461 of file codegen.hpp.

#define M_INSBL_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x0b, a,b,c,1)

Definition at line 483 of file codegen.hpp.

#define M_INSLH (   a,
  b,
 
)    M_OP3 (0x12,0x67, a,b,c,0)

Definition at line 466 of file codegen.hpp.

#define M_INSLH_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x67, a,b,c,1)

Definition at line 488 of file codegen.hpp.

#define M_INSLL (   a,
  b,
 
)    M_OP3 (0x12,0x2b, a,b,c,0)

Definition at line 463 of file codegen.hpp.

#define M_INSLL_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x2b, a,b,c,1)

Definition at line 485 of file codegen.hpp.

#define M_INSQH (   a,
  b,
 
)    M_OP3 (0x12,0x77, a,b,c,0)

Definition at line 467 of file codegen.hpp.

#define M_INSQH_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x77, a,b,c,1)

Definition at line 489 of file codegen.hpp.

#define M_INSQL (   a,
  b,
 
)    M_OP3 (0x12,0x3b, a,b,c,0)

Definition at line 464 of file codegen.hpp.

#define M_INSQL_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x3b, a,b,c,1)

Definition at line 486 of file codegen.hpp.

#define M_INSWH (   a,
  b,
 
)    M_OP3 (0x12,0x57, a,b,c,0)

Definition at line 465 of file codegen.hpp.

#define M_INSWH_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x57, a,b,c,1)

Definition at line 487 of file codegen.hpp.

#define M_INSWL (   a,
  b,
 
)    M_OP3 (0x12,0x1b, a,b,c,0)

Definition at line 462 of file codegen.hpp.

#define M_INSWL_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x1b, a,b,c,1)

Definition at line 484 of file codegen.hpp.

#define M_IST (   a,
  b,
  disp 
)
Value:
do { \
s4 lo = (short) (disp); \
s4 hi = (short) (((disp) - lo) >> 16); \
if (hi == 0) { \
M_IST_INTERN(a,b,lo); \
} else { \
} \
} while (0)
#define M_IST_INTERN(a, b, disp)
Definition: codegen.hpp:214
int32_t s4
Definition: types.hpp:45
#define REG_ITMP3
Definition: md-abi.hpp:48
#define M_LDAH(a, b, disp)
Definition: codegen.hpp:175

Definition at line 221 of file codegen.hpp.

#define M_IST_INTERN (   a,
  b,
  disp 
)    M_MEM(0x2c,a,b,disp) /* 32 store */

Definition at line 214 of file codegen.hpp.

#define M_ISUB (   a,
  b,
 
)    M_OP3 (0x10,0x09, a,b,c,0) /* 32 sub */

Definition at line 265 of file codegen.hpp.

#define M_ISUB_IMM (   a,
  b,
 
)    M_OP3 (0x10,0x09, a,b,c,1) /* 32 sub */

Definition at line 272 of file codegen.hpp.

#define M_IZEXT (   a,
 
)    M_ZAPNOT_IMM(a, 0x0f, b) /* 32 zeroext */

Definition at line 452 of file codegen.hpp.

#define M_JMP (   a,
 
)    M_MEM (0x1a,a,b,0x0000) /* jump */

Definition at line 259 of file codegen.hpp.

#define M_JMP_CO (   a,
 
)    M_MEM (0x1a,a,b,0xc000) /* call cosub */

Definition at line 537 of file codegen.hpp.

#define M_JSR (   a,
 
)    M_MEM (0x1a,a,b,0x4000) /* call sbr */

Definition at line 260 of file codegen.hpp.

#define M_LADD (   a,
  b,
 
)    M_OP3 (0x10,0x20, a,b,c,0) /* 64 add */

Definition at line 264 of file codegen.hpp.

#define M_LADD_IMM (   a,
  b,
 
)    M_OP3 (0x10,0x20, a,b,c,1) /* 64 add */

Definition at line 271 of file codegen.hpp.

#define M_LDA (   a,
  b,
  disp 
)
Value:
do { \
s4 lo = (short) (disp); \
s4 hi = (short) (((disp) - lo) >> 16); \
if (hi == 0) { \
M_LDA_INTERN(a,b,lo); \
} else { \
M_LDAH(a,b,hi); \
M_LDA_INTERN(a,a,lo); \
} \
} while (0)
int32_t s4
Definition: types.hpp:45
#define M_LDA_INTERN(a, b, disp)
Definition: codegen.hpp:161
#define M_LDAH(a, b, disp)
Definition: codegen.hpp:175

Definition at line 163 of file codegen.hpp.

#define M_LDA_INTERN (   a,
  b,
  disp 
)    M_MEM(0x08,a,b,disp) /* low const */

Definition at line 161 of file codegen.hpp.

#define M_LDAH (   a,
  b,
  disp 
)    M_MEM (0x09,a,b,disp) /* high const */

Definition at line 175 of file codegen.hpp.

#define M_LLD (   a,
  b,
  disp 
)
Value:
do { \
s4 lo = (short) (disp); \
s4 hi = (short) (((disp) - lo) >> 16); \
if (hi == 0) { \
M_LLD_INTERN(a,b,lo); \
} else { \
M_LDAH(a,b,hi); \
M_LLD_INTERN(a,a,lo); \
} \
} while (0)
int32_t s4
Definition: types.hpp:45
#define M_LLD_INTERN(a, b, disp)
Definition: codegen.hpp:181
#define M_LDAH(a, b, disp)
Definition: codegen.hpp:175

Definition at line 195 of file codegen.hpp.

#define M_LLD_INTERN (   a,
  b,
  disp 
)    M_MEM(0x29,a,b,disp) /* 64 load */

Definition at line 181 of file codegen.hpp.

#define M_LLD_U (   a,
  b,
  disp 
)    M_MEM (0x0b,a,b,disp) /* unalign ld */

Definition at line 441 of file codegen.hpp.

#define M_LMUL (   a,
  b,
 
)    M_OP3 (0x13,0x20, a,b,c,0) /* 64 mul */

Definition at line 268 of file codegen.hpp.

#define M_LMUL_IMM (   a,
  b,
 
)    M_OP3 (0x13,0x20, a,b,c,1) /* 64 mul */

Definition at line 275 of file codegen.hpp.

#define M_LST (   a,
  b,
  disp 
)
Value:
do { \
s4 lo = (short) (disp); \
s4 hi = (short) (((disp) - lo) >> 16); \
if (hi == 0) { \
M_LST_INTERN(a,b,lo); \
} else { \
} \
} while (0)
#define M_LST_INTERN(a, b, disp)
Definition: codegen.hpp:215
int32_t s4
Definition: types.hpp:45
#define REG_ITMP3
Definition: md-abi.hpp:48
#define M_LDAH(a, b, disp)
Definition: codegen.hpp:175

Definition at line 233 of file codegen.hpp.

#define M_LST_INTERN (   a,
  b,
  disp 
)    M_MEM(0x2d,a,b,disp) /* 64 store */

Definition at line 215 of file codegen.hpp.

#define M_LST_U (   a,
  b,
  disp 
)    M_MEM (0x0f,a,b,disp) /* unalign st */

Definition at line 442 of file codegen.hpp.

#define M_LSUB (   a,
  b,
 
)    M_OP3 (0x10,0x29, a,b,c,0) /* 64 sub */

Definition at line 266 of file codegen.hpp.

#define M_LSUB_IMM (   a,
  b,
 
)    M_OP3 (0x10,0x29, a,b,c,1) /* 64 sub */

Definition at line 273 of file codegen.hpp.

#define M_MEM (   Opcode,
  Ra,
  Rb,
  Memory_disp 
)
Value:
do { \
*((uint32_t *) cd->mcodeptr) = ((((Opcode)) << 26) | ((Ra) << 21) | ((Rb) << 16) | ((Memory_disp) & 0xffff)); \
cd->mcodeptr += 4; \
} while (0)

Definition at line 95 of file codegen.hpp.

#define M_MEM_GET_Memory_disp (   x)    ((int16_t) ( (x) & 0xffff))

Definition at line 104 of file codegen.hpp.

#define M_MEM_GET_Opcode (   x)    ( (((x) >> 26) & 0x3f ))

Definition at line 101 of file codegen.hpp.

#define M_MEM_GET_Ra (   x)    ( (((x) >> 21) & 0x1f ))

Definition at line 102 of file codegen.hpp.

#define M_MEM_GET_Rb (   x)    ( (((x) >> 16) & 0x1f ))

Definition at line 103 of file codegen.hpp.

#define M_MOV (   a,
 
)    M_OR (a,a,c) /* c = a */

Definition at line 302 of file codegen.hpp.

#define M_MSKBL (   a,
  b,
 
)    M_OP3 (0x12,0x02, a,b,c,0)

Definition at line 468 of file codegen.hpp.

#define M_MSKBL_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x02, a,b,c,1)

Definition at line 490 of file codegen.hpp.

#define M_MSKLH (   a,
  b,
 
)    M_OP3 (0x12,0x62, a,b,c,0)

Definition at line 473 of file codegen.hpp.

#define M_MSKLH_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x62, a,b,c,1)

Definition at line 495 of file codegen.hpp.

#define M_MSKLL (   a,
  b,
 
)    M_OP3 (0x12,0x22, a,b,c,0)

Definition at line 470 of file codegen.hpp.

#define M_MSKLL_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x22, a,b,c,1)

Definition at line 492 of file codegen.hpp.

#define M_MSKQH (   a,
  b,
 
)    M_OP3 (0x12,0x72, a,b,c,0)

Definition at line 474 of file codegen.hpp.

#define M_MSKQH_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x72, a,b,c,1)

Definition at line 496 of file codegen.hpp.

#define M_MSKQL (   a,
  b,
 
)    M_OP3 (0x12,0x32, a,b,c,0)

Definition at line 471 of file codegen.hpp.

#define M_MSKQL_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x32, a,b,c,1)

Definition at line 493 of file codegen.hpp.

#define M_MSKWH (   a,
  b,
 
)    M_OP3 (0x12,0x52, a,b,c,0)

Definition at line 472 of file codegen.hpp.

#define M_MSKWH_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x52, a,b,c,1)

Definition at line 494 of file codegen.hpp.

#define M_MSKWL (   a,
  b,
 
)    M_OP3 (0x12,0x12, a,b,c,0)

Definition at line 469 of file codegen.hpp.

#define M_MSKWL_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x12, a,b,c,1)

Definition at line 491 of file codegen.hpp.

#define M_NOP   M_OR (31,31,31) /* ; */

Definition at line 304 of file codegen.hpp.

#define M_OP3 (   op,
  fu,
  a,
  b,
  c,
  const 
)
Value:
do { \
*((u4 *) cd->mcodeptr) = ((((s4) (op)) << 26) | ((a) << 21) | ((b) << (16 - 3 * (const))) | ((const) << 12) | ((fu) << 5) | ((c))); \
cd->mcodeptr += 4; \
} while (0)
u2 op
Definition: disass.cpp:129
int32_t s4
Definition: types.hpp:45
uint32_t u4
Definition: types.hpp:46

Definition at line 136 of file codegen.hpp.

#define M_OP3_GET_Opcode (   x)    ( (((x) >> 26) & 0x3f ))

Definition at line 142 of file codegen.hpp.

#define M_OR (   a,
  b,
 
)    M_OP3 (0x11,0x20, a,b,c,0) /* c = a | b */

Definition at line 295 of file codegen.hpp.

#define M_OR_IMM (   a,
  b,
 
)    M_OP3 (0x11,0x20, a,b,c,1) /* c = a | b */

Definition at line 299 of file codegen.hpp.

#define M_ORNOT (   a,
  b,
  c,
  const 
)    M_OP3 (0x11,0x28, a,b,c,const) /* c = a |~ b */

Definition at line 523 of file codegen.hpp.

#define M_RET (   a,
 
)    M_MEM (0x1a,a,b,0x8000) /* return */

Definition at line 261 of file codegen.hpp.

#define M_S4ADDL (   a,
  b,
 
)    M_OP3 (0x10,0x02, a,b,c,0) /* c = a*4 + b */

Definition at line 422 of file codegen.hpp.

#define M_S4ADDL_IMM (   a,
  b,
 
)    M_OP3 (0x10,0x02, a,b,c,1) /* c = a*4 + b */

Definition at line 432 of file codegen.hpp.

#define M_S4ADDQ (   a,
  b,
 
)    M_OP3 (0x10,0x22, a,b,c,0) /* c = a*4 + b */

Definition at line 423 of file codegen.hpp.

#define M_S4ADDQ_IMM (   a,
  b,
 
)    M_OP3 (0x10,0x22, a,b,c,1) /* c = a*4 + b */

Definition at line 433 of file codegen.hpp.

#define M_S4SUBL (   a,
  b,
 
)    M_OP3 (0x10,0x0b, a,b,c,0) /* c = a*4 - b */

Definition at line 424 of file codegen.hpp.

#define M_S4SUBL_IMM (   a,
  b,
 
)    M_OP3 (0x10,0x0b, a,b,c,1) /* c = a*4 - b */

Definition at line 434 of file codegen.hpp.

#define M_S4SUBQ (   a,
  b,
 
)    M_OP3 (0x10,0x2b, a,b,c,0) /* c = a*4 - b */

Definition at line 425 of file codegen.hpp.

#define M_S4SUBQ_IMM (   a,
  b,
 
)    M_OP3 (0x10,0x2b, a,b,c,1) /* c = a*4 - b */

Definition at line 435 of file codegen.hpp.

#define M_S8ADDL (   a,
  b,
 
)    M_OP3 (0x10,0x12, a,b,c,0) /* c = a*8 + b */

Definition at line 426 of file codegen.hpp.

#define M_S8ADDL_IMM (   a,
  b,
 
)    M_OP3 (0x10,0x12, a,b,c,1) /* c = a*8 + b */

Definition at line 436 of file codegen.hpp.

#define M_S8ADDQ (   a,
  b,
 
)    M_OP3 (0x10,0x32, a,b,c,0) /* c = a*8 + b */

Definition at line 427 of file codegen.hpp.

#define M_S8ADDQ_IMM (   a,
  b,
 
)    M_OP3 (0x10,0x32, a,b,c,1) /* c = a*8 + b */

Definition at line 437 of file codegen.hpp.

#define M_S8SUBL (   a,
  b,
 
)    M_OP3 (0x10,0x1b, a,b,c,0) /* c = a*8 - b */

Definition at line 428 of file codegen.hpp.

#define M_S8SUBL_IMM (   a,
  b,
 
)    M_OP3 (0x10,0x1b, a,b,c,1) /* c = a*8 - b */

Definition at line 438 of file codegen.hpp.

#define M_S8SUBQ (   a,
  b,
 
)    M_OP3 (0x10,0x3b, a,b,c,0) /* c = a*8 - b */

Definition at line 429 of file codegen.hpp.

#define M_S8SUBQ_IMM (   a,
  b,
 
)    M_OP3 (0x10,0x3b, a,b,c,1) /* c = a*8 - b */

Definition at line 439 of file codegen.hpp.

#define M_SAADDQ (   a,
  b,
 
)    M_S8ADDQ(a,b,c) /* c = a*8 + b */

Definition at line 430 of file codegen.hpp.

#define M_SLDU (   a,
  b,
  disp 
)    M_MEM (0x0c,a,b,disp) /* 16 load */

Definition at line 178 of file codegen.hpp.

#define M_SLL (   a,
  b,
 
)    M_OP3 (0x12,0x39, a,b,c,0) /* c = a << b */

Definition at line 306 of file codegen.hpp.

#define M_SLL_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x39, a,b,c,1) /* c = a << b */

Definition at line 310 of file codegen.hpp.

#define M_SRA (   a,
  b,
 
)    M_OP3 (0x12,0x3c, a,b,c,0) /* c = a >> b */

Definition at line 307 of file codegen.hpp.

#define M_SRA_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x3c, a,b,c,1) /* c = a >> b */

Definition at line 311 of file codegen.hpp.

#define M_SRL (   a,
  b,
 
)    M_OP3 (0x12,0x34, a,b,c,0) /* c = a >>>b */

Definition at line 308 of file codegen.hpp.

#define M_SRL_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x34, a,b,c,1) /* c = a >>>b */

Definition at line 312 of file codegen.hpp.

#define M_SSEXT (   b,
 
)    M_OP3 (0x1c,0x1,REG_ZERO,b,c,0) /* 16 signext */

Definition at line 248 of file codegen.hpp.

#define M_SST (   a,
  b,
  disp 
)    M_MEM(0x0d,a,b,disp) /* 16 store */

Definition at line 212 of file codegen.hpp.

#define M_TRAPB   M_MEM (0x18,0,0,0x0000) /* trap barrier*/

Definition at line 420 of file codegen.hpp.

#define M_UMULH (   a,
  b,
 
)    M_OP3 (0x13,0x30, a,b,c,0) /* 64 umulh */

Definition at line 498 of file codegen.hpp.

#define M_UMULH_IMM (   a,
  b,
 
)    M_OP3 (0x13,0x30, a,b,c,1) /* 64 umulh */

Definition at line 500 of file codegen.hpp.

#define M_UNDEFINED   M_OP3(0x04, 0, 0, 0, 0, 0)

Definition at line 518 of file codegen.hpp.

#define M_XOR (   a,
  b,
 
)    M_OP3 (0x11,0x40, a,b,c,0) /* c = a ^ b */

Definition at line 296 of file codegen.hpp.

#define M_XOR_IMM (   a,
  b,
 
)    M_OP3 (0x11,0x40, a,b,c,1) /* c = a ^ b */

Definition at line 300 of file codegen.hpp.

#define M_XORNOT (   a,
  b,
  c,
  const 
)    M_OP3 (0x11,0x48, a,b,c,const) /* c = a ^~ b */

Definition at line 524 of file codegen.hpp.

#define M_ZAP (   a,
  b,
 
)    M_OP3 (0x12,0x30, a,b,c,0)

Definition at line 444 of file codegen.hpp.

#define M_ZAP_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x30, a,b,c,1)

Definition at line 447 of file codegen.hpp.

#define M_ZAPNOT (   a,
  b,
 
)    M_OP3 (0x12,0x31, a,b,c,0)

Definition at line 445 of file codegen.hpp.

#define M_ZAPNOT_IMM (   a,
  b,
 
)    M_OP3 (0x12,0x31, a,b,c,1)

Definition at line 448 of file codegen.hpp.

#define MCODECHECK (   icnt)
Value:
do { \
if ((cd->mcodeptr + (icnt) * 4) > cd->mcodeend) \
} while (0)
void codegen_increase(codegendata *cd)

Definition at line 49 of file codegen.hpp.

#define PATCHER_CALL_SIZE   1 * 4 /* an instruction is 4-bytes long */

Definition at line 76 of file codegen.hpp.

#define PATCHER_NOPS
Value:
do { \
} while (0)
#define M_NOP
Definition: codegen.hpp:304

Definition at line 78 of file codegen.hpp.

#define REG   0

Definition at line 122 of file codegen.hpp.