-
Notifications
You must be signed in to change notification settings - Fork 49
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
What should the family be of a super-instruction in our DSL? #495
Comments
For now I've solved this by using the first sub-instruction of a super-instruction. For example, if we have a super-instruction It follows that only However, there may be a more fundamental constraint. If specialization replaces a single instruction with a more specialized version (e.g. Right now the super-instruction syntax is only designed to easily define simple compositions like
Edit: The new syntax should allow specifying stack and cache effects for the new instruction, so it would more likely be a variation of this:
|
Possibly the info should be rolled into the
If we did this for all specialized instructions, we wouldn't even need family definitions any more. E.g.
|
It looks like "families" have a double meaning: they server to map specialized/super instructions back to their "base" instruction, and they are used to double check that all family members have the same cache and stack effects. From the DSL spec it appeared that the latter was the most important, so I only implemented that, but found out that super-instructions are also in the families as defined by opcode.py (
_specializations
).ISTM that super-instructions shouldn't be required to have the same stack/cache effects as their first constituent -- their effects should be the combination of all constituents. The table that maps these back to their base can be generated separately from the super-instruction definitions (e.g.,
LOAD_FAST__LOAD_CONST
clearly maps toLOAD_FAST
).I also finally realized there are some pseudo-super-instructions (e.g.
BINARY_OP_INPLACE_ADD_UNICODE
). These behave like super-instructions in that they skip the next opcode, but are not generated usingsuper(X) = Y + Z;
-- instead, they use an explicit code block. We might be able to define these as proper super-instructions constructed from constituent parts where the second part is a dummy that ends up shrinking the stack but does nothing else. I'll play with this.Sorry for the ramble. Thanks to @brandtbucher for clearing up some of my confusion.
The text was updated successfully, but these errors were encountered: