Name Strings

SPV_KHR_uniform_group_instructions

Contact

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

Contributors

  • Dmitry Sidorov, Intel

  • Alexey Sotkin, Intel

  • John Pennycook, Intel

  • Ben Ashbaugh, Intel

Notice

Copyright (c) 2022 The Khronos Group Inc. Copyright terms at http://www.khronos.org/registry/speccopyright.html

Status

  • Complete

  • Approved by the SPIR-V Working Group: 2021-12-08

  • Approved by the Khronos Board of Promoters: 2022-01-21

Version

Last Modified Date

2021-11-08

Revision

1

Dependencies

This extension is written against the SPIR-V Specification, Version 1.5, Revision 5, Unified.

This extension requires SPIR-V 1.0.

Overview

This extension adds new instructions to SPIR-V to support additional group operations within uniform control flow. Some SPIR-V consumers may only be able to support these operations within uniform control flow for some Execution Scopes, and some SPIR-V consumers may be able to generate more efficient code when control flow is known to be uniform.

Extension Name

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

OpExtension "SPV_KHR_uniform_group_instructions"

Modifications to the SPIR-V Specification, Version 1.5

Capabilities

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

Capability Implicitly Declares

6400

GroupUniformArithmeticKHR
Uses additional group uniform arithmetic instructions.

Groups

Instructions

Add new instructions to Section 3.37.21, Group and Subgroup Instructions:

OpGroupIMulKHR

An integer multiplication group operation specified for all values of X specified by invocations in the group.

Behavior is undefined if not all invocations of this module within Execution reach this point of execution.

Behavior is undefined unless all invocations within Execution execute the same dynamic instance of this instruction.

Result Type must be a scalar or vector of integer type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is 1.

The type of X must be the same as Result Type.

Capability:
GroupUniformArithmeticKHR

6

6401

<id>
Result Type

Result <id>

Scope <id>
Execution

<Group Operation>
Operation

<id>
X

OpGroupFMulKHR

A floating-point multiplication group operation specified for all values of X specified by invocations in the group.

Behavior is undefined if not all invocations of this module within Execution reach this point of execution.

Behavior is undefined unless all invocations within Execution execute the same dynamic instance of this instruction.

Result Type must be a scalar or vector of floating-point type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is 1.

The type of X must be the same as Result Type.

Capability:
GroupUniformArithmeticKHR

6

6402

<id>
Result Type

Result <id>

Scope <id>
Execution

<Group Operation>
Operation

<id>
X

OpGroupBitwiseAndKHR

A bitwise And group operation specified for all values of X specified by invocations in the group.

Behavior is undefined if not all invocations of this module within Execution reach this point of execution.

Behavior is undefined unless all invocations within Execution execute the same dynamic instance of this instruction.

Result Type must be a scalar or vector of integer type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is ~0.

The type of X must be the same as Result Type.

Capability:
GroupUniformArithmeticKHR

6

6403

<id>
Result Type

Result <id>

Scope <id>
Execution

<Group Operation>
Operation

<id>
X

OpGroupBitwiseOrKHR

A bitwise Or group operation specified for all values of X specified by invocations in the group.

Behavior is undefined if not all invocations of this module within Execution reach this point of execution.

Behavior is undefined unless all invocations within Execution execute the same dynamic instance of this instruction.

Result Type must be a scalar or vector of integer type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is 0.

The type of X must be the same as Result Type.

Capability:
GroupUniformArithmeticKHR

6

6404

<id>
Result Type

Result <id>

Scope <id>
Execution

<Group Operation>
Operation

<id>
X

OpGroupBitwiseXorKHR

A bitwise Xor group operation specified for all values of X specified by invocations in the group.

Behavior is undefined if not all invocations of this module within Execution reach this point of execution.

Behavior is undefined unless all invocations within Execution execute the same dynamic instance of this instruction.

Result Type must be a scalar or vector of integer type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is 0.

The type of X must be the same as Result Type.

Capability:
GroupUniformArithmeticKHR

6

6405

<id>
Result Type

Result <id>

Scope <id>
Execution

<Group Operation>
Operation

<id>
X

OpGroupLogicalAndKHR

A logical And group operation specified for all values of X specified by invocations in the group.

Behavior is undefined if not all invocations of this module within Execution reach this point of execution.

Behavior is undefined unless all invocations within Execution execute the same dynamic instance of this instruction.

Result Type must be a scalar or vector of Boolean type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is ~0.

The type of X must be the same as Result Type.

Capability:
GroupUniformArithmeticKHR

6

6406

<id>
Result Type

Result <id>

Scope <id>
Execution

<Group Operation>
Operation

<id>
X

OpGroupLogicalOrKHR

A logical Or group operation specified for all values of X specified by invocations in the group.

Behavior is undefined if not all invocations of this module within Execution reach this point of execution.

Behavior is undefined unless all invocations within Execution execute the same dynamic instance of this instruction.

Result Type must be a scalar or vector of Boolean type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is 0.

The type of X must be the same as Result Type.

Capability:
GroupUniformArithmeticKHR

6

6407

<id>
Result Type

Result <id>

Scope <id>
Execution

<Group Operation>
Operation

<id>
X

OpGroupLogicalXorKHR

A logical Xor group operation specified for all values of X specified by invocations in the group.

Behavior is undefined if not all invocations of this module within Execution reach this point of execution.

Behavior is undefined unless all invocations within Execution execute the same dynamic instance of this instruction.

Result Type must be a scalar or vector of Boolean type.

Execution is a Scope. It must be either Workgroup or Subgroup.

The identity I for Operation is 0.

The type of X must be the same as Result Type.

Capability:
GroupUniformArithmeticKHR

6

6408

<id>
Result Type

Result <id>

Scope <id>
Execution

<Group Operation>
Operation

<id>
X

Issues

None

Revision History

Rev Date Author Changes

1

2021-11-08

Ben Ashbaugh

Converted to a KHR extension.