-
Notifications
You must be signed in to change notification settings - Fork 808
[Doc] Add SPV_INTEL_non_constant_addrspace_printf spec #5227
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
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
945c859
Add SPV_INTEL_non_constant_addrspace_printf spec
KornevNikita 783236d
Apply suggestions
KornevNikita 7b7f75f
Add new opcode & apply suggestion
KornevNikita e868c5f
Apply suggestions
KornevNikita 906a4cd
Apply reviewer's suggestions
KornevNikita File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
164 changes: 164 additions & 0 deletions
164
sycl/doc/extensions/SPIRV/SPV_INTEL_non_constant_addrspace_printf.asciidoc
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,164 @@ | ||
| :extension_name: SPV_INTEL_non_constant_addrspace_printf | ||
| :capability_name: NonConstantAddrspacePrintfINTEL | ||
| :capability_token: 6411 | ||
|
|
||
| {extension_name} | ||
| ================ | ||
|
|
||
|
|
||
| == Name Strings | ||
|
|
||
| {extension_name} | ||
|
|
||
| == Contact | ||
|
|
||
| To report problems with this extension, please open a new issue at: | ||
|
|
||
| https://github.com/intel/llvm | ||
|
|
||
| == Contributors | ||
|
|
||
| - Leonid Pauzin, Intel + | ||
| - Dmitry Sidorov, Intel + | ||
| - Nikita Kornev, Intel + | ||
|
|
||
| == Notice | ||
|
|
||
| Copyright (c) 2022 Intel Corporation. All rights reserved. | ||
|
|
||
| == Status | ||
|
|
||
| Working Draft | ||
|
|
||
| This is a preview extension specification, intended to provide early access to a | ||
| feature for review and community feedback. When the feature matures, this | ||
| specification may be released as a formal extension. | ||
|
|
||
|
|
||
| Because the interfaces defined by this specification are not final and are | ||
| subject to change they are not intended to be used by shipping software | ||
| products. If you are interested in using this feature in your software product, | ||
| please let us know! | ||
|
|
||
| == Version | ||
|
|
||
| [width="40%",cols="25,25"] | ||
| |======================================== | ||
| | Last Modified Date | 2022-01-13 | ||
| | Revision | 1 | ||
| |======================================== | ||
|
|
||
| == Dependencies | ||
|
|
||
| This extension is written against the SPIR-V Specification, | ||
| Version 1.5, Revision 6. | ||
|
|
||
| Also it modifies OpenCL Extended Instruction Set Specification, Version 1.00, | ||
| Revision 7. | ||
|
|
||
| This extension requires SPIR-V 1.0. | ||
|
|
||
| == Overview | ||
|
|
||
| The extension allows format argument of the extended SPIR-V instruction *printf* | ||
| to be a pointer in generic, private, local and global address spaces. | ||
|
|
||
|
|
||
| == Extension Name | ||
|
|
||
|
|
||
| To use this extension within a SPIR-V module, the appropriate *OpExtension* must | ||
| be present in the module: | ||
|
|
||
| [subs="attributes"] | ||
| ---- | ||
| OpExtension "{extension_name}" | ||
| ---- | ||
|
|
||
| == New Capabilities | ||
|
|
||
| This extension introduces new capabilities: | ||
|
|
||
| [subs="attributes"] | ||
| ---- | ||
| {capability_name} | ||
| ---- | ||
|
|
||
| == Token Number Assignments | ||
|
|
||
| [width="40%"] | ||
| [cols="70%,30%"] | ||
| [grid="rows"] | ||
| |==== | ||
| |*{capability_name}* | {capability_token} | ||
| |==== | ||
|
|
||
| == Modifications to the SPIR-V Specification, Version 1.5 | ||
|
|
||
|
|
||
| === Capabilities | ||
|
|
||
| Modify Section 3.31, Capability, adding rows to the Capability table: | ||
|
|
||
| -- | ||
| [options="header"] | ||
| |==== | ||
| 2+^| Capability ^| Implicitly Declares | ||
| | {capability_token} | *{capability_name}* | ||
| | Reserved. + | ||
| + | ||
| See also extension: *{extension_name}* | ||
| |==== | ||
| -- | ||
|
|
||
|
|
||
| == Modifications to the OpenCL Extended Instruction Set Specification, Version 1.0, Revision 6 | ||
|
|
||
|
|
||
| === Misc instructions | ||
|
|
||
| Modify Section 2.8, _printf_ definition: | ||
|
|
||
| [cols="8", width="100%"] | ||
| |==== | ||
| 8+^|*printf* + | ||
| The _printf_ extended instruction writes output to an implementation-defined | ||
| stream such as stdout under control of the string pointed to by format that | ||
| specifies how subsequent arguments are converted for output. If there are | ||
| insufficient arguments for the format, the behavior is undefined. If the format | ||
| is exhausted while arguments remain, the excess arguments are evaluated (as | ||
| always) but are otherwise ignored. The printf instruction returns when the end | ||
| of the format string is encountered. The format string must be resolvable at | ||
| compile time, i.e. cannot be dynamically created by the executing program | ||
| itself. | ||
|
|
||
| _printf_ returns 0 if it was executed successfully and -1 otherwise | ||
|
|
||
| _Result Type_ must be _i32_. | ||
|
|
||
| _format_ must be a _pointer(constant, generic, private, local, global)_ to _i8_. | ||
|
|
||
| | 6 + variable | 12 | _<id>_ + | ||
| _Result Type_ | _Result <id>_ | extended + | ||
| instructions set + | ||
| _<id>_ | 184 | _<id>_ + | ||
| _format_ | _<id>, <id>, …_ + | ||
| _additional_ + | ||
| _arguments_ | ||
| |==== | ||
|
|
||
|
|
||
| === Issues | ||
|
|
||
| None | ||
|
|
||
| Revision History | ||
| ---------------- | ||
|
|
||
| [cols="5,15,15,70"] | ||
| [grid="rows"] | ||
| [options="header"] | ||
| |======================================== | ||
| |Rev|Date|Author|Changes | ||
| |1|2022-01-13|Leonid Pauzin|Initial revision | ||
| |======================================== | ||
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.
Uh oh!
There was an error while loading. Please reload this page.