* Added NOP opcode
This commit is contained in:
Aaron Giles 2008-06-06 17:13:53 +00:00
parent e40a5aa32d
commit 40d2b88ef5
6 changed files with 32 additions and 2 deletions

View File

@ -415,8 +415,9 @@ static void drcbec_generate(drcbe_state *drcbe, drcuml_block *block, const drcum
drclabel_set_codeptr(drcbe->labels, inst->param[0].value, (drccodeptr)dst);
break;
/* ignore COMMENT opcodes */
/* ignore COMMENT and NOP opcodes */
case DRCUML_OP_COMMENT:
case DRCUML_OP_NOP:
break;
/* when we hit a MAPVAR opcode, log the change for the current PC */
@ -435,7 +436,7 @@ static void drcbec_generate(drcbe_state *drcbe, drcuml_block *block, const drcum
dst->inst = (drcbec_instruction *)drclabel_get_codeptr(drcbe->labels, inst->param[0].value, fixup_label, dst);
dst++;
break;
/* generically handle everything else */
default:

View File

@ -389,6 +389,7 @@ static x86code *op_label(drcbe_state *drcbe, x86code *dst, const drcuml_instruct
static x86code *op_comment(drcbe_state *drcbe, x86code *dst, const drcuml_instruction *inst);
static x86code *op_mapvar(drcbe_state *drcbe, x86code *dst, const drcuml_instruction *inst);
static x86code *op_nop(drcbe_state *drcbe, x86code *dst, const drcuml_instruction *inst);
static x86code *op_debug(drcbe_state *drcbe, x86code *dst, const drcuml_instruction *inst);
static x86code *op_exit(drcbe_state *drcbe, x86code *dst, const drcuml_instruction *inst);
static x86code *op_hashjmp(drcbe_state *drcbe, x86code *dst, const drcuml_instruction *inst);
@ -472,6 +473,7 @@ static const opcode_table_entry opcode_table_source[] =
{ DRCUML_OP_MAPVAR, op_mapvar }, /* MAPVAR mapvar,value */
/* Control Flow Operations */
{ DRCUML_OP_NOP, op_nop }, /* NOP */
{ DRCUML_OP_DEBUG, op_debug }, /* DEBUG pc */
{ DRCUML_OP_EXIT, op_exit }, /* EXIT src1[,c] */
{ DRCUML_OP_HASHJMP, op_hashjmp }, /* HASHJMP mode,pc,handle */
@ -3068,6 +3070,17 @@ static x86code *op_mapvar(drcbe_state *drcbe, x86code *dst, const drcuml_instruc
CONTROL FLOW OPCODES
***************************************************************************/
/*-------------------------------------------------
op_nop - process a NOP opcode
-------------------------------------------------*/
static x86code *op_nop(drcbe_state *drcbe, x86code *dst, const drcuml_instruction *inst)
{
/* nothing */
return dst;
}
/*-------------------------------------------------
op_debug - process a DEBUG opcode
-------------------------------------------------*/

View File

@ -275,6 +275,7 @@ static x86code *op_label(drcbe_state *drcbe, x86code *dst, const drcuml_instruct
static x86code *op_comment(drcbe_state *drcbe, x86code *dst, const drcuml_instruction *inst);
static x86code *op_mapvar(drcbe_state *drcbe, x86code *dst, const drcuml_instruction *inst);
static x86code *op_nop(drcbe_state *drcbe, x86code *dst, const drcuml_instruction *inst);
static x86code *op_debug(drcbe_state *drcbe, x86code *dst, const drcuml_instruction *inst);
static x86code *op_exit(drcbe_state *drcbe, x86code *dst, const drcuml_instruction *inst);
static x86code *op_hashjmp(drcbe_state *drcbe, x86code *dst, const drcuml_instruction *inst);
@ -358,6 +359,7 @@ static const opcode_table_entry opcode_table_source[] =
{ DRCUML_OP_MAPVAR, op_mapvar }, /* MAPVAR mapvar,value */
/* Control Flow Operations */
{ DRCUML_OP_NOP, op_nop }, /* NOP */
{ DRCUML_OP_DEBUG, op_debug }, /* DEBUG pc */
{ DRCUML_OP_EXIT, op_exit }, /* EXIT src1[,c] */
{ DRCUML_OP_HASHJMP, op_hashjmp }, /* HASHJMP mode,pc,handle */
@ -3119,6 +3121,17 @@ static x86code *op_mapvar(drcbe_state *drcbe, x86code *dst, const drcuml_instruc
CONTROL FLOW OPCODES
***************************************************************************/
/*-------------------------------------------------
op_nop - process a NOP opcode
-------------------------------------------------*/
static x86code *op_nop(drcbe_state *drcbe, x86code *dst, const drcuml_instruction *inst)
{
/* nothing */
return dst;
}
/*-------------------------------------------------
op_debug - process a DEBUG opcode
-------------------------------------------------*/

View File

@ -192,6 +192,7 @@ static const drcuml_opcode_info opcode_info_source[] =
OPINFO2(MAPVAR, "mapvar", 4, FALSE, NONE, NONE, NONE, PINFO(OUT, OP, MVAR), PINFO(IN, OP, IMV))
/* Control Flow Operations */
OPINFO0(NOP, "nop", 4, FALSE, NONE, NONE, NONE)
OPINFO1(DEBUG, "debug", 4, FALSE, NONE, NONE, ALL, PINFO(IN, OP, IANY))
OPINFO1(EXIT, "exit", 4, TRUE, NONE, NONE, ALL, PINFO(IN, OP, IANY))
OPINFO3(HASHJMP, "hashjmp", 4, FALSE, NONE, NONE, ALL, PINFO(IN, OP, IANY), PINFO(IN, OP, IANY), PINFO(IN, OP, HAND))

View File

@ -193,6 +193,7 @@ enum _drcuml_opcode
DRCUML_OP_MAPVAR, /* MAPVAR mapvar,value */
/* Control Flow Operations */
DRCUML_OP_NOP, /* NOP */
DRCUML_OP_DEBUG, /* DEBUG pc */
DRCUML_OP_EXIT, /* EXIT src1[,c] */
DRCUML_OP_HASHJMP, /* HASHJMP mode,pc,handle */

View File

@ -76,6 +76,7 @@
/* ----- Control Flow Operations ----- */
#define UML_NOP(block) do { drcuml_block_append_0(block, DRCUML_OP_NOP, 4, IF_ALWAYS); } while (0)
#define UML_DEBUG(block, pc) do { drcuml_block_append_1(block, DRCUML_OP_DEBUG, 4, IF_ALWAYS, pc); } while (0)
#define UML_EXIT(block, param) do { drcuml_block_append_1(block, DRCUML_OP_EXIT, 4, IF_ALWAYS, param); } while (0)
#define UML_EXITc(block, cond, param) do { drcuml_block_append_1(block, DRCUML_OP_EXIT, 4, cond, param); } while (0)