-
Notifications
You must be signed in to change notification settings - Fork 53
Closed as not planned
Closed as not planned
Copy link
Labels
epic-generatorDSL-based code generator for the interpreter(s)DSL-based code generator for the interpreter(s)
Description
Currently our DSL has two separate but similar bits of syntax for super- and macro instructions:
super(X) = A + B;
macro(X) = A + B;
These differ in that super() inserts some code between components:
<prologue>
{
<code for A>
}
NEXTOPARG();
next_instr++;
{
<code for B>
}
<epilogue>
whereas macro() doesn't (omitting NEXTOPARG(); next_instr++;).
(There are some other differences, in particular macros allow interspersing cache effects between the components.)
It turns out it is possible to rewrite any super-instruction of this form as a macro:
macro(X) = A + JOIN + B;
where JOIN is a micro-op defined roughly like this:
op(JOIN, (word/1 --)) {
oparg = _Py_OPARG(word);
}
Given the limited use we have for super-instructions and the code duplication in the code generator to handle both, this seems a nice win.
Note: Eventually we may need to bring super() back into the DSL, but for a different use case.
Metadata
Metadata
Assignees
Labels
epic-generatorDSL-based code generator for the interpreter(s)DSL-based code generator for the interpreter(s)