-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Implement the WaveReadLaneAt
HLSL Function
#70104
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
Closed
12 tasks
Labels
Comments
WaveReadLaneAt
intrinsicWaveReadLaneAt
HLSL Function
52 tasks
Taking a look into this. |
This was referenced Oct 1, 2024
Marking re-estimate this. Since this was originally refined, we have a different approach to implementing intrinsics and the way we've been estimating intrinsics has changed quite a bit. |
inbelic
added a commit
that referenced
this issue
Oct 16, 2024
Loading
Loading status checks…
- create a clang built-in in Builtins.td - add semantic checking in SemaHLSL.cpp - link the WaveReadLaneAt api in hlsl_intrinsics.h - add lowering to spirv backend op GroupNonUniformShuffle with Scope = 2 (Group) in SPIRVInstructionSelector.cpp - add WaveReadLaneAt intrinsic to IntrinsicsDirectX.td and mapping to DXIL.td - add tests for HLSL intrinsic lowering to spirv intrinsic in WaveReadLaneAt.hlsl - add tests for sema checks in WaveReadLaneAt-errors.hlsl - add spir-v backend tests in WaveReadLaneAt.ll - add test to show scalar dxil lowering functionality - note that this doesn't include support for the scalarizer to handle WaveReadLaneAt will be added in a future pr This is the first part #70104
DanielCChen
pushed a commit
to DanielCChen/llvm-project
that referenced
this issue
Oct 16, 2024
- create a clang built-in in Builtins.td - add semantic checking in SemaHLSL.cpp - link the WaveReadLaneAt api in hlsl_intrinsics.h - add lowering to spirv backend op GroupNonUniformShuffle with Scope = 2 (Group) in SPIRVInstructionSelector.cpp - add WaveReadLaneAt intrinsic to IntrinsicsDirectX.td and mapping to DXIL.td - add tests for HLSL intrinsic lowering to spirv intrinsic in WaveReadLaneAt.hlsl - add tests for sema checks in WaveReadLaneAt-errors.hlsl - add spir-v backend tests in WaveReadLaneAt.ll - add test to show scalar dxil lowering functionality - note that this doesn't include support for the scalarizer to handle WaveReadLaneAt will be added in a future pr This is the first part llvm#70104
inbelic
added a commit
that referenced
this issue
Oct 16, 2024
Loading
Loading status checks…
- Implement trivial scalarization for the `WaveReadLaneAt` DXIL intrinsic - Add test case to demonstrate the lowering path Resolves #70104
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
WaveReadLaneAt
clang builtin,WaveReadLaneAt
clang builtin withhlsl_intrinsics.h
WaveReadLaneAt
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
WaveReadLaneAt
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
clang/test/CodeGenHLSL/builtins/WaveReadLaneAt.hlsl
clang/test/SemaHLSL/BuiltIns/WaveReadLaneAt-errors.hlsl
int_dx_WaveReadLaneAt
intrinsic inIntrinsicsDirectX.td
DXILOpMapping
ofint_dx_WaveReadLaneAt
to117
inDXIL.td
WaveReadLaneAt.ll
andWaveReadLaneAt_errors.ll
tests inllvm/test/CodeGen/DirectX/
int_spv_WaveReadLaneAt
intrinsic inIntrinsicsSPIRV.td
WaveReadLaneAt
lowering and map it toint_spv_WaveReadLaneAt
inSPIRVInstructionSelector::selectIntrinsic
.llvm/test/CodeGen/SPIRV/hlsl-intrinsics/WaveReadLaneAt.ll
DirectX
SPIR-V
OpGroupNonUniformShuffle:
Description:
Result is the Value of the invocation identified by the
id Id.
Result Type must be a scalar or vector of floating-point
type, integer type, or Boolean
type.
Execution is a Scope that identifies the group of
invocations affected by this command.
The type of Value must be the same as Result Type.
Id must be a scalar of integer type, whose Signedness
operand is 0.
The resulting value is undefined if Id is an inactive invocation, or
is greater than or equal to the size of the group.
Capability:
GroupNonUniformShuffle
Missing before version 1.3.
6
345
<id>
Result Type
Result <id>
Scope <id>
Execution
<id>
Value
<id>
Id
Test Case(s)
Example 1
HLSL:
Returns the value of the expression for the given lane index within the specified wave.
Syntax
Parameters
expr
The expression to evaluate.
laneIndex
The index of the lane for which the expr result will be returned.
Return value
The resulting value is the result of expr. It will be uniform if laneIndex is uniform.
Remarks
If laneIndex is uniform, then this is effectively a broadcast operation; otherwise, it's a shuffle operation.
The result is undefined on a helper lane, or if the lane referred to by laneIndex is inactive or a helper lane.
This function is supported from shader model 6.0 in all shader stages.
See also
The text was updated successfully, but these errors were encountered: