-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Implement the WaveActiveAllTrue
HLSL Function
#99161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'll take this one too! Should be very similar to #99160 |
Resolves #99161 - [x] Implement `WaveActiveAllTrue` clang builtin, - [x] Link `WaveActiveAllTrue` clang builtin with `hlsl_intrinsics.h` - [x] Add sema checks for `WaveActiveAllTrue` to `CheckHLSLBuiltinFunctionCall` in `SemaChecking.cpp` - [x] Add codegen for `WaveActiveAllTrue` to `EmitHLSLBuiltinExpr` in `CGBuiltin.cpp` - [x] Add codegen tests to `clang/test/CodeGenHLSL/builtins/WaveActiveAllTrue.hlsl` - [x] Add sema tests to `clang/test/SemaHLSL/BuiltIns/WaveActiveAllTrue-errors.hlsl` - [x] Create the `int_dx_WaveActiveAllTrue` intrinsic in `IntrinsicsDirectX.td` - [x] Create the `DXILOpMapping` of `int_dx_WaveActiveAllTrue` to `114` in `DXIL.td` - [x] Create the `WaveActiveAllTrue.ll` and `WaveActiveAllTrue_errors.ll` tests in `llvm/test/CodeGen/DirectX/` - [x] Create the `int_spv_WaveActiveAllTrue` intrinsic in `IntrinsicsSPIRV.td` - [x] In SPIRVInstructionSelector.cpp create the `WaveActiveAllTrue` lowering and map it to `int_spv_WaveActiveAllTrue` in `SPIRVInstructionSelector::selectIntrinsic`. - [x] Create SPIR-V backend test case in `llvm/test/CodeGen/SPIRV/hlsl-intrinsics/WaveActiveAllTrue.ll`
@llvm/issue-subscribers-clang-codegen Author: Farzon Lotfi (farzonl)
- [ ] Implement `WaveActiveAllTrue` clang builtin,
- [ ] Link `WaveActiveAllTrue` clang builtin with `hlsl_intrinsics.h`
- [ ] Add sema checks for `WaveActiveAllTrue` to `CheckHLSLBuiltinFunctionCall` in `SemaChecking.cpp`
- [ ] Add codegen for `WaveActiveAllTrue` to `EmitHLSLBuiltinExpr` in `CGBuiltin.cpp`
- [ ] Add codegen tests to `clang/test/CodeGenHLSL/builtins/WaveActiveAllTrue.hlsl`
- [ ] Add sema tests to `clang/test/SemaHLSL/BuiltIns/WaveActiveAllTrue-errors.hlsl`
- [ ] Create the `int_dx_WaveActiveAllTrue` intrinsic in `IntrinsicsDirectX.td`
- [ ] Create the `DXILOpMapping` of `int_dx_WaveActiveAllTrue` to `114` in `DXIL.td`
- [ ] Create the `WaveActiveAllTrue.ll` and `WaveActiveAllTrue_errors.ll` tests in `llvm/test/CodeGen/DirectX/`
- [ ] Create the `int_spv_WaveActiveAllTrue` intrinsic in `IntrinsicsSPIRV.td`
- [ ] In SPIRVInstructionSelector.cpp create the `WaveActiveAllTrue` lowering and map it to `int_spv_WaveActiveAllTrue` in `SPIRVInstructionSelector::selectIntrinsic`.
- [ ] Create SPIR-V backend test case in `llvm/test/CodeGen/SPIRV/hlsl-intrinsics/WaveActiveAllTrue.ll`
DirectX
SPIR-VOpGroupNonUniformAll:Description:Evaluates a predicate for all active invocations in the group, Result Type must be a Boolean type. Execution is a Scope that identifies the group of Predicate must be a Boolean type. Capability: Missing before version 1.3. <table style="width:100%;"> Test Case(s)Example 1//dxc WaveActiveAllTrue_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export bool fn(bool p1) {
return WaveActiveAllTrue(p1);
} HLSL:Returns true if the expression is true in all active lanes in the current wave. Syntaxbool WaveActiveAllTrue(
bool expr
); Parameters<dl> <dt> expr The boolean expression to evaluate. </dd> </dl> Return valueTrue if the expression is true in all lanes. RemarksThis function is supported from shader model 6.0 in all shader stages.
See also<dl> <dt> Overview of Shader Model 6 Shader Model 6 |
WaveActiveAllTrue
clang builtin,WaveActiveAllTrue
clang builtin withhlsl_intrinsics.h
WaveActiveAllTrue
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
WaveActiveAllTrue
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
clang/test/CodeGenHLSL/builtins/WaveActiveAllTrue.hlsl
clang/test/SemaHLSL/BuiltIns/WaveActiveAllTrue-errors.hlsl
int_dx_WaveActiveAllTrue
intrinsic inIntrinsicsDirectX.td
DXILOpMapping
ofint_dx_WaveActiveAllTrue
to114
inDXIL.td
WaveActiveAllTrue.ll
andWaveActiveAllTrue_errors.ll
tests inllvm/test/CodeGen/DirectX/
int_spv_WaveActiveAllTrue
intrinsic inIntrinsicsSPIRV.td
WaveActiveAllTrue
lowering and map it toint_spv_WaveActiveAllTrue
inSPIRVInstructionSelector::selectIntrinsic
.llvm/test/CodeGen/SPIRV/hlsl-intrinsics/WaveActiveAllTrue.ll
DirectX
SPIR-V
OpGroupNonUniformAll:
Description:
Evaluates a predicate for all active invocations in the group,
resulting in true if predicate evaluates to true for all active
invocations 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.
5
334
<id>
Result Type
Result <id>
Scope <id>
Execution
<id>
Predicate
Test Case(s)
Example 1
HLSL:
Returns true if the expression is true in all active lanes in the current wave.
Syntax
Parameters
expr
The boolean expression to evaluate.
Return value
True if the expression is true in all lanes.
Remarks
This function is supported from shader model 6.0 in all shader stages.
See also
Overview of Shader Model 6
Shader Model 6
The text was updated successfully, but these errors were encountered: