CACAO
Macros
codegen.hpp File Reference

Go to the source code of this file.

Macros

#define MCODECHECK(icnt)
 
#define ALIGNCODENOP
 
#define ICONST(r, c)   emit_iconst(cd, (r), (c))
 
#define LCONST(r, c)   emit_lconst(cd, (r), (c))
 
#define BRANCH_NOPS
 
#define PATCHER_CALL_INSTRUCTIONS   1 /* number of instructions */
 
#define PATCHER_CALL_SIZE   1 * 4 /* size in bytes of a patcher call */
 
#define PATCHER_NOPS
 
#define M_ITYPE(op, rs, rt, imm)
 
#define M_ITYPE_GET_RS(x)   (((x) >> 21) & 0x1f )
 
#define M_ITYPE_GET_RT(x)   (((x) >> 16) & 0x1f )
 
#define M_ITYPE_GET_IMM(x)   ( (x) & 0xffff)
 
#define M_JTYPE(op, imm)
 
#define M_RTYPE(op, rs, rt, rd, sa, fu)
 
#define M_FP2(fu, fmt, fs, fd)   M_RTYPE(0x11, fmt, 0, fs, fd, fu)
 
#define M_FP3(fu, fmt, fs, ft, fd)   M_RTYPE(0x11, fmt, ft, fs, fd, fu)
 
#define FMT_F   16
 
#define FMT_D   17
 
#define FMT_I   20
 
#define FMT_L   21
 
#define M_RESERVED   M_RTYPE(0x3b, 0, 0, 0, 0, 0)
 
#define M_LDA(a, b, disp)
 
#define M_BLDS(a, b, disp)   M_ITYPE(0x20,b,a,disp) /* 8 load */
 
#define M_BLDU(a, b, disp)   M_ITYPE(0x24,b,a,disp) /* 8 load */
 
#define M_SLDS(a, b, disp)   M_ITYPE(0x21,b,a,disp) /* 16 load */
 
#define M_SLDU(a, b, disp)   M_ITYPE(0x25,b,a,disp) /* 16 load */
 
#define M_ILD_INTERN(a, b, disp)   M_ITYPE(0x23,b,a,disp) /* 32 load */
 
#define M_ILD(a, b, disp)
 
#define M_LLD_INTERN(a, b, disp)   M_ITYPE(0x37,b,a,disp) /* 64 load */
 
#define M_LLD(a, b, disp)
 
#define M_BST(a, b, disp)   M_ITYPE(0x28,b,a,disp) /* 8 store */
 
#define M_SST(a, b, disp)   M_ITYPE(0x29,b,a,disp) /* 16 store */
 
#define M_IST_INTERN(a, b, disp)   M_ITYPE(0x2b,b,a,disp) /* 32 store */
 
#define M_IST(a, b, disp)
 
#define M_LST_INTERN(a, b, disp)   M_ITYPE(0x3f,b,a,disp) /* 64 store */
 
#define M_LST(a, b, disp)
 
#define M_FLD_INTERN(a, b, disp)   M_ITYPE(0x31,b,a,disp) /* load flt */
 
#define M_DLD_INTERN(a, b, disp)   M_ITYPE(0x35,b,a,disp) /* load dbl */
 
#define M_FLD(a, b, disp)
 
#define M_DLD(a, b, disp)
 
#define M_FST_INTERN(a, b, disp)   M_ITYPE(0x39,b,a,disp) /* store flt */
 
#define M_DST_INTERN(a, b, disp)   M_ITYPE(0x3d,b,a,disp) /* store dbl */
 
#define M_FST(a, b, disp)
 
#define M_DST(a, b, disp)
 
#define M_BEQ(a, b, disp)   M_ITYPE(0x04,a,b,disp) /* br a == b */
 
#define M_BNE(a, b, disp)   M_ITYPE(0x05,a,b,disp) /* br a != b */
 
#define M_BEQZ(a, disp)   M_ITYPE(0x04,a,0,disp) /* br a == 0 */
 
#define M_BLTZ(a, disp)   M_ITYPE(0x01,a,0,disp) /* br a < 0 */
 
#define M_BLEZ(a, disp)   M_ITYPE(0x06,a,0,disp) /* br a <= 0 */
 
#define M_BNEZ(a, disp)   M_ITYPE(0x05,a,0,disp) /* br a != 0 */
 
#define M_BGEZ(a, disp)   M_ITYPE(0x01,a,1,disp) /* br a >= 0 */
 
#define M_BGTZ(a, disp)   M_ITYPE(0x07,a,0,disp) /* br a > 0 */
 
#define M_BR(disp)   M_ITYPE(0x04,0,0,disp) /* branch */
 
#define M_BRS(disp)   M_ITYPE(0x01,0,17,disp) /* branch sbr */
 
#define M_JMP(a)   M_RTYPE(0,a,0,0,0,0x08) /* jump */
 
#define M_JSR(r, a)   M_RTYPE(0,a,0,r,0,0x09) /* call */
 
#define M_RET(a)   M_RTYPE(0,a,0,0,0,0x08) /* return */
 
#define M_TGE(a, b, code)   M_RTYPE(0,a,b,0,code&3ff,0x30) /* trp a >= b */
 
#define M_TGEU(a, b, code)   M_RTYPE(0,a,b,0,code&3ff,0x31) /* trp a >= b */
 
#define M_TLT(a, b, code)   M_RTYPE(0,a,b,0,code&3ff,0x32) /* trp a < b */
 
#define M_TLTU(a, b, code)   M_RTYPE(0,a,b,0,code&3ff,0x33) /* trp a < b */
 
#define M_TEQ(a, b, code)   M_RTYPE(0,a,b,0,code&3ff,0x34) /* trp a == b */
 
#define M_TNE(a, b, code)   M_RTYPE(0,a,b,0,code&3ff,0x36) /* trp a != b */
 
#define M_TLE(a, b, code)   M_RTYPE(0,b,a,0,code&3ff,0x30) /* trp a <= b */
 
#define M_TLEU(a, b, code)   M_RTYPE(0,b,a,0,code&3ff,0x31) /* trp a <= b */
 
#define M_TGT(a, b, code)   M_RTYPE(0,b,a,0,code&3ff,0x32) /* trp a > b */
 
#define M_TGTU(a, b, code)   M_RTYPE(0,b,a,0,code&3ff,0x33) /* trp a > b */
 
#define M_TGE_IMM(a, b)   M_ITYPE(1,a,0x08,b) /* trp a >= b */
 
#define M_TGEU_IMM(a, b)   M_ITYPE(1,a,0x09,b) /* trp a >= b */
 
#define M_TLT_IMM(a, b)   M_ITYPE(1,a,0x0a,b) /* trp a < b */
 
#define M_TLTU_IMM(a, b)   M_ITYPE(1,a,0x0b,b) /* trp a < b */
 
#define M_TEQ_IMM(a, b)   M_ITYPE(1,a,0x0c,b) /* trp a == b */
 
