Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #define fli_op 0x26
00038
00039
00040
00041 #define bcf_op 0x00
00042 #define bct_op 0x01
00043 #define bcfl_op 0x02
00044 #define bctl_op 0x03
00045
00046
00047 #define S_FMT (cop_op+s_fmt)
00048 #define D_FMT (cop_op+d_fmt)
00049 #define W_FMT (cop_op+w_fmt)
00050 #define E_FMT (cop_op+e_fmt)
00051 #define L_FMT (cop_op+l_fmt)
00052 #define Q_FMT (cop_op+q_fmt)
00053 #define PS_FMT (cop_op+ps_fmt)
00054
00055 #define CASE_STORES \
00056 case sb_op: \
00057 case sh_op: \
00058 case sw_op: \
00059 case sc_op: \
00060 case swl_op: \
00061 case swr_op: \
00062 case sd_op: \
00063 case swc1_op: \
00064 case sdc1_op: \
00065 case swc2_op: \
00066 case sdc2_op: \
00067 case sdl_op: \
00068 case sdr_op: \
00069 case scd_op
00070
00071
00072
00073 #define CASE_LOADS \
00074 case lb_op: \
00075 case lbu_op: \
00076 case lh_op: \
00077 case lhu_op: \
00078 case lw_op: \
00079 case lwu_op: \
00080 case lwl_op: \
00081 case lwr_op: \
00082 case ll_op: \
00083 case ld_op: \
00084 case ldl_op: \
00085 case ldr_op: \
00086 case lld_op: \
00087 case lwc1_op: \
00088 case ldc1_op: \
00089 case lwc2_op: \
00090 case ldc2_op
00091
00092
00093 #define CASE_FCMP \
00094 case fcmp_op+0: \
00095 case fcmp_op+1: \
00096 case fcmp_op+2: \
00097 case fcmp_op+3: \
00098 case fcmp_op+4: \
00099 case fcmp_op+5: \
00100 case fcmp_op+6: \
00101 case fcmp_op+7: \
00102 case fcmp_op+8: \
00103 case fcmp_op+9: \
00104 case fcmp_op+10: \
00105 case fcmp_op+11: \
00106 case fcmp_op+12: \
00107 case fcmp_op+13: \
00108 case fcmp_op+14: \
00109 case fcmp_op+15
00110
00111
00112 #define _is_inst_move(_inst) \
00113 (_inst.r_format.opcode == spec_op && \
00114 (_inst.r_format.func == addu_op || \
00115 _inst.r_format.func == daddu_op || \
00116 _inst.r_format.func == or_op) && \
00117 _inst.r_format.rt == 0)
00118
00119 #define _is_inst_uncondbr(_inst) \
00120 (_inst.i_format.opcode == beq_op && \
00121 _inst.i_format.rs == 0 && \
00122 _inst.i_format.rt == 0)
00123
00124
00125 #define _is_inst_branch_and_link(_inst) \
00126 (_inst.i_format.opcode == bcond_op && \
00127 (_inst.i_format.rt == bltzal_op || \
00128 _inst.i_format.rt == bgezal_op || \
00129 _inst.i_format.rt == bltzall_op || \
00130 _inst.i_format.rt == bgezall_op))
00131
00132
00133 #define _is_inst_branch(_inst) \
00134 (_inst.i_format.opcode == beq_op || \
00135 _inst.i_format.opcode == bne_op || \
00136 _inst.i_format.opcode == blez_op || \
00137 _inst.i_format.opcode == bgtz_op || \
00138 _inst.i_format.opcode == beql_op || \
00139 _inst.i_format.opcode == bnel_op || \
00140 _inst.i_format.opcode == blezl_op || \
00141 _inst.i_format.opcode == bgtzl_op || \
00142 (_inst.i_format.opcode == bcond_op && \
00143 (_inst.i_format.rt == bltz_op || \
00144 _inst.i_format.rt == bgez_op || \
00145 _inst.i_format.rt == bltzl_op || \
00146 _inst.i_format.rt == bgezl_op || \
00147 _inst.i_format.rt == bltzal_op || \
00148 _inst.i_format.rt == bgezal_op || \
00149 _inst.i_format.rt == bltzall_op || \
00150 _inst.i_format.rt == bgezall_op)) || \
00151 ((_inst.i_format.opcode == cop0_op || \
00152 _inst.i_format.opcode == cop1_op || \
00153 _inst.i_format.opcode == cop3_op || \
00154 _inst.i_format.opcode == cop2_op) && \
00155 _inst.i_format.rs == bc_op))