Skip to content

Commit 48518f5

Browse files
vmaksimobashbaug
andauthored
[Doc][SPIR-V] Allow function pointers to be used with SPV_KHR_untyped_pointers (#17451)
This relaxes the return type of the **OpConstantFunctionPointerINTEL** to be any pointer (typed or untyped). --------- Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
1 parent bdd4c0f commit 48518f5

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

sycl/doc/design/spirv-extensions/SPV_INTEL_function_pointers.asciidoc

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ https://github.com/intel/llvm/issues
2020
- Nikita Kornev, Intel
2121
- Dmitry Sidorov, Intel
2222
- Alex Bezzubikov, Intel
23+
- Viktoria Maximova, Intel
2324

2425
== Notice
2526

@@ -39,14 +40,16 @@ If you are interested in using this feature in your software product, please let
3940

4041
[width="40%",cols="25,25"]
4142
|==================================
42-
| Last Modified Date | {docdate}
43-
| Revision | I
43+
| Last Modified Date | 2025-03-13
44+
| Revision | 10
4445
|==================================
4546

4647
== Dependencies
4748

48-
This extension is written against the SPIR-V Specification, Version 1.4
49-
Revision 1, Unified.
49+
This extension is written against the SPIR-V Specification, Version 1.6
50+
Revision 5, Unified.
51+
52+
This extension interacts with link:https://github.khronos.org/SPIRV-Registry/extensions/KHR/SPV_KHR_untyped_pointers.html[*SPV_KHR_untyped_pointers*] extension.
5053

5154
This extension requires SPIR-V 1.0.
5255

@@ -133,7 +136,7 @@ CodeSectionINTEL
133136
|ArgumentAttributeINTEL | 6409
134137
|====
135138

136-
== Modifications to the SPIR-V Specification, Version 1.4
139+
== Modifications to the SPIR-V Specification, Version 1.6
137140

138141
=== Terms
139142

@@ -179,7 +182,7 @@ all invocations of all work groups.
179182

180183
=== Decorations
181184

182-
Modify Section 3.20, Decorations, adding to the end of the list of decorations: ::
185+
Modify Section 3.20, Decoration, adding to the end of the list of decorations: ::
183186

184187
[cols="1,6,1,1,6",options="header",width = "100%"]
185188
|====
@@ -204,7 +207,7 @@ Argument Attribute_ |
204207

205208
=== Capabilities
206209

207-
Modify Section 3.31, Capabilities, adding to the end of the list of capabilities: ::
210+
Modify Section 3.31, Capability, adding to the end of the list of capabilities: ::
208211

209212

210213
[cols="1,10,8,8",options="header",width = "80%"]
@@ -223,13 +226,13 @@ Modify Section 3.31, Capabilities, adding to the end of the list of capabilities
223226

224227
=== Instructions
225228

226-
Modify Section 3.32.6, Type-Declaration Instructions, change the third sentence in the description of *OpTypeFunction* instruction to say: ::
229+
Modify Section 3.56.6, Type-Declaration Instructions, change the third sentence in the description of *OpTypeFunction* instruction to say: ::
227230

228231
*OpTypeFunction* can be used as operand of *OpTypePointer* to declare function
229232
pointer type. *OpFunction* and *OpTypePointer* are only valid uses of
230233
*OpTypeFunction*.
231234

232-
Modify Section 3.32.7, Constant-Creation Instructions, adding to the end of the list of instructions: ::
235+
Modify Section 3.56.7, Constant-Creation Instructions, adding to the end of the list of instructions: ::
233236

234237
[cols="2*1,3*3",width="100%"]
235238
|=====
@@ -241,15 +244,15 @@ Result value can be used immediately in *OpFunctionPointerCallINTEL*, inserted
241244
into a composite constant or stored somewhere for further usage in
242245
*OpFunctionPointerCallINTEL*. +
243246
+
244-
_Result Type_ must be an *OpTypePointer*. Its _Type_ operand must be the same
247+
_Result Type_ must be a link:https://github.khronos.org/SPIRV-Registry/extensions/KHR/SPV_KHR_untyped_pointers.html#PointerType[pointer type]. If the _Result Type_ is *OpTypePointer*, its _Type_ operand must be the same
245248
*OpTypeFunction* which was used as _Function Type_ operand of the _Function_
246249
operand. Its _Storage Class_ operand must be *CodeSectionINTEL*
247250
| <<Capability,Capability>>: +
248251
*FunctionPointersINTEL*
249252
| 4 | 5600 | '<id>' 'Result Type' | '<id> Result ' | '<id>' 'Function'
250253
|=====
251254

252-
Modify Section 3.32.9, Function Instructions, adding to the end of the list of instructions: ::
255+
Modify Section 3.56.9, Function Instructions, adding to the end of the list of instructions: ::
253256

254257
[cols="2*1,4*3",width="100%"]
255258
|=====
@@ -370,22 +373,23 @@ Removed *OpFunctionPointerINTEL* instruction.
370373
[options="header"]
371374
|========================================
372375
|Rev|Date|Author|Changes
373-
|A|2019-02-05|Alexey Sachkov|*Initial revision*
374-
|B|2019-02-27|Alexey Sachkov|Updated description of
376+
|1|2019-02-05|Alexey Sachkov|*Initial revision*
377+
|2|2019-02-27|Alexey Sachkov|Updated description of
375378
*OpFunctionPointerCallINTEL*: added information about type-checking. Added
376379
*ReferencedIndirectly* decoration
377-
|C|2019-01-03|Alexey Sachkov|Added missed `INTEL` suffix
378-
|D|2019-06-03|Alexey Sachkov|Added *FunctionPointersINTEL* and
380+
|3|2019-01-03|Alexey Sachkov|Added missed `INTEL` suffix
381+
|4|2019-06-03|Alexey Sachkov|Added *FunctionPointersINTEL* and
379382
*IndirectReferencesINTEL* capabilities
380-
|E|2019-06-04|Alexey Sachkov|Applied comments from Mariusz and Pawel: +
383+
|5|2019-06-04|Alexey Sachkov|Applied comments from Mariusz and Pawel: +
381384
- OpFunctionType -> OpTypeFunction +
382385
- Added definition of Function Pointer into Terms section +
383386
- New capabilities implicitly requires Addresses capability +
384387
- Small updates in descriptions of new instructions
385-
|F|2019-06-21|Alexey Sachkov|Added new storage class dedicated for function
388+
|6|2019-06-21|Alexey Sachkov|Added new storage class dedicated for function
386389
pointers. Updated validation rules. Misc updates.
387-
|G|2019-07-19|Ben Ashbaugh|Assigned SPIR-V enums, added preview extension disclaimer text.
388-
|H|2021-11-15|Nikita Kornev|Added new *ArgumentAttributeINTEL* decoration.
389-
|I|2022-10-08|Dmitry Sidorov, Alex Bezzubikov, Alexey Sachkov|Replaced *OpFunctionPointerINTEL* with
390+
|7|2019-07-19|Ben Ashbaugh|Assigned SPIR-V enums, added preview extension disclaimer text.
391+
|8|2021-11-15|Nikita Kornev|Added new *ArgumentAttributeINTEL* decoration.
392+
|9|2022-10-08|Dmitry Sidorov, Alex Bezzubikov, Alexey Sachkov|Replaced *OpFunctionPointerINTEL* with
390393
*OpConstantFunctionPointerINTEL*
394+
|10|2025-03-13|Viktoria Maximova|Allow to use *OpTypeUntypedPointerKHR* as a result type of *OpConstantFunctionPointerINTEL*.
391395
|========================================

0 commit comments

Comments
 (0)