#define M_TNE_IMM(a, b)   M_ITYPE(1,a,0x0e,b) /* trp a != b */
 
#define M_IADD(a, b, c)   M_RTYPE(0,a,b,c,0,0x21) /* 32 add */
 
#define M_LADD(a, b, c)   M_RTYPE(0,a,b,c,0,0x2d) /* 64 add */
 
#define M_ISUB(a, b, c)   M_RTYPE(0,a,b,c,0,0x23) /* 32 sub */
 
#define M_LSUB(a, b, c)   M_RTYPE(0,a,b,c,0,0x2f) /* 64 sub */
 
#define M_IMUL(a, b)   M_ITYPE(0,a,b,0x18) /* 32 mul */
 
#define M_IMULU(a, b)   M_ITYPE(0,a,b,0x19) /* 32 mul */
 
#define M_LMUL(a, b)   M_ITYPE(0,a,b,0x1c) /* 64 mul */
 
#define M_IDIV(a, b)   M_ITYPE(0,a,b,0x1a) /* 32 div */
 
#define M_LDIV(a, b)   M_ITYPE(0,a,b,0x1e) /* 64 div */
 
#define M_MFLO(a)   M_RTYPE(0,0,0,a,0,0x12) /* quotient */
 
#define M_MFHI(a)   M_RTYPE(0,0,0,a,0,0x10) /* remainder */
 
#define M_IADD_IMM(a, b, c)   M_ITYPE(0x09,a,c,b) /* 32 add */
 
#define M_LADD_IMM(a, b, c)   M_ITYPE(0x19,a,c,b) /* 64 add */
 
#define M_ISUB_IMM(a, b, c)   M_IADD_IMM(a,-(b),c) /* 32 sub */
 
#define M_LSUB_IMM(a, b, c)   M_LADD_IMM(a,-(b),c) /* 64 sub */
 
#define M_LUI(a, imm)   M_ITYPE(0x0f,0,a,imm) /* a = imm<<16*/
 
#define M_CMPLT(a, b, c)   M_RTYPE(0,a,b,c,0,0x2a) /* c = a < b */
 
#define M_CMPGT(a, b, c)   M_RTYPE(0,b,a,c,0,0x2a) /* c = a > b */
 
#define M_CMPULT(a, b, c)   M_RTYPE(0,a,b,c,0,0x2b) /* c = a < b */
 
#define M_CMPUGT(a, b, c)   M_RTYPE(0,b,a,c,0,0x2b) /* c = a > b */
 
#define M_CMPLT_IMM(a, b, c)   M_ITYPE(0x0a,a,c,b) /* c = a < b */
 
#define M_CMPULT_IMM(a, b, c)   M_ITYPE(0x0b,a,c,b) /* c = a < b */
 
#define M_AND(a, b, c)   M_RTYPE(0,a,b,c,0,0x24) /* c = a & b */
 
#define M_OR(a, b, c)   M_RTYPE(0,a,b,c,0,0x25) /* c = a | b */
 
#define M_XOR(a, b, c)   M_RTYPE(0,a,b,c,0,0x26) /* c = a ^ b */
 
#define M_AND_IMM(a, b, c)   M_ITYPE(0x0c,a,c,b) /* c = a & b */
 
#define M_OR_IMM(a, b, c)   M_ITYPE(0x0d,a,c,b) /* c = a | b */
 
#define M_XOR_IMM(a, b, c)   M_ITYPE(0x0e,a,c,b) /* c = a ^ b */
 
#define M_ISLL(a, b, c)   M_RTYPE(0,b,a,c,0,0x04) /* c = a << b */
 
#define M_ISRL(a, b, c)   M_RTYPE(0,b,a,c,0,0x06) /* c = a >>>b */
 
#define M_ISRA(a, b, c)   M_RTYPE(0,b,a,c,0,0x07) /* c = a >> b */
 
#define M_LSLL(a, b, c)   M_RTYPE(0,b,a,c,0,0x14) /* c = a << b */
 
#define M_LSRL(a, b, c)   M_RTYPE(0,b,a,c,0,0x16) /* c = a >>>b */
 
#define M_LSRA(a, b, c)   M_RTYPE(0,b,a,c,0,0x17) /* c = a >> b */
 
#define M_ISLL_IMM(a, b, c)   M_RTYPE(0,0,a,c,(b)&31,0x00) /* c = a << b */
 
#define M_ISRL_IMM(a, b, c)   M_RTYPE(0,0,a,c,(b)&31,0x02) /* c = a >>>b */
 
#define M_ISRA_IMM(a, b, c)   M_RTYPE(0,0,a,c,(b)&31,0x03) /* c = a >> b */
 
#define M_LSLL_IMM(a, b, c)   M_RTYPE(0,0,a,c,(b)&31,0x38+((b)>>3&4)) /*c = a << b*/
 
#define M_LSRL_IMM(a, b, c)   M_RTYPE(0,0,a,c,(b)&31,0x3a+((b)>>3&4)) /*c = a >>>b*/
 
#define M_LSRA_IMM(a, b, c)   M_RTYPE(0,0,a,c,(b)&31,0x3b+((b)>>3&4)) /*c = a >> b*/
 
#define M_MOV(a, c)   M_OR(a,0,c) /* c = a */
 
#define M_CLR(c)   M_OR(0,0,c) /* c = 0 */
 
#define M_NOP   M_ISLL_IMM(0,0,0) /* ; */
 
#define M_FADD(a, b, c)   M_FP3(0x00,FMT_F,a,b,c) /* flt add */
 
#define M_DADD(a, b, c)   M_FP3(0x00,FMT_D,a,b,c) /* dbl add */
 
#define M_FSUB(a, b, c)   M_FP3(0x01,FMT_F,a,b,c) /* flt sub */
 
#define M_DSUB(a, b, c)   M_FP3(0x01,FMT_D,a,b,c) /* dbl sub */
 
#define M_FMUL(a, b, c)   M_FP3(0x02,FMT_F,a,b,c) /* flt mul */
 
#define M_DMUL(a, b, c)   M_FP3(0x02,FMT_D,a,b,c) /* dbl mul */
 
#define M_FDIV(a, b, c)   M_FP3(0x03,FMT_F,a,b,c) /* flt div */
 
#define M_DDIV(a, b, c)   M_FP3(0x03,FMT_D,a,b,c) /* dbl div */
 
#define M_FSQRT(a, c)   M_FP2(0x04,FMT_F,a,c) /* flt sqrt */
 
#define M_DSQRT(a, c)   M_FP2(0x04,FMT_D,a,c) /* dbl sqrt */
 
#define M_FABS(a, c)   M_FP2(0x05,FMT_F,a,c) /* flt abs */
 
#define M_DABS(a, c)   M_FP2(0x05,FMT_D,a,c) /* dbl abs */
 
#define M_FMOV(a, c)   M_FP2(0x06,FMT_F,a,c) /* flt mov */
 
#define M_DMOV(a, c)   M_FP2(0x06,FMT_D,a,c) /* dbl mov */
 
#define M_FNEG(a, c)   M_FP2(0x07,FMT_F,a,c) /* flt neg */
 
#define M_DNEG(a, c)   M_FP2(0x07,FMT_D,a,c) /* dbl neg */
 
#define M_ROUNDFI(a, c)   M_FP2(0x0c,FMT_F,a,c) /* flt roundi */
 
#define M_ROUNDDI(a, c)   M_FP2(0x0c,FMT_D,a,c) /* dbl roundi */
 
#define M_TRUNCFI(a, c)   M_FP2(0x0d,FMT_F,a,c) /* flt trunci */
 
#define M_TRUNCDI(a, c)   M_FP2(0x0d,FMT_D,a,c) /* dbl trunci */
 
#define M_CEILFI(a, c)   M_FP2(0x0e,FMT_F,a,c) /* flt ceili */
 
#define M_CEILDI(a, c)   M_FP2(0x0e,FMT_D,a,c) /* dbl ceili */
 
#define M_FLOORFI(a, c)   M_FP2(0x0f,FMT_F,a,c) /* flt trunci */
 
#define M_FLOORDI(a, c)   M_FP2(0x0f,FMT_D,a,c) /* dbl trunci */
 
#define M_ROUNDFL(a, c)   M_FP2(0x08,FMT_F,a,c) /* flt roundl */
 
#define M_ROUNDDL(a, c)   M_FP2(0x08,FMT_D,a,c) /* dbl roundl */
 
#define M_TRUNCFL(a, c)   M_FP2(0x09,FMT_F,a,c) /* flt truncl */
 
#define M_TRUNCDL(a, c)   M_FP2(0x09,FMT_D,a,c) /* dbl truncl */
 
#define M_CEILFL(a, c)   M_FP2(0x0a,FMT_F,a,c) /* flt ceill */
 
#define M_CEILDL(a, c)   M_FP2(0x0a,FMT_D,a,c) /* dbl ceill */
 
#define M_FLOORFL(a, c)   M_FP2(0x0b,FMT_F,a,c) /* flt truncl */
 
#define M_FLOORDL(a, c)   M_FP2(0x0b,FMT_D,a,c) /* dbl truncl */
 
#define M_CVTDF(a, c)   M_FP2(0x20,FMT_D,a,c) /* dbl2flt */
 
#define M_CVTIF(a, c)   M_FP2(0x20,FMT_I,a,c) /* int2flt */
 
#define M_CVTLF(a, c)   M_FP2(0x20,FMT_L,a,c) /* long2flt */
 
#define M_CVTFD(a, c)   M_FP2(0x21,FMT_F,a,c) /* flt2dbl */
 
#define M_CVTID(a, c)   M_FP2(0x21,FMT_I,a,c) /* int2dbl */
 
#define M_CVTLD(a, c)   M_FP2(0x21,FMT_L,a,c) /* long2dbl */
 
#define M_CVTFI(a, c)   M_FP2(0x24,FMT_F,a,c) /* flt2int */
 
#define M_CVTDI(a, c)   M_FP2(0x24,FMT_D,a,c) /* dbl2int */
 
#define M_CVTFL(a, c)   M_FP2(0x25,FMT_F,a,c) /* flt2long */
 
#define M_CVTDL(a, c)   M_FP2(0x25,FMT_D,a,c) /* dbl2long */
 
#define M_MOVDI(d, i)   M_FP3(0,0,d,i,0) /* i = d */
 
#define M_MOVDL(d, l)   M_FP3(0,1,d,l,0) /* l = d */
 
#define M_MOVID(i, d)   M_FP3(0,4,d,i,0) /* d = i */
 
#define M_MOVLD(l, d)   M_FP3(0,5,d,l,0) /* d = l */
 
#define M_MFC1(l, f)   M_FP3(0,0,f,l,0)
 
#define M_MTC1(l, f)   M_FP3(0,4,f,l,0)
 
#define M_DMFC1(l, f)   M_FP3(0,1,f,l,0)
 
#define M_DMTC1(l, f)   M_FP3(0,5,f,l,0)
 
#define M_FCMPFF(a, b)   M_FP3(0x30,FMT_F,a,b,0) /* c = a == b */
 
#define M_FCMPFD(a, b)   M_FP3(0x30,FMT_D,a,b,0) /* c = a == b */
 
#define M_FCMPUNF(a, b)   M_FP3(0x31,FMT_F,a,b,0) /* c = a == b */
 
#define M_FCMPUND(a, b)   M_FP3(0x31,FMT_D,a,b,0) /* c = a == b */
 
#define M_FCMPEQF(a, b)   M_FP3(0x32,FMT_F,a,b,0) /* c = a == b */
 
#define M_FCMPEQD(a, b)   M_FP3(0x32,FMT_D,a,b,0) /* c = a == b */
 
#define M_FCMPUEQF(a, b)   M_FP3(0x33,FMT_F,a,b,0) /* c = a == b */
 
#define M_FCMPUEQD(a, b)   M_FP3(0x33,FMT_D,a,b,0) /* c = a == b */
 
#define M_FCMPOLTF(a, b)   M_FP3(0x34,FMT_F,a,b,0) /* c = a < b */
 
#define M_FCMPOLTD(a, b)   M_FP3(0x34,FMT_D,a,b,0) /* c = a < b */
 
#define M_FCMPULTF(a, b)   M_FP3(0x35,FMT_F,a,b,0) /* c = a < b */
 
#define M_FCMPULTD(a, b)   M_FP3(0x35,FMT_D,a,b,0) /* c = a < b */
 
#define M_FCMPOLEF(a, b)   M_FP3(0x36,FMT_F,a,b,0) /* c = a <= b */
 
#define M_FCMPOLED(a, b)   M_FP3(0x36,FMT_D,a,b,0) /* c = a <= b */
 
#define M_FCMPULEF(a, b)   M_FP3(0x37,FMT_F,a,b,0) /* c = a <= b */
 
#define M_FCMPULED(a, b)   M_FP3(0x37,FMT_D,a,b,0) /* c = a <= b */
 
#define M_FBF(disp)   M_ITYPE(0x11,8,0,disp) /* br false */
 
#define M_FBT(disp)   M_ITYPE(0x11,8,1,disp) /* br true */
 
#define M_FBFL(disp)   M_ITYPE(0x11,8,2,disp) /* br false */
 
#define M_FBTL(disp)   M_ITYPE(0x11,8,3,disp) /* br true */
 
#define M_CMOVF(a, b)   M_RTYPE(0x00,a,0,b,0,1)
 
#define M_CMOVT(a, b)   M_RTYPE(0x00,a,1,b,0,1)
 
#define POINTERSHIFT   3
 
#define M_ALD_INTERN(a, b, disp)   M_LLD_INTERN(a,b,disp)
 
#define M_ALD(a, b, disp)   M_LLD(a,b,disp)
 
#define M_ALD_DSEG(a, disp)   M_LLD(a,REG_PV,disp)
 
