Skip to content

Commit 478d3b7

Browse files
committed
Add documentation for inline SPIR-V types
1 parent 10b18e1 commit 478d3b7

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

llvm/docs/SPIRVUsage.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,28 @@ parameters of its underlying image type, so that a sampled image for the
260260
previous type has the representation
261261
``target("spirv.SampledImage, void, 1, 1, 0, 0, 0, 0, 0)``.
262262

263+
.. _inline-spirv-types:
264+
265+
Inline SPIR-V Types
266+
-------------------
267+
268+
User-specified types may be represented using target extension types:
269+
270+
.. table:: Inline SPIR-V Types
271+
272+
========================== =================== ==============================
273+
LLVM type name LLVM type arguments LLVM integer arguments
274+
========================== =================== ==============================
275+
``spirv.Type`` SPIR-V operands opcode, size, alignment
276+
``spirv.IntegralConstant`` integral type value
277+
``spirv.Literal`` (none) value
278+
========================== =================== ==============================
279+
280+
The operand arguments to ``spirv.Type`` may be either a ``spirv.IntegralConstant`` type,
281+
representing an ``OpConstant`` id operand, a ``spirv.Literal`` type, representing an immediate
282+
literal operand, or any other type, representing the id of that type as an operand.
283+
``spirv.IntegralConstant`` and ``spirv.Literal`` may not be used outside of this context.
284+
263285
.. _spirv-intrinsics:
264286

265287
Target Intrinsics

0 commit comments

Comments
 (0)