Name Strings

SPV_INTEL_long_composites

Contact

To report problems with this extension, please open a new issue at:

Contributors

  • Mariya Podchishchaeva, Intel

  • Alexey Sotkin, Intel

  • Ben Ashbaugh, Intel

  • Alexey Sachkov, Intel

Notice

Copyright (c) 2023 Intel Corporation. All rights reserved.

Status

  • Shipping.

Version

Last Modified Date

2023-03-22

Revision

1

Dependencies

This extension is written against the SPIR-V Specification, Version 1.6 Revision 2, Unified

This extension requires SPIR-V 1.0.

Overview

This extension adds new capability and instructions to allow to represent composites with number of Constituents greater than the maximum possible WordCount.

Extension Name

To use this extension within a SPIR-V module, the following OpExtension must be present in the module:

OpExtension "SPV_INTEL_long_composites"

Modifications to the SPIR-V Specification, Version 1.5

Capabilities

Modify Section 3.31, "Capability", adding these rows to the Capability table:

Capability Implicitly Declares

6089

CapabilityLongCompositesINTEL
Allow to use OpTypeStructContinuedINTEL, OpConstantCompositeContinuedINTEL, OpCompositeConstructContinuedINTEL and OpSpecConstantCompositeContinuedINTEL instructions

Instructions

In section 3.42.6. Type-Declaration Instructions add the new instruction

OpTypeStructContinuedINTEL

Continue specifying an OpTypeStruct with number of Member types greater than the maximum possible WordCount.

The previous instruction must be an OpTypeStruct or an OpTypeStructContinuedINTEL instruction.

Member types follow the same rules as defined for Member types of OpTypeStruct.

Capability: CapabilityLongCompositesINTEL

2 + variable

6090

<id>, <id>, …​ Member N type, member N + 1 type

Modify the description of OpTypeStruct instruction, adding the following sentence to the end: In case if it is not possible to specify all the member types of the structure by one OpTypeStruct instruction, i.e. if number of members of the Result type is greater than the maximum possible WordCount, the remaining member types are specified by the following OpTypeStructContinuedINTEL instructions.

In section 3.42.7. Constant-Creation Instructions, add the new instructions

OpConstantCompositeContinuedINTEL

Continue specifying an OpConstantComposite instruction with number of Constituents greater than the maximum possible WordCount.

The previous instruction must be an OpConstantComposite or an OpConstantCompositeContinuedINTEL instruction.

Constituents follow the same rules as defined for Constituents of OpConstantComposite instruction and specify members of a structure, or elements of an array, or components of a vector, or columns of a matrix.

Capability: CapabilityLongCompositesINTEL

2 + variable

6091

<id>, <id>, …​ Constituents

OpSpecConstantCompositeContinuedINTEL

Continue specifying an OpSpecConstantComposite instruction with number of Constituents greater than the maximum possible WordCount.

The previous instruction must be an OpSpecConstantComposite or an OpSpecConstantCompositeContinuedINTEL instruction.

Constituents follow the same rules as defined for Constituents of OpSpecConstantComposite instruction and specify members of a structure, or elements of an array, or components of a vector, or columns of a matrix.

This instruction will be specialized to an OpConstantCompositeContinuedINTEL instruction.

See Specialization.

Capability: CapabilityLongCompositesINTEL

2 + variable

6092

<id>, <id>, …​ Constituents

Modify the description of OpConstantComposite instruction, adding the following sentence to the end: In case if it is not possible to specify all the Constituents by one OpConstantComposite instruction, i.e. if number of members of the Result type and corresponding Constituents is greater than the maximum possible WordCount, the remaining Constituents are specified by the following OpConstantCompositeContinuedINTEL instructions.

Modify the description of OpSpecConstantComposite instruction, adding the following sentence to the end: In case if it is not possible to specify all the Constituents by one OpSpecConstantComposite instruction, i.e. if number of members of the Result type and corresponding Constituents is greater than the maximum possible WordCount, the remaining Constituents are specified by the following OpSpecConstantCompositeContinuedINTEL instructions.

Modify the description of OpCompositeConstruct instruction, adding the following sentence to the end: In case if it is not possible to specify all the Constituents by one CompositeConstruct instruction, i.e. if number of members of the Result type and corresponding Constituents is greater than the maximum possible WordCount, the remaining Constituents are specified by the following OpCompositeConstructContinuedINTEL instructions.

In section 3.42.12. Composite Instructions, add the new instruction

OpCompositeConstructContinuedINTEL

Continue specifying an OpCompositeConstruct instruction with number of Constituents greater than the maximum possible WordCount.

The previous instruction must be an OpCompositeConstruct or an OpCompositeConstructContinuedINTEL instruction.

Constituents follow the same rules as defined for Constituents of OpCompositeConstruct instruction and specify members of a structure, or elements of an array, or components of a vector, or columns of a matrix.

Capability: CapabilityLongCompositesINTEL

2 + variable

6096

<id>, <id>, …​ Constituents

Validation Rules

Previous instruction to OpTypeStructContinuedINTEL must be OpTypeStruct or OpTypeStructContinuedINTEL.
Previous instruction to OpConstantCompositeContinuedINTEL must be OpConstantComposite or OpConstantCompositeContinuedINTEL.
Previous instruction to OpCompositeConstructContinuedINTEL must be OpCompositeConstruct or OpCompositeConstructContinuedINTEL.
Previous instruction to OpSpecConstantCompositeContinuedINTEL must be OpSpecConstantComposite or OpSpecConstantCompositeContinuedINTEL.

Issues

1) Do we need to define additional validation rules?

Resolution:

Yes, added the validation rules for the new instructions.

2) Do we need modifications of the OpConstantComposite/OpSpecConstantComposite instruction description?

Resolution:

Yes, it seems that description of these instructions defines one to one match between composite type members and Constituents by the sentence: "There must be exactly one Constituent for each top-level member/element/component/column of the result." Done.

3) We also might want to modify OpAccessChain to clarify how it works on large constants.

Resolution:

No. Already existing description of OpAccessChain in code SPIR-V spec is good enough.

Revision History

Rev Date Author Changes

1

2023-03-22

Mariya Podchishchaeva

Initial revision