#define M_AST_INTERN(a, b, disp)   M_LST_INTERN(a,b,disp)
 
#define M_AST(a, b, disp)   M_LST(a,b,disp)
 
#define M_AADD(a, b, c)   M_LADD(a,b,c)
 
#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_ASLL_IMM(a, b, c)   M_LSLL_IMM(a,b,c)
 

Macro Definition Documentation

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

Definition at line 46 of file codegen.hpp.

#define BRANCH_NOPS
Value:
do { \
} \
else { \
} \
} while (0)
#define M_NOP
Definition: codegen.hpp:477
#define CODEGENDATA_HAS_FLAG_LONGBRANCHES(cd)

Definition at line 57 of file codegen.hpp.

#define FMT_D   17

Definition at line 125 of file codegen.hpp.

#define FMT_F   16

Definition at line 124 of file codegen.hpp.

#define FMT_I   20

Definition at line 126 of file codegen.hpp.

#define FMT_L   21

Definition at line 127 of file codegen.hpp.

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

Definition at line 51 of file codegen.hpp.

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

Definition at line 52 of file codegen.hpp.

#define M_AADD (   a,
  b,
 
)    M_LADD(a,b,c)

Definition at line 578 of file codegen.hpp.

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

Definition at line 579 of file codegen.hpp.

#define M_ALD (   a,
  b,
  disp 
)    M_LLD(a,b,disp)

Definition at line 574 of file codegen.hpp.

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

Definition at line 575 of file codegen.hpp.

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

Definition at line 573 of file codegen.hpp.

#define M_AND (   a,
  b,
 
)    M_RTYPE(0,a,b,c,0,0x24) /* c = a & b */

Definition at line 453 of file codegen.hpp.

#define M_AND_IMM (   a,
  b,
 
)    M_ITYPE(0x0c,a,c,b) /* c = a & b */

Definition at line 457 of file codegen.hpp.

#define M_ASLL_IMM (   a,
  b,
 
)    M_LSLL_IMM(a,b,c)

Definition at line 581 of file codegen.hpp.

#define M_AST (   a,
  b,
  disp 
)    M_LST(a,b,disp)

Definition at line 577 of file codegen.hpp.

#define M_AST_INTERN (   a,
  b,
  disp 
)    M_LST_INTERN(a,b,disp)

Definition at line 576 of file codegen.hpp.

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

Definition at line 580 of file codegen.hpp.

#define M_BEQ (   a,
  b,
  disp 
)    M_ITYPE(0x04,a,b,disp) /* br a == b */

Definition at line 371 of file codegen.hpp.

#define M_BEQZ (   a,
  disp 
)    M_ITYPE(0x04,a,0,disp) /* br a == 0 */

Definition at line 373 of file codegen.hpp.

#define M_BGEZ (   a,
  disp 
)    M_ITYPE(0x01,a,1,disp) /* br a >= 0 */

Definition at line 377 of file codegen.hpp.

#define M_BGTZ (   a,
  disp 
)    M_ITYPE(0x07,a,0,disp) /* br a > 0 */

Definition at line 378 of file codegen.hpp.

#define M_BLDS (   a,
  b,
  disp 
)    M_ITYPE(0x20,b,a,disp) /* 8 load */

Definition at line 149 of file codegen.hpp.

#define M_BLDU (   a,
  b,
  disp 
)    M_ITYPE(0x24,b,a,disp) /* 8 load */

Definition at line 150 of file codegen.hpp.

#define M_BLEZ (   a,
  disp 
)    M_ITYPE(0x06,a,0,disp) /* br a <= 0 */

Definition at line 375 of file codegen.hpp.

#define M_BLTZ (   a,
  disp 
)    M_ITYPE(0x01,a,0,disp) /* br a < 0 */

Definition at line 374 of file codegen.hpp.

#define M_BNE (   a,
  b,
  disp 
)    M_ITYPE(0x05,a,b,disp) /* br a != b */

Definition at line 372 of file codegen.hpp.

#define M_BNEZ (   a,
  disp 
)    M_ITYPE(0x05,a,0,disp) /* br a != 0 */

Definition at line 376 of file codegen.hpp.

#define M_BR (   disp)    M_ITYPE(0x04,0,0,disp) /* branch */

Definition at line 391 of file codegen.hpp.

#define M_BRS (   disp)    M_ITYPE(0x01,0,17,disp) /* branch sbr */

Definition at line 392 of file codegen.hpp.

#define M_BST (   a,
  b,
  disp 
)    M_ITYPE(0x28,b,a,disp) /* 8 store */

Definition at line 256 of file codegen.hpp.

#define M_CEILDI (   a,
 
)    M_FP2(0x0e,FMT_D,a,c) /* dbl ceili */

Definition at line 504 of file codegen.hpp.

#define M_CEILDL (   a,
 
)    M_FP2(0x0a,FMT_D,a,c) /* dbl ceill */

Definition at line 513 of file codegen.hpp.

#define M_CEILFI (   a,
 
)    M_FP2(0x0e,FMT_F,a,c) /* flt ceili */

Definition at line 503 of file codegen.hpp.

#define M_CEILFL (   a,
 
)    M_FP2(0x0a,FMT_F,a,c) /* flt ceill */

Definition at line 512 of file codegen.hpp.

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

Definition at line 476 of file codegen.hpp.

#define M_CMOVF (   a,
 
)    M_RTYPE(0x00,a,0,b,0,1)

Definition at line 561 of file codegen.hpp.

#define M_CMOVT (   a,
 
)    M_RTYPE(0x00,a,1,b,0,1)

Definition at line 562 of file codegen.hpp.

#define M_CMPGT (   a,
  b,
 
)    M_RTYPE(0,b,a,c,0,0x2a) /* c = a > b */

Definition at line 445 of file codegen.hpp.

#define M_CMPLT (   a,
  b,
 
)    M_RTYPE(0,a,b,c,0,0x2a) /* c = a < b */

Definition at line 444 of file codegen.hpp.

#define M_CMPLT_IMM (   a,
  b,
 
)    M_ITYPE(0x0a,a,c,b) /* c = a < b */

Definition at line 450 of file codegen.hpp.

#define M_CMPUGT (   a,
  b,
 
)    M_RTYPE(0,b,a,c,0,0x2b) /* c = a > b */

Definition at line 448 of file codegen.hpp.

#define M_CMPULT (   a,
  b,
 
)    M_RTYPE(0,a,b,c,0,0x2b) /* c = a < b */

Definition at line 447 of file codegen.hpp.

#define M_CMPULT_IMM (   a,
  b,
 
)    M_ITYPE(0x0b,a,c,b) /* c = a < b */

Definition at line 451 of file codegen.hpp.

#define M_CVTDF (   a,
 
)    M_FP2(0x20,FMT_D,a,c) /* dbl2flt */

Definition at line 517 of file codegen.hpp.

#define M_CVTDI (   a,
 
)    M_FP2(0x24,FMT_D,a,c) /* dbl2int */

