-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Closed
Labels
HLSLHLSL Language SupportHLSL Language Supportbackend:DirectXbackend:SPIR-Vbot:HLSLclang:codegenIR generation bugs: mangling, exceptions, etc.IR generation bugs: mangling, exceptions, etc.metaissueIssue to collect references to a group of similar or related issues.Issue to collect references to a group of similar or related issues.
Description
- Implement
WaveActiveAnyTrue
clang builtin, - Link
WaveActiveAnyTrue
clang builtin withhlsl_intrinsics.h
- Add sema checks for
WaveActiveAnyTrue
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
- Add codegen for
WaveActiveAnyTrue
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
- Add codegen tests to
clang/test/CodeGenHLSL/builtins/WaveActiveAnyTrue.hlsl
- Add sema tests to
clang/test/SemaHLSL/BuiltIns/WaveActiveAnyTrue-errors.hlsl
- Create the
int_dx_WaveActiveAnyTrue
intrinsic inIntrinsicsDirectX.td
- Create the
DXILOpMapping
ofint_dx_WaveActiveAnyTrue
to113
inDXIL.td
- Create the
WaveActiveAnyTrue.ll
andWaveActiveAnyTrue_errors.ll
tests inllvm/test/CodeGen/DirectX/
- Create the
int_spv_WaveActiveAnyTrue
intrinsic inIntrinsicsSPIRV.td
- In SPIRVInstructionSelector.cpp create the
WaveActiveAnyTrue
lowering and map it toint_spv_WaveActiveAnyTrue
inSPIRVInstructionSelector::selectIntrinsic
. - Create SPIR-V backend test case in
llvm/test/CodeGen/SPIRV/hlsl-intrinsics/WaveActiveAnyTrue.ll
DirectX
DXIL Opcode | DXIL OpName | Shader Model | Shader Stages |
---|---|---|---|
113 | WaveAnyTrue | 6.0 | ('library', 'compute', 'amplification', 'mesh', 'pixel', 'vertex', 'hull', 'domain', 'geometry', 'raygeneration', 'intersection', 'anyhit', 'closesthit', 'miss', 'callable', 'node') |
SPIR-V
OpGroupNonUniformAny:
Description:
Evaluates a predicate for all active invocations in the group,
resulting in true if predicate evaluates to true for any active
invocation in the group, otherwise the result is
false.
Result Type must be a Boolean type.
Execution is a Scope that identifies the group of
invocations affected by this command. It must be Subgroup.
Predicate must be a Boolean type.
Capability:
GroupNonUniformVote
Missing before version 1.3.
Word Count | Opcode | Results | Operands | ||
---|---|---|---|---|---|
5 |
335 |
<id> |
Scope <id> |
<id> |
Test Case(s)
Example 1
//dxc WaveActiveAnyTrue_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export bool fn(bool p1) {
return WaveActiveAnyTrue(p1);
}
HLSL:
Returns true if the expression is true in any of the active lanes in the current wave.
Syntax
bool WaveActiveAnyTrue(
bool expr
);
Parameters
-
expr
-
The boolean expression to evaluate.
Return value
True if the expression is true in any lane.
Remarks
This function is supported from shader model 6.0 in all shader stages.
See also
Metadata
Metadata
Assignees
Labels
HLSLHLSL Language SupportHLSL Language Supportbackend:DirectXbackend:SPIR-Vbot:HLSLclang:codegenIR generation bugs: mangling, exceptions, etc.IR generation bugs: mangling, exceptions, etc.metaissueIssue to collect references to a group of similar or related issues.Issue to collect references to a group of similar or related issues.
Type
Projects
Status
Closed