[ ] Link WaveActiveMax clang builtin with hlsl_intrinsics.h
[ ] Add sema checks for WaveActiveMax to CheckHLSLBuiltinFunctionCall in SemaChecking.cpp
[ ] Add codegen for WaveActiveMax to EmitHLSLBuiltinExpr in CGBuiltin.cpp
[ ] Add codegen tests to clang/test/CodeGenHLSL/builtins/WaveActiveMax.hlsl
[ ] Add sema tests to clang/test/SemaHLSL/BuiltIns/WaveActiveMax-errors.hlsl
[ ] Create the int_dx_WaveActiveMax intrinsic in IntrinsicsDirectX.td
[ ] Create the DXILOpMapping of int_dx_WaveActiveMax to 119 in DXIL.td
[ ] Create the WaveActiveMax.ll and WaveActiveMax_errors.ll tests in llvm/test/CodeGen/DirectX/
[ ] Create the int_spv_WaveActiveMax intrinsic in IntrinsicsSPIRV.td
[ ] In SPIRVInstructionSelector.cpp create the WaveActiveMax lowering and map it to int_spv_WaveActiveMax in SPIRVInstructionSelector::selectIntrinsic.
[ ] Create SPIR-V backend test case in llvm/test/CodeGen/SPIRV/hlsl-intrinsics/WaveActiveMax.ll
Execution is a Scope that identifies the group of
invocations affected by this command. It must be Subgroup.
The identity I for Operation is -INF. If Operation is
ClusteredReduce, ClusterSize must be present.
The type of Value must be the same as Result Type. The method used
to perform the group operation on the contributed Value(s) from active
invocations is implementation defined. From the set of Value(s)
provided by active invocations within a subgroup, if for any two
Values one of them is a NaN, the other is chosen. If all Value(s)
that are used by the current invocation are NaN, then the result is an
undefined value.
ClusterSize is the size of cluster to use. ClusterSize must be a
scalar of integer type, whose Signedness operand is 0.
ClusterSize must come from a constant
instruction. Behavior is undefined unless
ClusterSize is at least 1 and a power of 2. If ClusterSize is
greater than the size of the group, executing this instruction
results in undefined behavior.
[Overview of Shader Model 6](https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src//direct3dhlsl/hlsl-shader-model-6-0-features-for-direct3d-12.md)
[Shader Model 6](https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src//direct3dhlsl/shader-model-6-0.md)
WaveActiveMax
clang builtin,WaveActiveMax
clang builtin withhlsl_intrinsics.h
WaveActiveMax
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
WaveActiveMax
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
clang/test/CodeGenHLSL/builtins/WaveActiveMax.hlsl
clang/test/SemaHLSL/BuiltIns/WaveActiveMax-errors.hlsl
int_dx_WaveActiveMax
intrinsic inIntrinsicsDirectX.td
DXILOpMapping
ofint_dx_WaveActiveMax
to119
inDXIL.td
WaveActiveMax.ll
andWaveActiveMax_errors.ll
tests inllvm/test/CodeGen/DirectX/
int_spv_WaveActiveMax
intrinsic inIntrinsicsSPIRV.td
WaveActiveMax
lowering and map it toint_spv_WaveActiveMax
inSPIRVInstructionSelector::selectIntrinsic
.llvm/test/CodeGen/SPIRV/hlsl-intrinsics/WaveActiveMax.ll
DirectX
SPIR-V
OpGroupNonUniformFMax:
Description:
A floating point maximum group operation of all Value operands contributed by active invocations in by group.
Result Type must be a scalar or vector of floating-point type.
Execution is a Scope that identifies the group of invocations affected by this command. It must be Subgroup.
The identity I for Operation is -INF. If Operation is ClusteredReduce, ClusterSize must be present.
The type of Value must be the same as Result Type. The method used to perform the group operation on the contributed Value(s) from active invocations is implementation defined. From the set of Value(s) provided by active invocations within a subgroup, if for any two Values one of them is a NaN, the other is chosen. If all Value(s) that are used by the current invocation are NaN, then the result is an undefined value.
ClusterSize is the size of cluster to use. ClusterSize must be a scalar of integer type, whose Signedness operand is 0. ClusterSize must come from a constant instruction. Behavior is undefined unless ClusterSize is at least 1 and a power of 2. If ClusterSize is greater than the size of the group, executing this instruction results in undefined behavior.
Capability:
GroupNonUniformArithmetic, GroupNonUniformClustered, GroupNonUniformPartitionedNV
Missing before version 1.3.
6 + variable
358
<id>
Result Type
Result <id>
Scope <id>
Execution
Group Operation
Operation
<id>
Value
Optional
<id>
ClusterSize
Test Case(s)
Example 1
Example 2
Example 3
HLSL:
Returns the maximum value of the expression across all active lanes in the current wave and replicates it back to all active lanes.
Syntax
Parameters
Return value
The maximum value.
Remarks
The order of operations is undefined.
This function is supported from shader model 6.0 in all shader stages.
Examples
See also