Definition at line 524 of file codegen.hpp.

#define M_CVTDL (   a,
 
)    M_FP2(0x25,FMT_D,a,c) /* dbl2long */

Definition at line 526 of file codegen.hpp.

#define M_CVTFD (   a,
 
)    M_FP2(0x21,FMT_F,a,c) /* flt2dbl */

Definition at line 520 of file codegen.hpp.

#define M_CVTFI (   a,
 
)    M_FP2(0x24,FMT_F,a,c) /* flt2int */

Definition at line 523 of file codegen.hpp.

#define M_CVTFL (   a,
 
)    M_FP2(0x25,FMT_F,a,c) /* flt2long */

Definition at line 525 of file codegen.hpp.

#define M_CVTID (   a,
 
)    M_FP2(0x21,FMT_I,a,c) /* int2dbl */

Definition at line 521 of file codegen.hpp.

#define M_CVTIF (   a,
 
)    M_FP2(0x20,FMT_I,a,c) /* int2flt */

Definition at line 518 of file codegen.hpp.

#define M_CVTLD (   a,
 
)    M_FP2(0x21,FMT_L,a,c) /* long2dbl */

Definition at line 522 of file codegen.hpp.

#define M_CVTLF (   a,
 
)    M_FP2(0x20,FMT_L,a,c) /* long2flt */

Definition at line 519 of file codegen.hpp.

#define M_DABS (   a,
 
)    M_FP2(0x05,FMT_D,a,c) /* dbl abs */

Definition at line 493 of file codegen.hpp.

#define M_DADD (   a,
  b,
 
)    M_FP3(0x00,FMT_D,a,b,c) /* dbl add */

Definition at line 482 of file codegen.hpp.

#define M_DDIV (   a,
  b,
 
)    M_FP3(0x03,FMT_D,a,b,c) /* dbl div */

Definition at line 488 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)
#define M_DLD_INTERN(a, b, disp)
Definition: codegen.hpp:314
#define M_LUI(a, imm)
Definition: codegen.hpp:442
int32_t s4
Definition: types.hpp:45
#define REG_ITMP3
Definition: md-abi.hpp:48
#define M_AADD(a, b, c)
Definition: codegen.hpp:578

Definition at line 329 of file codegen.hpp.

#define M_DLD_INTERN (   a,
  b,
  disp 
)    M_ITYPE(0x35,b,a,disp) /* load dbl */

Definition at line 314 of file codegen.hpp.

#define M_DMFC1 (   l,
 
)    M_FP3(0,1,f,l,0)

Definition at line 536 of file codegen.hpp.

#define M_DMOV (   a,
 
)    M_FP2(0x06,FMT_D,a,c) /* dbl mov */

Definition at line 495 of file codegen.hpp.

#define M_DMTC1 (   l,
 
)    M_FP3(0,5,f,l,0)

Definition at line 537 of file codegen.hpp.

#define M_DMUL (   a,
  b,
 
)    M_FP3(0x02,FMT_D,a,b,c) /* dbl mul */

Definition at line 486 of file codegen.hpp.

#define M_DNEG (   a,
 
)    M_FP2(0x07,FMT_D,a,c) /* dbl neg */

Definition at line 497 of file codegen.hpp.

#define M_DSQRT (   a,
 
)    M_FP2(0x04,FMT_D,a,c) /* dbl sqrt */

Definition at line 491 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)
#define M_LUI(a, imm)
Definition: codegen.hpp:442
#define M_DST_INTERN(a, b, disp)
Definition: codegen.hpp:343
int32_t s4
Definition: types.hpp:45
#define REG_ITMP3
Definition: md-abi.hpp:48
#define M_AADD(a, b, c)
Definition: codegen.hpp:578

Definition at line 358 of file codegen.hpp.

#define M_DST_INTERN (   a,
  b,
  disp 
)    M_ITYPE(0x3d,b,a,disp) /* store dbl */

Definition at line 343 of file codegen.hpp.

#define M_DSUB (   a,
  b,
 
)    M_FP3(0x01,FMT_D,a,b,c) /* dbl sub */

Definition at line 484 of file codegen.hpp.

#define M_FABS (   a,
 
)    M_FP2(0x05,FMT_F,a,c) /* flt abs */

Definition at line 492 of file codegen.hpp.

#define M_FADD (   a,
  b,
 
)    M_FP3(0x00,FMT_F,a,b,c) /* flt add */

Definition at line 481 of file codegen.hpp.

#define M_FBF (   disp)    M_ITYPE(0x11,8,0,disp) /* br false */

Definition at line 556 of file codegen.hpp.

#define M_FBFL (   disp)    M_ITYPE(0x11,8,2,disp) /* br false */

Definition at line 558 of file codegen.hpp.

#define M_FBT (   disp)    M_ITYPE(0x11,8,1,disp) /* br true */

Definition at line 557 of file codegen.hpp.

#define M_FBTL (   disp)    M_ITYPE(0x11,8,3,disp) /* br true */

Definition at line 559 of file codegen.hpp.

#define M_FCMPEQD (   a,
 
)    M_FP3(0x32,FMT_D,a,b,0) /* c = a == b */

Definition at line 544 of file codegen.hpp.

#define M_FCMPEQF (   a,
 
)    M_FP3(0x32,FMT_F,a,b,0) /* c = a == b */

Definition at line 543 of file codegen.hpp.

#define M_FCMPFD (   a,
 
)    M_FP3(0x30,FMT_D,a,b,0) /* c = a == b */

Definition at line 540 of file codegen.hpp.

#define M_FCMPFF (   a,
 
)    M_FP3(0x30,FMT_F,a,b,0) /* c = a == b */

Definition at line 539 of file codegen.hpp.

#define M_FCMPOLED (   a,
 
)    M_FP3(0x36,FMT_D,a,b,0) /* c = a <= b */

Definition at line 552 of file codegen.hpp.

#define M_FCMPOLEF (   a,
 
)    M_FP3(0x36,FMT_F,a,b,0) /* c = a <= b */

Definition at line 551 of file codegen.hpp.

#define M_FCMPOLTD (   a,
 
)    M_FP3(0x34,FMT_D,a,b,0) /* c = a < b */

Definition at line 548 of file codegen.hpp.

#define M_FCMPOLTF (   a,
 
)    M_FP3(0x34,FMT_F,a,b,0) /* c = a < b */

Definition at line 547 of file codegen.hpp.

#define M_FCMPUEQD (   a,
 
)    M_FP3(0x33,FMT_D,a,b,0) /* c = a == b */

Definition at line 546 of file codegen.hpp.

#define M_FCMPUEQF (   a,
 
)    M_FP3(0x33,FMT_F,a,b,0) /* c = a == b */

Definition at line 545 of file codegen.hpp.

#define M_FCMPULED (   a,
 
)    M_FP3(0x37,FMT_D,a,b,0) /* c = a <= b */

Definition at line 554 of file codegen.hpp.

#define M_FCMPULEF (   a,
 
)    M_FP3(0x37,FMT_F,a,b,0) /* c = a <= b */

Definition at line 553 of file codegen.hpp.

#define M_FCMPULTD (   a,
 
)    M_FP3(0x35,FMT_D,a,b,0) /* c = a < b */

Definition at line 550 of file codegen.hpp.

#define M_FCMPULTF (   a,
 
)    M_FP3(0x35,FMT_F,a,b,0) /* c = a < b */

Definition at line 549 of file codegen.hpp.

#define M_FCMPUND (   a,
 
)    M_FP3(0x31,FMT_D,a,b,0) /* c = a == b */

Definition at line 542 of file codegen.hpp.

#define M_FCMPUNF (   a,
 
)    M_FP3(0x31,FMT_F,a,b,0) /* c = a == b */

Definition at line 541 of file codegen.hpp.

#define M_FDIV (   a,
  b,
 
)    M_FP3(0x03,FMT_F,a,b,c) /* flt div */

Definition at line 487 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_LUI(a, imm)
Definition: codegen.hpp:442
int32_t s4
Definition: types.hpp:45
#define REG_ITMP3
Definition: md-abi.hpp:48
#define M_AADD(a, b, c)
Definition: codegen.hpp:578
#define M_FLD_INTERN(a, b, disp)
Definition: codegen.hpp:313

Definition at line 316 of file codegen.hpp.

#define M_FLD_INTERN (   a,
  b,
  disp 
)    M_ITYPE(0x31,b,a,disp) /* load flt */

Definition at line 313 of file codegen.hpp.

#define M_FLOORDI (   a,
 
)    M_FP2(0x0f,FMT_D,a,c) /* dbl trunci */

Definition at line 506 of file codegen.hpp.

#define M_FLOORDL (   a,
 
)    M_FP2(0x0b,FMT_D,a,c) /* dbl truncl */

Definition at line 515 of file codegen.hpp.

#define M_FLOORFI (   a,
 
)    M_FP2(0x0f,FMT_F,a,c) /* flt trunci */

Definition at line 505 of file codegen.hpp.

#define M_FLOORFL (   a,
 
)    M_FP2(0x0b,FMT_F,a,c) /* flt truncl */

Definition at line 514 of file codegen.hpp.

#define M_FMOV (   a,
 
)    M_FP2(0x06,FMT_F,a,c) /* flt mov */

Definition at line 494 of file codegen.hpp.

#define M_FMUL (   a,
  b,
 
)    M_FP3(0x02,FMT_F,a,b,c) /* flt mul */

Definition at line 485 of file codegen.hpp.

#define M_FNEG (   a,
 
)    M_FP2(0x07,FMT_F,a,c) /* flt neg */

Definition at line 496 of file codegen.hpp.

#define M_FP2 (   fu,
  fmt,
  fs,
  fd 
)    M_RTYPE(0x11, fmt, 0, fs, fd, fu)

Definition at line 121 of file codegen.hpp.

#define M_FP3 (   fu,
  fmt,
  fs,
  ft,
  fd 
)    M_RTYPE(0x11, fmt, ft, fs, fd, fu)

Definition at line 122 of file codegen.hpp.

#define M_FSQRT (   a,
 
)    M_FP2(0x04,FMT_F,a,c) /* flt sqrt */

Definition at line 490 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)
#define M_FST_INTERN(a, b, disp)
Definition: codegen.hpp:342
#define M_LUI(a, imm)
Definition: codegen.hpp:442
int32_t s4
Definition: types.hpp:45
#define REG_ITMP3
Definition: md-abi.hpp:48
#define M_AADD(a, b, c)
Definition: codegen.hpp:578

Definition at line 345 of file codegen.hpp.

#define M_FST_INTERN (   a,
  b,
  disp 
)    M_ITYPE(0x39,b,a,disp) /* store flt */

Definition at line 342 of file codegen.hpp.

#define M_FSUB (   a,
  b,
 
)    M_FP3(0x01,FMT_F,a,b,c) /* flt sub */

Definition at line 483 of file codegen.hpp.

#define M_IADD (   a,
  b,
 
)    M_RTYPE(0,a,b,c,0,0x21) /* 32 add */

Definition at line 424 of file codegen.hpp.

#define M_IADD_IMM (   a,
  b,
 
)    M_ITYPE(0x09,a,c,b) /* 32 add */

Definition at line 437 of file codegen.hpp.

#define M_IDIV (   a,
 
)    M_ITYPE(0,a,b,0x1a) /* 32 div */

Definition at line 431 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_LUI(a,hi); \
M_AADD(b,a,a); \
M_ILD_INTERN(a,a,lo); \
} \
} while (0)
#define M_ILD_INTERN(a, b, disp)
Definition: codegen.hpp:154
#define M_LUI(a, imm)
Definition: codegen.hpp:442
int32_t s4
Definition: types.hpp:45
#define M_AADD(a, b, c)
Definition: codegen.hpp:578

Definition at line 156 of file codegen.hpp.

#define M_ILD_INTERN (   a,
  b,
  disp 
)    M_ITYPE(0x23,b,a,disp) /* 32 load */

Definition at line 154 of file codegen.hpp.

#define M_IMUL (   a,
 
)    M_ITYPE(0,a,b,0x18) /* 32 mul */

Definition at line 428 of file codegen.hpp.

#define M_IMULU (   a,
 
)    M_ITYPE(0,a,b,0x19) /* 32 mul */

Definition at line 429 of file codegen.hpp.

#define M_ISLL (   a,
  b,
 
)    M_RTYPE(0,b,a,c,0,0x04) /* c = a << b */

Definition at line 461 of file codegen.hpp.

#define M_ISLL_IMM (   a,
  b,
 
)    M_RTYPE(0,0,a,c,(b)&31,0x00) /* c = a << b */

Definition at line 468 of file codegen.hpp.

#define M_ISRA (   a,
  b,
 
)    M_RTYPE(0,b,a,c,0,0x07) /* c = a >> b */

Definition at line 463 of file codegen.hpp.

#define M_ISRA_IMM (   a,
  b,
 
)    M_RTYPE(0,0,a,c,(b)&31,0x03) /* c = a >> b */

Definition at line 470 of file codegen.hpp.

#define M_ISRL (   a,
  b,
 
)    M_RTYPE(0,b,a,c,0,0x06) /* c = a >>>b */

Definition at line 462 of file codegen.hpp.

#define M_ISRL_IMM (   a,
  b,
 
)    M_RTYPE(0,0,a,c,(b)&31,0x02) /* c = a >>>b */

Definition at line 469 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_LUI(a, imm)
Definition: codegen.hpp:442
#define M_IST_INTERN(a, b, disp)
Definition: codegen.hpp:259
int32_t s4
Definition: types.hpp:45
#define REG_ITMP3
Definition: md-abi.hpp:48
#define M_AADD(a, b, c)
Definition: codegen.hpp:578

Definition at line 261 of file codegen.hpp.

