Package ghidra.pcode.emu.jit.gen.op
Interface FloatOpUnOpGen<T extends JitFloatUnOp>
- Type Parameters:
T- the class of p-code op node in the use-def graph
- All Known Implementing Classes:
FloatAbsOpGen,FloatCeilOpGen,FloatFloorOpGen,FloatNegOpGen,FloatRoundOpGen,FloatSqrtOpGen
An extension for floating-point unary operators
-
Nested Class Summary
Nested classes/interfaces inherited from interface ghidra.pcode.emu.jit.gen.op.OpGen
OpGen.DeadOpResult, OpGen.LiveOpResult, OpGen.OpResult -
Method Summary
Modifier and TypeMethodDescriptiondefault <THIS extends JitCompiledPassage>
OpGen.OpResultgenRun(Emitter<Emitter.Bot> em, Local<Types.TRef<THIS>> localThis, Local<Types.TInt> localCtxmod, Methods.RetReq<Types.TRef<JitCompiledPassage.EntryPoint>> retReq, JitCodeGenerator<THIS> gen, T op, JitControlFlowModel.JitBlock block, Scope scope) Emit bytecode into therunmethod.default booleanisSigned()Whether this operator is signed<N1 extends Emitter.Next,N0 extends Emitter.Ent<N1, Types.TDouble>>
Emitter<Emitter.Ent<N1, Types.TDouble>> opForDouble(Emitter<N0> em) Emit the JVM bytecode to perform the operator with double operands on the stack.<N1 extends Emitter.Next,N0 extends Emitter.Ent<N1, Types.TFloat>>
Emitter<Emitter.Ent<N1, Types.TFloat>> opForFloat(Emitter<N0> em) Emit the JVM bytecode to perform the operator with float operands on the stack.
-
Method Details
-
isSigned
default boolean isSigned()Description copied from interface:UnOpGenWhether this operator is signedIn many cases, the operator itself is not affected by the signedness of the operands; however, if size adjustments to the operands are needed, this can determine how those operands are extended.
- Specified by:
isSignedin interfaceUnOpGen<T extends JitFloatUnOp>- Returns:
- true for signed, false if not
-
opForFloat
<N1 extends Emitter.Next,N0 extends Emitter.Ent<N1, Emitter<Emitter.Ent<N1,Types.TFloat>> Types.TFloat>> opForFloat(Emitter<N0> em) Emit the JVM bytecode to perform the operator with float operands on the stack.- Type Parameters:
N1- the tail of the incoming stackN0- the incoming stack with the input operand on top- Parameters:
em- the emitter typed with the incoming stack- Returns:
- the emitter typed with the resulting stack, i.e., the tail with the result pushed
-
opForDouble
<N1 extends Emitter.Next,N0 extends Emitter.Ent<N1, Emitter<Emitter.Ent<N1,Types.TDouble>> Types.TDouble>> opForDouble(Emitter<N0> em) Emit the JVM bytecode to perform the operator with double operands on the stack.- Type Parameters:
N1- the tail of the incoming stackN0- the incoming stack with the input operand on top- Parameters:
em- the emitter typed with the incoming stack- Returns:
- the emitter typed with the resulting stack, i.e., the tail with the result pushed
-
genRun
default <THIS extends JitCompiledPassage> OpGen.OpResult genRun(Emitter<Emitter.Bot> em, Local<Types.TRef<THIS>> localThis, Local<Types.TInt> localCtxmod, Methods.RetReq<Types.TRef<JitCompiledPassage.EntryPoint>> retReq, JitCodeGenerator<THIS> gen, T op, JitControlFlowModel.JitBlock block, Scope scope) Description copied from interface:OpGenEmit bytecode into therunmethod.This method must emit the code needed to load any input operands, convert them to the appropriate type, perform the actual operation, and then if applicable, store the output operand. The implementations should delegate to
JitCodeGenerator.genReadToStack(Emitter, Local, JitVal, ghidra.pcode.emu.jit.analysis.JitType.SimpleJitType, Ext),JitCodeGenerator.genWriteFromStack(Emitter, Local, JitVar, ghidra.pcode.emu.jit.analysis.JitType.SimpleJitType, Ext, Scope)or similar for mp-int types.- Specified by:
genRunin interfaceOpGen<T extends JitFloatUnOp>- Type Parameters:
THIS- the type of the generated passage- Parameters:
em- the emitter typed with the empty stacklocalThis- a handle to the local holding thethisreferencelocalCtxmod- a handle to the local holdingctxmodretReq- an indication of what must be returned by thisJitCompiledPassage.run(int)method.gen- the code generatorop- the p-code op (use-def node) to translateblock- the basic block containing the p-code opscope- a scope for generating temporary local storage- Returns:
- the result of emitting the p-code op's bytecode
-