Package ghidra.pcode.emu.jit
Class JitPassage.NopPcodeOp
java.lang.Object
ghidra.program.model.pcode.PcodeOp
ghidra.pcode.emu.jit.JitPassage.DecodedPcodeOp
ghidra.pcode.emu.jit.JitPassage.NopPcodeOp
- Enclosing class:
JitPassage
A synthetic p-code op meant to encode "no operation"
P-code does not have a NOP opcode, because there's usually no reason to produce such. A NOP machine instruction just produces an empty list of p-code ops, denoting "no operation." However, for bookkeeping purposes in our JIT translator, we occasionally need some op to hold an important place, but that op needs to do nothing. We use this in two situations:
- An instruction (possibly because of an inject) that does nothing. Yes, essentially a NOP
machine instruction. Because another op may target this instruction, and
JitPassage.Branch
es need to target a p-code op, we synthesize a p-code "nop" to hold that position. The alternative is to figure out what op immediately follows the branch target, but such an op may not have been decoded, yet. It's easier just to synthesize the nop. - A p-code branch to the end of an instruction. Most often a slaspec author that means to
skip the remainder of an instruction will use
goto inst_next
; however, because of sub-table structuring and/or personal preferences, sometimes we seegoto <end>;
where<end>
is at the end of the instruction, and thus, no p-code op actually follows it. We essentially have the same situation and the NOP machine instruction where we can either synthesize a placeholder nop, or else we have to figure out what op does (or will) actually follow the label.
-
Field Summary
Fields inherited from class ghidra.program.model.pcode.PcodeOp
BOOL_AND, BOOL_NEGATE, BOOL_OR, BOOL_XOR, BRANCH, BRANCHIND, CALL, CALLIND, CALLOTHER, CAST, CBRANCH, COPY, CPOOLREF, EXTRACT, FLOAT_ABS, FLOAT_ADD, FLOAT_CEIL, FLOAT_DIV, FLOAT_EQUAL, FLOAT_FLOAT2FLOAT, FLOAT_FLOOR, FLOAT_INT2FLOAT, FLOAT_LESS, FLOAT_LESSEQUAL, FLOAT_MULT, FLOAT_NAN, FLOAT_NEG, FLOAT_NOTEQUAL, FLOAT_ROUND, FLOAT_SQRT, FLOAT_SUB, FLOAT_TRUNC, INDIRECT, INSERT, INT_2COMP, INT_ADD, INT_AND, INT_CARRY, INT_DIV, INT_EQUAL, INT_LEFT, INT_LESS, INT_LESSEQUAL, INT_MULT, INT_NEGATE, INT_NOTEQUAL, INT_OR, INT_REM, INT_RIGHT, INT_SBORROW, INT_SCARRY, INT_SDIV, INT_SEXT, INT_SLESS, INT_SLESSEQUAL, INT_SREM, INT_SRIGHT, INT_SUB, INT_XOR, INT_ZEXT, LOAD, LZCOUNT, MULTIEQUAL, NEW, PCODE_MAX, PIECE, POPCOUNT, PTRADD, PTRSUB, RETURN, SEGMENTOP, STORE, SUBPIECE, UNIMPLEMENTED
-
Constructor Summary
ConstructorsConstructorDescriptionNopPcodeOp
(JitPassage.AddrCtx at, int seq) Construct a synthetic p-code "nop" -
Method Summary
Methods inherited from class ghidra.pcode.emu.jit.JitPassage.DecodedPcodeOp
getAt, getContext, getCounter, isInstructionStart
Methods inherited from class ghidra.program.model.pcode.PcodeOp
decode, encodeRaw, getBasicIter, getInput, getInputs, getInsertIter, getMnemonic, getMnemonic, getNumInputs, getOpcode, getOpcode, getOutput, getParent, getSeqnum, getSlot, hashCode, insertInput, isAssignment, isCommutative, isCommutative, isDead, removeInput, setInput, setOpcode, setOrder, setOutput, setTime, toString
-
Constructor Details
-
NopPcodeOp
Construct a synthetic p-code "nop"- Parameters:
at
- the address-context pair where the op was generatedseq
- the sequence where the nop is inserted. For machine-code NOP, this should be 0. For a branch to the end of an instruction, this should be the next sequence number (so that the branch targets this nop)
-