#define M_IST_INTERN (   a,
  b,
  disp 
)    M_ITYPE(0x2b,b,a,disp) /* 32 store */

Definition at line 259 of file codegen.hpp.

#define M_ISUB (   a,
  b,
 
)    M_RTYPE(0,a,b,c,0,0x23) /* 32 sub */

Definition at line 426 of file codegen.hpp.

#define M_ISUB_IMM (   a,
  b,
 
)    M_IADD_IMM(a,-(b),c) /* 32 sub */

Definition at line 439 of file codegen.hpp.

#define M_ITYPE (   op,
  rs,
  rt,
  imm 
)
Value:
do { \
*((u4 *) cd->mcodeptr) = (((op) << 26) | ((rs) << 21) | ((rt) << 16) | ((imm) & 0xffff)); \
cd->mcodeptr += 4; \
} while (0)
u2 op
Definition: disass.cpp:129
uint32_t u4
Definition: types.hpp:46

Definition at line 98 of file codegen.hpp.

#define M_ITYPE_GET_IMM (   x)    ( (x) & 0xffff)

Definition at line 106 of file codegen.hpp.

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

Definition at line 104 of file codegen.hpp.

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

Definition at line 105 of file codegen.hpp.

#define M_JMP (   a)    M_RTYPE(0,a,0,0,0,0x08) /* jump */

Definition at line 394 of file codegen.hpp.

#define M_JSR (   r,
 
)    M_RTYPE(0,a,0,r,0,0x09) /* call */

Definition at line 395 of file codegen.hpp.

#define M_JTYPE (   op,
  imm 
)
Value:
do { \
*((u4 *) cd->mcodeptr) = (((op) << 26) | ((off) & 0x3ffffff)); \
cd->mcodeptr += 4; \
} while (0)
u2 op
Definition: disass.cpp:129
uint32_t u4
Definition: types.hpp:46

Definition at line 109 of file codegen.hpp.

#define M_LADD (   a,
  b,
 
)    M_RTYPE(0,a,b,c,0,0x2d) /* 64 add */

Definition at line 425 of file codegen.hpp.

#define M_LADD_IMM (   a,
  b,
 
)    M_ITYPE(0x19,a,c,b) /* 64 add */

Definition at line 438 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_AADD_IMM(b,lo,a); \
} else { \
M_AADD(b, REG_ITMP3, a); \
} \
} while (0)
#define M_LUI(a, imm)
Definition: codegen.hpp:442
int32_t s4
Definition: types.hpp:45
#define M_AADD_IMM(a, b, c)
Definition: codegen.hpp:579
#define REG_ITMP3
Definition: md-abi.hpp:48
#define M_AADD(a, b, c)
Definition: codegen.hpp:578

Definition at line 136 of file codegen.hpp.

#define M_LDIV (   a,
 
)    M_ITYPE(0,a,b,0x1e) /* 64 div */

Definition at line 432 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 { \
} \
} while (0)
#define M_LLD_INTERN(a, b, disp)
Definition: codegen.hpp:171
#define M_LUI(a, imm)
Definition: codegen.hpp:442
#define GET_LOW_REG(a)
int32_t s4
Definition: types.hpp:45
#define M_AADD(a, b, c)
Definition: codegen.hpp:578

Definition at line 243 of file codegen.hpp.

#define M_LLD_INTERN (   a,
  b,
  disp 
)    M_ITYPE(0x37,b,a,disp) /* 64 load */

Definition at line 171 of file codegen.hpp.

#define M_LMUL (   a,
 
)    M_ITYPE(0,a,b,0x1c) /* 64 mul */

Definition at line 430 of file codegen.hpp.

#define M_LSLL (   a,
  b,
 
)    M_RTYPE(0,b,a,c,0,0x14) /* c = a << b */

Definition at line 464 of file codegen.hpp.

#define M_LSLL_IMM (   a,
  b,
 
)    M_RTYPE(0,0,a,c,(b)&31,0x38+((b)>>3&4)) /*c = a << b*/

Definition at line 471 of file codegen.hpp.

#define M_LSRA (   a,
  b,
 
)    M_RTYPE(0,b,a,c,0,0x17) /* c = a >> b */

Definition at line 466 of file codegen.hpp.

#define M_LSRA_IMM (   a,
  b,
 
)    M_RTYPE(0,0,a,c,(b)&31,0x3b+((b)>>3&4)) /*c = a >> b*/

Definition at line 473 of file codegen.hpp.

#define M_LSRL (   a,
  b,
 
)    M_RTYPE(0,b,a,c,0,0x16) /* c = a >>>b */

Definition at line 465 of file codegen.hpp.

#define M_LSRL_IMM (   a,
  b,
 
)    M_RTYPE(0,0,a,c,(b)&31,0x3a+((b)>>3&4)) /*c = a >>>b*/

Definition at line 472 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_LUI(a, imm)
Definition: codegen.hpp:442
int32_t s4
Definition: types.hpp:45
#define REG_ITMP3
Definition: md-abi.hpp:48
#define M_AADD(a, b, c)
Definition: codegen.hpp:578
#define M_LST_INTERN(a, b, disp)
Definition: codegen.hpp:276

Definition at line 300 of file codegen.hpp.

#define M_LST_INTERN (   a,
  b,
  disp 
)    M_ITYPE(0x3f,b,a,disp) /* 64 store */

Definition at line 276 of file codegen.hpp.

#define M_LSUB (   a,
  b,
 
)    M_RTYPE(0,a,b,c,0,0x2f) /* 64 sub */

Definition at line 427 of file codegen.hpp.

#define M_LSUB_IMM (   a,
  b,
 
)    M_LADD_IMM(a,-(b),c) /* 64 sub */

Definition at line 440 of file codegen.hpp.

#define M_LUI (   a,
  imm 
)    M_ITYPE(0x0f,0,a,imm) /* a = imm<<16*/

Definition at line 442 of file codegen.hpp.

#define M_MFC1 (   l,
 
)    M_FP3(0,0,f,l,0)

Definition at line 533 of file codegen.hpp.

#define M_MFHI (   a)    M_RTYPE(0,0,0,a,0,0x10) /* remainder */

Definition at line 435 of file codegen.hpp.

#define M_MFLO (   a)    M_RTYPE(0,0,0,a,0,0x12) /* quotient */

Definition at line 434 of file codegen.hpp.

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

Definition at line 475 of file codegen.hpp.

#define M_MOVDI (   d,
  i 
)    M_FP3(0,0,d,i,0) /* i = d */

Definition at line 528 of file codegen.hpp.

#define M_MOVDL (   d,
 
)    M_FP3(0,1,d,l,0) /* l = d */

Definition at line 529 of file codegen.hpp.

#define M_MOVID (   i,
 
)    M_FP3(0,4,d,i,0) /* d = i */

Definition at line 530 of file codegen.hpp.

#define M_MOVLD (   l,
 
)    M_FP3(0,5,d,l,0) /* d = l */

Definition at line 531 of file codegen.hpp.

#define M_MTC1 (   l,
 
)    M_FP3(0,4,f,l,0)

Definition at line 534 of file codegen.hpp.

#define M_NOP   M_ISLL_IMM(0,0,0) /* ; */

Definition at line 477 of file codegen.hpp.

#define M_OR (   a,
  b,
 
)    M_RTYPE(0,a,b,c,0,0x25) /* c = a | b */

Definition at line 454 of file codegen.hpp.

#define M_OR_IMM (   a,
  b,
 
)    M_ITYPE(0x0d,a,c,b) /* c = a | b */

Definition at line 458 of file codegen.hpp.

#define M_RESERVED   M_RTYPE(0x3b, 0, 0, 0, 0, 0)

Definition at line 132 of file codegen.hpp.

#define M_RET (   a)    M_RTYPE(0,a,0,0,0,0x08) /* return */

Definition at line 396 of file codegen.hpp.

#define M_ROUNDDI (   a,
 
)    M_FP2(0x0c,FMT_D,a,c) /* dbl roundi */

Definition at line 500 of file codegen.hpp.

#define M_ROUNDDL (   a,
 
)    M_FP2(0x08,FMT_D,a,c) /* dbl roundl */

Definition at line 509 of file codegen.hpp.

#define M_ROUNDFI (   a,
 
)    M_FP2(0x0c,FMT_F,a,c) /* flt roundi */

Definition at line 499 of file codegen.hpp.

#define M_ROUNDFL (   a,
 
)    M_FP2(0x08,FMT_F,a,c) /* flt roundl */

Definition at line 508 of file codegen.hpp.

#define M_RTYPE (   op,
  rs,
  rt,
  rd,
  sa,
  fu 
)
Value:
do { \
*((u4 *) cd->mcodeptr) = (((op) << 26) | ((rs) << 21) | ((rt) << 16) | ((rd) << 11) | ((sa) << 6) | (fu)); \
cd->mcodeptr += 4; \
} while (0)
u2 op
Definition: disass.cpp:129
uint32_t u4
Definition: types.hpp:46

Definition at line 115 of file codegen.hpp.

#define M_SLDS (   a,
  b,
  disp 
)    M_ITYPE(0x21,b,a,disp) /* 16 load */

Definition at line 151 of file codegen.hpp.

#define M_SLDU (   a,
  b,
  disp 
)    M_ITYPE(0x25,b,a,disp) /* 16 load */

Definition at line 152 of file codegen.hpp.

#define M_SST (   a,
  b,
  disp 
)    M_ITYPE(0x29,b,a,disp) /* 16 store */

Definition at line 257 of file codegen.hpp.

#define M_TEQ (   a,
  b,
  code 
)    M_RTYPE(0,a,b,0,code&3ff,0x34) /* trp a == b */

Definition at line 402 of file codegen.hpp.

#define M_TEQ_IMM (   a,
 
)    M_ITYPE(1,a,0x0c,b) /* trp a == b */

Definition at line 413 of file codegen.hpp.

#define M_TGE (   a,
  b,
  code 
)    M_RTYPE(0,a,b,0,code&3ff,0x30) /* trp a >= b */

Definition at line 398 of file codegen.hpp.

#define M_TGE_IMM (   a,
 
)    M_ITYPE(1,a,0x08,b) /* trp a >= b */

Definition at line 409 of file codegen.hpp.

#define M_TGEU (   a,
  b,
  code 
)    M_RTYPE(0,a,b,0,code&3ff,0x31) /* trp a >= b */

Definition at line 399 of file codegen.hpp.

#define M_TGEU_IMM (   a,
 
)    M_ITYPE(1,a,0x09,b) /* trp a >= b */

Definition at line 410 of file codegen.hpp.

#define M_TGT (   a,
  b,
  code 
)    M_RTYPE(0,b,a,0,code&3ff,0x32) /* trp a > b */

Definition at line 406 of file codegen.hpp.

#define M_TGTU (   a,
  b,
  code 
)    M_RTYPE(0,b,a,0,code&3ff,0x33) /* trp a > b */

Definition at line 407 of file codegen.hpp.

#define M_TLE (   a,
  b,
  code 
)    M_RTYPE(0,b,a,0,code&3ff,0x30) /* trp a <= b */

Definition at line 404 of file codegen.hpp.

#define M_TLEU (   a,
  b,
  code 
)    M_RTYPE(0,b,a,0,code&3ff,0x31) /* trp a <= b */

Definition at line 405 of file codegen.hpp.

#define M_TLT (   a,
  b,
  code 
)    M_RTYPE(0,a,b,0,code&3ff,0x32) /* trp a < b */

Definition at line 400 of file codegen.hpp.

#define M_TLT_IMM (   a,
 
)    M_ITYPE(1,a,0x0a,b) /* trp a < b */

Definition at line 411 of file codegen.hpp.

#define M_TLTU (   a,
  b,
  code 
)    M_RTYPE(0,a,b,0,code&3ff,0x33) /* trp a < b */

Definition at line 401 of file codegen.hpp.

#define M_TLTU_IMM (   a,
 
)    M_ITYPE(1,a,0x0b,b) /* trp a < b */

Definition at line 412 of file codegen.hpp.

#define M_TNE (   a,
  b,
  code 
)    M_RTYPE(0,a,b,0,code&3ff,0x36) /* trp a != b */

Definition at line 403 of file codegen.hpp.

#define M_TNE_IMM (   a,
 
)    M_ITYPE(1,a,0x0e,b) /* trp a != b */

Definition at line 414 of file codegen.hpp.

#define M_TRUNCDI (   a,
 
)    M_FP2(0x0d,FMT_D,a,c) /* dbl trunci */

Definition at line 502 of file codegen.hpp.

#define M_TRUNCDL (   a,
 
)    M_FP2(0x09,FMT_D,a,c) /* dbl truncl */

Definition at line 511 of file codegen.hpp.

#define M_TRUNCFI (   a,
 
)    M_FP2(0x0d,FMT_F,a,c) /* flt trunci */

Definition at line 501 of file codegen.hpp.

#define M_TRUNCFL (   a,
 
)    M_FP2(0x09,FMT_F,a,c) /* flt truncl */

Definition at line 510 of file codegen.hpp.

#define M_XOR (   a,
  b,
 
)    M_RTYPE(0,a,b,c,0,0x26) /* c = a ^ b */

Definition at line 455 of file codegen.hpp.

#define M_XOR_IMM (   a,
  b,
 
)    M_ITYPE(0x0e,a,c,b) /* c = a ^ b */

Definition at line 459 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 39 of file codegen.hpp.

#define PATCHER_CALL_INSTRUCTIONS   1 /* number of instructions */

Definition at line 76 of file codegen.hpp.

#define PATCHER_CALL_SIZE   1 * 4 /* size in bytes of a patcher call */

Definition at line 77 of file codegen.hpp.

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

Definition at line 79 of file codegen.hpp.

#define POINTERSHIFT   3

Definition at line 571 of file codegen.hpp.