-
Notifications
You must be signed in to change notification settings - Fork 813
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
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. |
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:
|
bogner
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.
While I don't really see the use case for 65000 different op tables, the logic here all looks correct. LGTM with a couple of fairly minor comments.
db_dxil_enum_value constructor arg order made consistent with db_dxil_enum constructor's valNameDocTuples arg. Move dxil_version_info into enum, as it tracks version markers for that enum. Removed version tracking for OpCodeClass because it didn't make sense and wasn't really usable (not stable, internal compiler enum). This causes a change in DxilConstants.h which removes these unused enum values. db_dxil_enum.add_value to construct, add, and return new enum value. Removed build_indices, adding to *_idx maps in add_enum_type and new add_inst now used by add_dxil_op and related functions. They show up in the index immediately, without having to call build_indices() to update multiple times during initialization.
…tions Inside populate_dxil_operations, use local assigned add_dxil_op, reserve_dxil_op_range, and set_op_count_for_version for initial NFC change, which will minimize changes when moving to DXIL opcode tables.
This change creates separate lists for llvm instructions and dxil operations, and adds accessors for these.
…il-op-tables-refactor
…xil-op-tables-refactor
- db_dxil_op_table manages dxil op lists, build ops using table now. - split off llvm instruction list, use generators for supersets, remove unused accessors (get_instr_by_llvm_name, get_dxil_insts), cleaned references. - Move OpCodeClass verification to verify_dxil_op_classes, with a few additions. Enable with exception for known conflict that's fortunately not serious. Fixed conflicts in RayQuery and HitObject accessors, which fortunately will cause no DXIL differences. - consistency improvements for enums - add to indexes when adding insts or enums
80c1813 to
c51b44b
Compare
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.Now, db_dxil_op_table manages dxil op lists, and DXIL ops are built using table methods.