Name Strings

SPV_EXT_shader_atomic_float_add

Contact

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

Contributors

  • Vikram Kushwaha, NVIDIA

  • Daniel Koch, NVIDIA

  • Jeff Bolz, NVIDIA

  • Alan Baker, Google

  • David Neto, Google

  • Nicolai Hahnle, AMD

  • Brian Sumner, AMD

  • Faith Ekstrand, Intel

  • Graeme Leese, Broadcom

Status

  • Complete

Version

Last Modified Date

2021-03-17

Revision

2

Dependencies

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

This extension requires SPIR-V 1.0.

Overview

This extension adds atomic add instruction on floating-point numbers.

Extension Name

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

OpExtension "SPV_EXT_shader_atomic_float_add"

New Capabilities

This extension introduces new capabilities:

AtomicFloat32AddEXT
AtomicFloat64AddEXT

Modifications to the SPIR-V Specification, Version 1.5

Modify Section 3.31, "Capability", adding this row to the Capability table:

Capability Implicitly Declares

6033

AtomicFloat32AddEXT
Uses the OpAtomicFAddEXT instruction with 32-bit floating point values.

6034

AtomicFloat64AddEXT
Uses the OpAtomicFAddEXT instruction with 64-bit floating point values.

(Modify section 3.32.18, Atomic Instructions, adding to the end of the list of instructions)

OpAtomicFAddEXT

Perform the following steps atomically with respect to any other atomic accesses within Scope to the same location:

1) load through Pointer to get an Original Value,

2) get a New Value by float addition of Original Value and Value, and

3) store the New Value back through Pointer.

The instruction’s result is the Original Value.

Result Type must be a floating-point type scalar.

The type of Value must be the same as Result Type. The type of the value pointed to by Pointer must be the same as Result Type.

Memory must be a valid memory Scope.

Capability:
AtomicFloat32AddEXT AtomicFloat64AddEXT

7

6035

<id> Result type

Result <id>

<id> Pointer

Scope <id> Memory

Memory Semantics <id> Semantics

<id> Value

New Instructions

Instructions added under AtomicFloat32AddEXT or AtomicFloat64AddEXT capability:

OpAtomicFAddEXT

Validation Rules

An OpExtension must be added to the SPIR-V for validation layers to check legal use of this extension:

OpExtension "SPV_EXT_shader_atomic_float_add"
  • When using OpAtomicFAddEXT only 32- or 64-bit floating-point values are allowed.

  • If OpAtomicFAddEXT is used with 32-bit floating-point values, the AtomicFloat32AddEXT capability must be declared.

  • If OpAtomicFAddEXT is used with 64-bit floating-point values, the AtomicFloat64AddEXT capability must be declared.

Issues

None yet.

Revision History

Rev Date Author Changes

1

2020-07-15

Vikram Kushwaha

Internal revisions

2

2021-03-17

Spencer Fricke

Clarify result type is scalar