-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CodeGen: Clean up instruction emitting methods #12178
Comments
cc @dotnet/jit-contrib, @tannergooding @mikedn |
Just a note. I think the current exception here is The HWIntrinsic feature tries to exclusively use the |
Yeah, and for some the prefix is actually
Those
There's also the
Or they should take only the GenTree that's truly needed, in the case of memory operands that's usually the address tree and not the entire indir.
Also, the emitter interface is a complete mess:
|
Another inconsistency is that there are a number of methods that predict the size of an instruction (e.g.
|
Some smaller XARCH issues that I found working on dotnet/coreclr#25050:
|
The conventions for organization and naming of the methods that emit instructions are unclear and inconsistent. I believe that the existing/intended conventions are:
CodeGen
that start withgen
are concerned with generating code for a class ofGenTree
operators, or shared functionality across operators that isn't specific to instruction encodings.CodeGen
that start withinst
are concerned with emitting (usually) single instructions of a given form, generally specified by the suffix of theinst
method:RV
means "register value"IV
means "immediate value"TT
means aGenTree
node that's a memory or register operand (though it may actually only be used for memory operands?)inst_TT_RV
has two operands: One of which is aGenTree
and the other of which is a register.emitter
that start withemitIns
are responsible for emitting a single instruction with a given format, e.g.emitIns_R_AR_I
emits an instruction with a register operand, an address operand and an immediate operand (though the address is expressed by passing the base register and offset, and doesn't support an index)emitter
shouldn't takeGenTree
nodes, though many do: the handling of general addressing modes is done inemitHandleMemOp
, and its relatives that take aGenTreeIndir
, and the handling of binary instructions is done inemitInsBinary
that takesGenTree
nodes.category:implementation
theme:jit-coding-style
skill-level:intermediate
cost:large
The text was updated successfully, but these errors were encountered: