-
Notifications
You must be signed in to change notification settings - Fork 810
Add separate experimental DXIL op table using high OpCode bit #7947
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
base: main
Are you sure you want to change the base?
Conversation
And fix disassembler.
|
✅ With the latest revision this PR passed the Python code formatter. |
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
| db_dxil_enum_value(n, v, d) for v, n, d in valNameDocTuples | ||
| ] # Note transmutation | ||
| self.is_internal = False # whether this is never serialized | ||
| self.last_value_name = None # optional last value name for dense enums |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This replaces custom enum name matching code in hctdb_instrhelp.py
| ] # Note transmutation | ||
| self.is_internal = False # whether this is never serialized | ||
| self.last_value_name = None # optional last value name for dense enums | ||
| self.dxil_version_info = {} # version info for this enum |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This replaces single dxil-level global map which was used for OpCode and OpCodeClass. It makes more sense to be localized to the enum, which allows it to be supported for non-core ops as well.
Use for OpCodeClass dropped because that is an internal/not stable enumeration where such versioned sizes could not even be used for anything.
| self.is_internal = False # whether this is never serialized | ||
| self.last_value_name = None # optional last value name for dense enums | ||
| self.dxil_version_info = {} # version info for this enum | ||
| self.postfix_lines = [] # optional postfix to include inside enum declaration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the mechanism used to append experimental opcode definitions to the core OpCode enum, while keeping them separate from the dense core enumerated values. It also allows us to add a stable OpCode::Invalid value.
This table is already required to be sorted this way.
damyanp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I think you should try and get a review from someone with some more hands-on experience of how this works than I have.
To prove I really read it though:
I'm surprised by the amount of changes in hctdb.py, but since the generated code hasn't changed in surprising ways I think we can be confident that those changes are ok.
There were some complicating changes needed that contributed:
|
Implements: https://github.com/microsoft/hlsl-specs/blob/main/proposals/0052-experimental-dxil-ops.md
This change adds support for an experimental DXIL operation table, which provides an independent numeric space from the main OpCode set.
It adds support for indexing into OpCode tables using the high 16-bits as the table index, and the low 16-bits as the index into the OpCode table.
While the fundamental change could support more tables for individual experimental features or extensions, it's currently limited to tables
0forCoreOpsand0x8000forExperimentalOpswithout additional work to unlock more tables. This maps to the existing opcodes forCoreOpsand opcodes with the high bit set forExperimentalOps.