⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 decode2.c

📁 这个是LINUX下的GDB调度工具的源码
💻 C
📖 第 1 页 / 共 5 页
字号:
      case 72 : /* fall through */      case 73 : /* fall through */      case 74 : /* fall through */      case 75 : /* fall through */      case 76 : /* fall through */      case 77 : /* fall through */      case 78 : /* fall through */      case 79 : itype = M32R2F_INSN_ADDI; goto extract_sfmt_addi;      case 80 : /* fall through */      case 81 : itype = M32R2F_INSN_SRLI; goto extract_sfmt_slli;      case 82 : /* fall through */      case 83 : itype = M32R2F_INSN_SRAI; goto extract_sfmt_slli;      case 84 : /* fall through */      case 85 : itype = M32R2F_INSN_SLLI; goto extract_sfmt_slli;      case 87 :        {          unsigned int val = (((insn >> 0) & (1 << 0)));          switch (val)          {          case 0 : itype = M32R2F_INSN_MVTACHI_A; goto extract_sfmt_mvtachi_a;          case 1 : itype = M32R2F_INSN_MVTACLO_A; goto extract_sfmt_mvtachi_a;          default : itype = M32R2F_INSN_X_INVALID; goto extract_sfmt_empty;          }        }      case 88 : itype = M32R2F_INSN_RACH_DSI; goto extract_sfmt_rac_dsi;      case 89 : itype = M32R2F_INSN_RAC_DSI; goto extract_sfmt_rac_dsi;      case 90 : itype = M32R2F_INSN_MULWU1; goto extract_sfmt_mulwu1;      case 91 : itype = M32R2F_INSN_MACWU1; goto extract_sfmt_macwu1;      case 92 : itype = M32R2F_INSN_MACLH1; goto extract_sfmt_macwu1;      case 93 : itype = M32R2F_INSN_MSBLO; goto extract_sfmt_msblo;      case 94 : itype = M32R2F_INSN_SADD; goto extract_sfmt_sadd;      case 95 :        {          unsigned int val = (((insn >> 0) & (3 << 0)));          switch (val)          {          case 0 : itype = M32R2F_INSN_MVFACHI_A; goto extract_sfmt_mvfachi_a;          case 1 : itype = M32R2F_INSN_MVFACLO_A; goto extract_sfmt_mvfachi_a;          case 2 : itype = M32R2F_INSN_MVFACMI_A; goto extract_sfmt_mvfachi_a;          default : itype = M32R2F_INSN_X_INVALID; goto extract_sfmt_empty;          }        }      case 96 : /* fall through */      case 97 : /* fall through */      case 98 : /* fall through */      case 99 : /* fall through */      case 100 : /* fall through */      case 101 : /* fall through */      case 102 : /* fall through */      case 103 : /* fall through */      case 104 : /* fall through */      case 105 : /* fall through */      case 106 : /* fall through */      case 107 : /* fall through */      case 108 : /* fall through */      case 109 : /* fall through */      case 110 : /* fall through */      case 111 : itype = M32R2F_INSN_LDI8; goto extract_sfmt_ldi8;      case 112 :        {          unsigned int val = (((insn >> 7) & (15 << 1)) | ((insn >> 0) & (1 << 0)));          switch (val)          {          case 0 : itype = M32R2F_INSN_NOP; goto extract_sfmt_nop;          case 2 : /* fall through */          case 3 : itype = M32R2F_INSN_SETPSW; goto extract_sfmt_setpsw;          case 4 : /* fall through */          case 5 : itype = M32R2F_INSN_CLRPSW; goto extract_sfmt_clrpsw;          case 9 : itype = M32R2F_INSN_SC; goto extract_sfmt_sc;          case 11 : itype = M32R2F_INSN_SNC; goto extract_sfmt_sc;          case 16 : /* fall through */          case 17 : itype = M32R2F_INSN_BCL8; goto extract_sfmt_bcl8;          case 18 : /* fall through */          case 19 : itype = M32R2F_INSN_BNCL8; goto extract_sfmt_bcl8;          case 24 : /* fall through */          case 25 : itype = M32R2F_INSN_BC8; goto extract_sfmt_bc8;          case 26 : /* fall through */          case 27 : itype = M32R2F_INSN_BNC8; goto extract_sfmt_bc8;          case 28 : /* fall through */          case 29 : itype = M32R2F_INSN_BL8; goto extract_sfmt_bl8;          case 30 : /* fall through */          case 31 : itype = M32R2F_INSN_BRA8; goto extract_sfmt_bra8;          default : itype = M32R2F_INSN_X_INVALID; goto extract_sfmt_empty;          }        }      case 113 : /* fall through */      case 114 : /* fall through */      case 115 : /* fall through */      case 116 : /* fall through */      case 117 : /* fall through */      case 118 : /* fall through */      case 119 : /* fall through */      case 120 : /* fall through */      case 121 : /* fall through */      case 122 : /* fall through */      case 123 : /* fall through */      case 124 : /* fall through */      case 125 : /* fall through */      case 126 : /* fall through */      case 127 :        {          unsigned int val = (((insn >> 8) & (15 << 0)));          switch (val)          {          case 1 : itype = M32R2F_INSN_SETPSW; goto extract_sfmt_setpsw;          case 2 : itype = M32R2F_INSN_CLRPSW; goto extract_sfmt_clrpsw;          case 8 : itype = M32R2F_INSN_BCL8; goto extract_sfmt_bcl8;          case 9 : itype = M32R2F_INSN_BNCL8; goto extract_sfmt_bcl8;          case 12 : itype = M32R2F_INSN_BC8; goto extract_sfmt_bc8;          case 13 : itype = M32R2F_INSN_BNC8; goto extract_sfmt_bc8;          case 14 : itype = M32R2F_INSN_BL8; goto extract_sfmt_bl8;          case 15 : itype = M32R2F_INSN_BRA8; goto extract_sfmt_bra8;          default : itype = M32R2F_INSN_X_INVALID; goto extract_sfmt_empty;          }        }      case 132 : itype = M32R2F_INSN_CMPI; goto extract_sfmt_cmpi;      case 133 : itype = M32R2F_INSN_CMPUI; goto extract_sfmt_cmpi;      case 134 :        {          unsigned int val = (((insn >> -8) & (3 << 0)));          switch (val)          {          case 0 : itype = M32R2F_INSN_SAT; goto extract_sfmt_sat;          case 2 : itype = M32R2F_INSN_SATH; goto extract_sfmt_satb;          case 3 : itype = M32R2F_INSN_SATB; goto extract_sfmt_satb;          default : itype = M32R2F_INSN_X_INVALID; goto extract_sfmt_empty;          }        }      case 136 : itype = M32R2F_INSN_ADDV3; goto extract_sfmt_addv3;      case 138 : itype = M32R2F_INSN_ADD3; goto extract_sfmt_add3;      case 140 : itype = M32R2F_INSN_AND3; goto extract_sfmt_and3;      case 141 : itype = M32R2F_INSN_XOR3; goto extract_sfmt_and3;      case 142 : itype = M32R2F_INSN_OR3; goto extract_sfmt_or3;      case 144 :        {          unsigned int val = (((insn >> -13) & (3 << 0)));          switch (val)          {          case 0 : itype = M32R2F_INSN_DIV; goto extract_sfmt_div;          case 2 : itype = M32R2F_INSN_DIVH; goto extract_sfmt_div;          case 3 : itype = M32R2F_INSN_DIVB; goto extract_sfmt_div;          default : itype = M32R2F_INSN_X_INVALID; goto extract_sfmt_empty;          }        }      case 145 :        {          unsigned int val = (((insn >> -13) & (3 << 0)));          switch (val)          {          case 0 : itype = M32R2F_INSN_DIVU; goto extract_sfmt_div;          case 2 : itype = M32R2F_INSN_DIVUH; goto extract_sfmt_div;          case 3 : itype = M32R2F_INSN_DIVUB; goto extract_sfmt_div;          default : itype = M32R2F_INSN_X_INVALID; goto extract_sfmt_empty;          }        }      case 146 :        {          unsigned int val = (((insn >> -13) & (3 << 0)));          switch (val)          {          case 0 : itype = M32R2F_INSN_REM; goto extract_sfmt_div;          case 2 : itype = M32R2F_INSN_REMH; goto extract_sfmt_div;          case 3 : itype = M32R2F_INSN_REMB; goto extract_sfmt_div;          default : itype = M32R2F_INSN_X_INVALID; goto extract_sfmt_empty;          }        }      case 147 :        {          unsigned int val = (((insn >> -13) & (3 << 0)));          switch (val)          {          case 0 : itype = M32R2F_INSN_REMU; goto extract_sfmt_div;          case 2 : itype = M32R2F_INSN_REMUH; goto extract_sfmt_div;          case 3 : itype = M32R2F_INSN_REMUB; goto extract_sfmt_div;          default : itype = M32R2F_INSN_X_INVALID; goto extract_sfmt_empty;          }        }      case 152 : itype = M32R2F_INSN_SRL3; goto extract_sfmt_sll3;      case 154 : itype = M32R2F_INSN_SRA3; goto extract_sfmt_sll3;      case 156 : itype = M32R2F_INSN_SLL3; goto extract_sfmt_sll3;      case 159 : itype = M32R2F_INSN_LDI16; goto extract_sfmt_ldi16;      case 160 : itype = M32R2F_INSN_STB_D; goto extract_sfmt_stb_d;      case 162 : itype = M32R2F_INSN_STH_D; goto extract_sfmt_sth_d;      case 164 : itype = M32R2F_INSN_ST_D; goto extract_sfmt_st_d;      case 166 : itype = M32R2F_INSN_BSET; goto extract_sfmt_bset;      case 167 : itype = M32R2F_INSN_BCLR; goto extract_sfmt_bset;      case 168 : itype = M32R2F_INSN_LDB_D; goto extract_sfmt_ldb_d;      case 169 : itype = M32R2F_INSN_LDUB_D; goto extract_sfmt_ldb_d;      case 170 : itype = M32R2F_INSN_LDH_D; goto extract_sfmt_ldh_d;      case 171 : itype = M32R2F_INSN_LDUH_D; goto extract_sfmt_ldh_d;      case 172 : itype = M32R2F_INSN_LD_D; goto extract_sfmt_ld_d;      case 176 : itype = M32R2F_INSN_BEQ; goto extract_sfmt_beq;      case 177 : itype = M32R2F_INSN_BNE; goto extract_sfmt_beq;      case 184 : itype = M32R2F_INSN_BEQZ; goto extract_sfmt_beqz;      case 185 : itype = M32R2F_INSN_BNEZ; goto extract_sfmt_beqz;      case 186 : itype = M32R2F_INSN_BLTZ; goto extract_sfmt_beqz;      case 187 : itype = M32R2F_INSN_BGEZ; goto extract_sfmt_beqz;      case 188 : itype = M32R2F_INSN_BLEZ; goto extract_sfmt_beqz;      case 189 : itype = M32R2F_INSN_BGTZ; goto extract_sfmt_beqz;      case 220 : itype = M32R2F_INSN_SETH; goto extract_sfmt_seth;      case 224 : /* fall through */      case 225 : /* fall through */      case 226 : /* fall through */      case 227 : /* fall through */      case 228 : /* fall through */      case 229 : /* fall through */      case 230 : /* fall through */      case 231 : /* fall through */      case 232 : /* fall through */      case 233 : /* fall through */      case 234 : /* fall through */      case 235 : /* fall through */      case 236 : /* fall through */      case 237 : /* fall through */      case 238 : /* fall through */      case 239 : itype = M32R2F_INSN_LD24; goto extract_sfmt_ld24;      case 240 : /* fall through */      case 241 : /* fall through */      case 242 : /* fall through */      case 243 : /* fall through */      case 244 : /* fall through */      case 245 : /* fall through */      case 246 : /* fall through */      case 247 : /* fall through */      case 248 : /* fall through */      case 249 : /* fall through */      case 250 : /* fall through */      case 251 : /* fall through */      case 252 : /* fall through */      case 253 : /* fall through */      case 254 : /* fall through */      case 255 :        {          unsigned int val = (((insn >> 8) & (7 << 0)));          switch (val)          {          case 0 : itype = M32R2F_INSN_BCL24; goto extract_sfmt_bcl24;          case 1 : itype = M32R2F_INSN_BNCL24; goto extract_sfmt_bcl24;          case 4 : itype = M32R2F_INSN_BC24; goto extract_sfmt_bc24;          case 5 : itype = M32R2F_INSN_BNC24; goto extract_sfmt_bc24;          case 6 : itype = M32R2F_INSN_BL24; goto extract_sfmt_bl24;          case 7 : itype = M32R2F_INSN_BRA24; goto extract_sfmt_bra24;          default : itype = M32R2F_INSN_X_INVALID; goto extract_sfmt_empty;          }        }      default : itype = M32R2F_INSN_X_INVALID; goto extract_sfmt_empty;      }    }  }  /* The instruction has been decoded, now extract the fields.  */ extract_sfmt_empty:  {    const IDESC *idesc = &m32r2f_insn_data[itype];#define FLD(f) abuf->fields.fmt_empty.f  /* Record the fields for the semantic handler.  */  TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_empty", (char *) 0));#undef FLD    return idesc;  } extract_sfmt_add:  {    const IDESC *idesc = &m32r2f_insn_data[itype];    CGEN_INSN_INT insn = entire_insn;#define FLD(f) abuf->fields.sfmt_add.f    UINT f_r1;    UINT f_r2;    f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);    f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);  /* Record the fields for the semantic handler.  */  FLD (f_r1) = f_r1;  FLD (f_r2) = f_r2;  FLD (i_dr) = & CPU (h_gr)[f_r1];  FLD (i_sr) = & CPU (h_gr)[f_r2];  TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_add", "f_r1 0x%x", 'x', f_r1, "f_r2 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0));#if WITH_PROFILE_MODEL_P  /* Record the fields for profiling.  */  if (PROFILE_MODEL_P (current_cpu))    {      FLD (in_dr) = f_r1;      FLD (in_sr) = f_r2;      FLD (out_dr) = f_r1;    }#endif#undef FLD    return idesc;  } extract_sfmt_add3:  {    const IDESC *idesc = &m32r2f_insn_data[itype];    CGEN_INSN_INT insn = entire_insn;#define FLD(f) abuf->fields.sfmt_add3.f    UINT f_r1;    UINT f_r2;    INT f_simm16;    f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4);    f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);    f_simm16 = EXTRACT_MSB0_INT (insn, 32, 16, 16);  /* Record the fields for the semantic handler.  */  FLD (f_simm16) = f_simm16;  FLD (f_r2) = f_r2;  FLD (f_r1) = f_r1;  FLD (i_sr) = & CPU (h_gr)[f_r2];  FLD (i_dr) = & CPU (h_gr)[f_r1];  TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_add3", "f_simm16 0x%x", 'x', f_simm16, "f_r2 0x%x", 'x', f_r2, "f_r1 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, (char *) 0));#if WITH_PROFILE_MODEL_P  /* Record the fields for profiling.  */  if (PROFILE_MODEL_P (current_cpu))    {      FLD (in_sr) = f_r2;      FLD (out_dr) = f_r1;    }#endif#undef FLD    return idesc;  } extract_sfmt_and3:  {    const IDESC *idesc = &m32r2f_insn_data[itype];    CGEN_INSN_INT insn = entire_insn;#define FLD(f) abuf->fields.sfmt_and3.f    UINT f_r1;    UINT f_r2;    UINT f_uimm16;    f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4);    f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);    f_uimm16 = EXTRACT_MSB0_UINT (insn, 32, 16, 16);  /* Record the fields for the semantic handler.  */  FLD (f_r2) = f_r2;  FLD (f_uimm16) = f_uimm16;  FLD (f_r1) = f_r1;  FLD (i_sr) = & CPU (h_gr)[f_r2];  FLD (i_dr) = & CPU (h_gr)[f_r1];  TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_and3", "f_r2 0x%x", 'x', f_r2, "f_uimm16 0x%x", 'x', f_uimm16, "f_r1 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, (char *) 0));#if WITH_PROFILE_MODEL_P  /* Record the fields for profiling.  */  if (PROFILE_MODEL_P (current_cpu))    {      FLD (in_sr) = f_r2;      FLD (out_dr) = f_r1;    }#endif#undef FLD

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -