Implement the WavePrefixProduct
HLSL Function
#99173
Labels
backend:DirectX
backend:SPIR-V
bot:HLSL
HLSL
HLSL Language Support
metabug
Issue to collect references to a group of similar or related issues.
WavePrefixProduct
clang builtin,WavePrefixProduct
clang builtin withhlsl_intrinsics.h
WavePrefixProduct
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
WavePrefixProduct
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
clang/test/CodeGenHLSL/builtins/WavePrefixProduct.hlsl
clang/test/SemaHLSL/BuiltIns/WavePrefixProduct-errors.hlsl
int_dx_WavePrefixProduct
intrinsic inIntrinsicsDirectX.td
DXILOpMapping
ofint_dx_WavePrefixProduct
to121
inDXIL.td
WavePrefixProduct.ll
andWavePrefixProduct_errors.ll
tests inllvm/test/CodeGen/DirectX/
int_spv_WavePrefixProduct
intrinsic inIntrinsicsSPIRV.td
WavePrefixProduct
lowering and map it toint_spv_WavePrefixProduct
inSPIRVInstructionSelector::selectIntrinsic
.llvm/test/CodeGen/SPIRV/hlsl-intrinsics/WavePrefixProduct.ll
DirectX
SPIR-V
OpGroupNonUniformFMul:
Description:
A floating point multiply group operation of all
Value operands contributed by active invocations in the
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 1. 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.
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
352
<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 product of all of the values in the active lanes in this wave with indices less than this lane.
Syntax
Parameters
value
The value to multiply.
Return value
The product of all the values.
Remarks
The order of operations on this routine cannot be guaranteed. So, effectively, the [precise] flag is ignored within it.
A postfix product can be computed by multiplying the prefix product by the current lane's value.
Note that the active lane with the lowest index will always receive a 1 for its prefix product.
This function is supported from shader model 6.0 in all shader stages.
Examples
On a machine with a wave size of 8, and all lanes active except lanes 0 and 4, the following values would be returned from WavePrefixProduct.
See also
Overview of Shader Model 6
Shader Model 6
The text was updated successfully, but these errors were encountered: