As the name suggest, this CL adds many operations related
to arithmetic subgroup operations, i.e.:
- Reduction / Inclusive Scan / Exclusive Scans for:
- IntAdd, UIntAdd, FloatAdd
- IntMul, UIntMul, FloatMul,
- IntMin, UIntMin, FloatMin,
- IntMax, UIntMax, FloatMax,
- BitwiseAnd, BitwiseOr, BitwiseXor
- LogicalAnd, LogicalOr, LogicalXor
The implementation uses a single template function to
implement all these, based on the fact that these are
all binary commutative operations.
NOTE: Only 32-bit values are supported.
To make scans efficient, a new Reactor operation, named
Blend() is introduced. It is used to mix two input vectors
using 4 3-bit indices (encoded in a single 16-bit value)
to select the result's lane values.
A new unit-test is added to ReactorUnittests to check its
behaviour. Unfortunately, the test takes about 2 minutes
on a fast workstation when doing a full scan, so it will
by default only check 1/11th of all possible values
(see comments in the patch for more details).
Also, Float4::positive_inf() and Float4::negative_inf()
methods were added, since trying to build Float4(INFINITY)
will trigger a DCHECK() in the Float4(float) constructor,
and the infinity values are required by the subgroup
floating-point scan operations.
Bug: b/142002682
Test: dEQP-VK.subgroups.arithmetic.*
Change-Id: I86f509fc47f7475ca126615ed698ee493ae835ef
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/38929Reviewed-by:
Chris Forbes <chrisforbes@google.com>
Reviewed-by:
Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by:
David Turner <digit@google.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| SubmoduleCheck/gtest | Loading commit data... | |
| BUILD.gn | Loading commit data... | |
| CPUID.cpp | Loading commit data... | |
| CPUID.hpp | Loading commit data... | |
| Coroutine.hpp | Loading commit data... | |
| Debug.cpp | Loading commit data... | |
| Debug.hpp | Loading commit data... | |
| DebugAndroid.cpp | Loading commit data... | |
| DebugAndroid.hpp | Loading commit data... | |
| EmulatedReactor.cpp | Loading commit data... | |
| EmulatedReactor.hpp | Loading commit data... | |
| ExecutableMemory.cpp | Loading commit data... | |
| ExecutableMemory.hpp | Loading commit data... | |
| LLVMReactor.cpp | Loading commit data... | |
| LLVMReactor.hpp | Loading commit data... | |
| LLVMReactorDebugInfo.cpp | Loading commit data... | |
| LLVMReactorDebugInfo.hpp | Loading commit data... | |
| MutexLock.hpp | Loading commit data... | |
| Nucleus.hpp | Loading commit data... | |
| Optimizer.cpp | Loading commit data... | |
| Optimizer.hpp | Loading commit data... | |
| Print.hpp | Loading commit data... | |
| Reactor.cpp | Loading commit data... | |
| Reactor.hpp | Loading commit data... | |
| Reactor.vcxproj | Loading commit data... | |
| Reactor.vcxproj.filters | Loading commit data... | |
| ReactorUnitTests.cpp | Loading commit data... | |
| ReactorUnitTests.vcxproj | Loading commit data... | |
| ReactorUnitTests.vcxproj.filters | Loading commit data... | |
| ReactorUnitTests.vcxproj.user | Loading commit data... | |
| Routine.hpp | Loading commit data... | |
| Subzero.vcxproj | Loading commit data... | |
| Subzero.vcxproj.filters | Loading commit data... | |
| SubzeroLLVMDependencies.vcxproj | Loading commit data... | |
| SubzeroLLVMDependencies.vcxproj.filters | Loading commit data... | |
| SubzeroReactor.cpp | Loading commit data... | |
| Thread.cpp | Loading commit data... | |
| Thread.hpp | Loading commit data... | |
| Traits.hpp | Loading commit data... | |
| Traits.inl | Loading commit data... | |
| x86.hpp | Loading commit data... |