-
Notifications
You must be signed in to change notification settings - Fork 630
Use compressed grammar tables for core instructions and operands #6107
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b916114 to
0948aff
Compare
0948aff to
06db5e2
Compare
Use a new 'utils/ggt.py' script to generate the compressed tables.
- The new tables are created at build time, and there is one static
global table for each of the following:
- a strings table
- an instruction description table, sorted by opcode
Each entry is a spvtools::InstructionDesc object.
- an instruction name to opcode table, sorted by string name
This includes aliases.
- an operand description table, sorted by (operand type, operand value)
Each entry is a spvtools::OperandDesc object.
- an operand name table, sorted by (operand type, string name)
This includes aliases.
- a table of string aliases
- a table of capabilities
- a table of extensions
- Entries in the tables use IndexRanges to refer to sequences of
objects in one of the other tables.
- A string encoded as an IndexRange into the global strings table.
- A sequence of capabilities is encoded as an IndexRange into
the capabilities table.
- A sequence of extensions is encoded as an IndexRange into
the extensions table.
- A sequence of aliases is encoded as an IndexRange into
the aliases table.
- Each entry in the aliases table is an IndexRange into the
global string table.
- The InstructionDesc object has scalar values such as opcode,
hasResult, hasValue, and uses IndexRanges to express the
opcode name, aliases, operands, capabilities, operands, and
extensions.
- The OperandDesc object has scalar values such as enum value,
and uses IndexRanges to express the operand name, aliases, operands,
capabilities, operands, and extensions.
Remaining work:
- Use compressed tables for extension enums and extended instruction
sets.
- At that point, the old utils/generate_grammar_tables.py will be
obsolete and we can move ggt.py into it.
Bug: crbug.com/413723100
06db5e2 to
bd1b7a2
Compare
alan-baker
requested changes
Apr 30, 2025
Contributor
alan-baker
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.
Looks very nice overall.
- fix typos - to test for failure check SPV_SUCCESS != ... - fix formatting Co-authored-by: alan-baker <[email protected]>
c4c7ca0 to
71e3ec6
Compare
alan-baker
approved these changes
Apr 30, 2025
wooyoungqcom
pushed a commit
to CodeLinaro/SPIRV-Tools
that referenced
this pull request
May 5, 2025
…onosGroup#6107) * Use compressed grammar tables for core instructions and operands Use a new 'utils/ggt.py' script to generate the compressed tables. - The new tables are created at build time, and there is one static global table for each of the following: - a strings table - an instruction description table, sorted by opcode Each entry is a spvtools::InstructionDesc object. - an instruction name to opcode table, sorted by string name This includes aliases. - an operand description table, sorted by (operand type, operand value) Each entry is a spvtools::OperandDesc object. - an operand name table, sorted by (operand type, string name) This includes aliases. - a table of string aliases - a table of capabilities - a table of extensions - Entries in the tables use IndexRanges to refer to sequences of objects in one of the other tables. - A string encoded as an IndexRange into the global strings table. - A sequence of capabilities is encoded as an IndexRange into the capabilities table. - A sequence of extensions is encoded as an IndexRange into the extensions table. - A sequence of aliases is encoded as an IndexRange into the aliases table. - Each entry in the aliases table is an IndexRange into the global string table. - The InstructionDesc object has scalar values such as opcode, hasResult, hasValue, and uses IndexRanges to express the opcode name, aliases, operands, capabilities, operands, and extensions. - The OperandDesc object has scalar values such as enum value, and uses IndexRanges to express the operand name, aliases, operands, capabilities, operands, and extensions. Remaining work: - Use compressed tables for extension enums and extended instruction sets. - At that point, the old utils/generate_grammar_tables.py will be obsolete and we can move ggt.py into it. Bug: crbug.com/413723100 * Fix Android.mk dependency on core_tables.inc * Apply fixes from review - fix typos - to test for failure check SPV_SUCCESS != ... - fix formatting Co-authored-by: alan-baker <[email protected]> --------- Co-authored-by: alan-baker <[email protected]>
Merged
alan-baker
pushed a commit
that referenced
this pull request
May 9, 2025
Use sys.exit() instead. Fixes: #6107
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use compressed grammar tables for core instructions and operands
Use a new 'utils/ggt.py' script to generate the compressed tables.
The new tables are created at build time, and there is one static
global table for each of the following:
Each entry is a spvtools::InstructionDesc object.
This includes aliases.
Each entry is a spvtools::OperandDesc object.
This includes aliases.
Entries in the tables use IndexRanges to refer to sequences of
objects in one of the other tables.
the capabilities table.
the extensions table.
the aliases table.
global string table.
The InstructionDesc object has scalar values such as opcode,
hasResult, hasValue, and uses IndexRanges to express the
opcode name, aliases, operands, capabilities, operands, and
extensions.
The OperandDesc object has scalar values such as enum value,
and uses IndexRanges to express the operand name, aliases, operands,
capabilities, operands, and extensions.
Remaining work:
sets.
obsolete and we can move ggt.py into it.
Bug: crbug.com/413723100