-
Notifications
You must be signed in to change notification settings - Fork 13k
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
[HLSL] implement rcp
intrinsic
#70100
Labels
clang:codegen
IR generation bugs: mangling, exceptions, etc.
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
HLSL
HLSL Language Support
Comments
farzonl
added a commit
to farzonl/llvm-project
that referenced
this issue
Mar 3, 2024
This PR implements the frontend for llvm#70100 This PR is part 1 of 2. Part 2 depends on dixl-lerp-intrinsic-lowering PR which will have an intrinsic to instruction expansion pass. THat pass is what we need to complete the DXIL lowering portion of this PR: llvm/[email protected]:llvm-project:dixl-lerp-intrinsic-lowering Builtins.td - add an rcp builtin CGBuiltin.cpp add the builtin to intrinsic lowering hlsl_intrinsics.h - add the rcp api SemaChecking.cpp - reuse frac's semachecks IntrinsicsDirectX.td add the llvm intrinsic
farzonl
added a commit
to farzonl/llvm-project
that referenced
this issue
Mar 5, 2024
This PR implements the frontend for llvm#70100 This PR is part 1 of 2. Part 2 depends on dixl-lerp-intrinsic-lowering PR which will have an intrinsic to instruction expansion pass. THat pass is what we need to complete the DXIL lowering portion of this PR: llvm/[email protected]:llvm-project:dixl-lerp-intrinsic-lowering Builtins.td - add an rcp builtin CGBuiltin.cpp add the builtin to intrinsic lowering hlsl_intrinsics.h - add the rcp api SemaChecking.cpp - reuse frac's semachecks IntrinsicsDirectX.td add the llvm intrinsic
farzonl
added a commit
that referenced
this issue
Mar 5, 2024
This PR implements the frontend for #70100 This PR is part 1 of 2. Part 2 requires an intrinsic to instructions lowering. - `Builtins.td` - add an `rcp` builtin - `CGBuiltin.cpp` - add the builtin to intrinsic lowering - `hlsl_intrinsics.h` - add the `rcp` api - `SemaChecking.cpp` - reuse frac's sema checks - `IntrinsicsDirectX.td` - add the llvm intrinsic
farzonl
added a commit
to farzonl/llvm-project
that referenced
this issue
Mar 8, 2024
This change implements lowering for llvm#70076, llvm#70100, llvm#70072, & llvm#70102 CGBuiltin.cpp - - simplify lerp intrinsic IntrinsicsDirectX.td - simplify lerp intrinsic SemaChecking.cpp - remove unnecessary check DXILIntrinsicExpansion.* - add intrinsic to instruction expansion cases DXILOpLowering.cpp - make sure DXILIntrinsicExpansion happens first DirectX.h - changes to support new pass DirectXTargetMachine.cpp - changes to support new pass
@llvm/issue-subscribers-clang-frontend Author: Chris B (llvm-beanz)
Implement HLSL `rcp` intrinsic:
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/rcp |
@llvm/issue-subscribers-clang-codegen Author: Chris B (llvm-beanz)
Implement HLSL `rcp` intrinsic:
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/rcp |
farzonl
added a commit
to farzonl/llvm-project
that referenced
this issue
Mar 12, 2024
This change implements lowering for llvm#70076, llvm#70100, llvm#70072, & llvm#70102 CGBuiltin.cpp - - simplify lerp intrinsic IntrinsicsDirectX.td - simplify lerp intrinsic SemaChecking.cpp - remove unnecessary check DXILIntrinsicExpansion.* - add intrinsic to instruction expansion cases DXILOpLowering.cpp - make sure DXILIntrinsicExpansion happens first DirectX.h - changes to support new pass DirectXTargetMachine.cpp - changes to support new pass
farzonl
added a commit
to farzonl/llvm-project
that referenced
this issue
Mar 14, 2024
This change implements lowering for llvm#70076, llvm#70100, llvm#70072, & llvm#70102 `CGBuiltin.cpp` - - simplify `lerp` intrinsic `IntrinsicsDirectX.td` - simplify `lerp` intrinsic `SemaChecking.cpp` - remove unnecessary check `DXILIntrinsicExpansion.*` - add intrinsic to instruction expansion cases `DXILOpLowering.cpp` - make sure `DXILIntrinsicExpansion` happens first `DirectX.h` - changes to support new pass `DirectXTargetMachine.cpp` - changes to support new pass Why `any`, and `lerp` as instruction expansion just for DXIL? - SPIR-V there is an [OpAny](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpAny) - SPIR-V has a GLSL lerp extension via [Fmix](https://registry.khronos.org/SPIR-V/specs/1.0/GLSL.std.450.html#FMix) Why `exp` instruction expansion? - We have an `exp2` opcode and `exp` reuses that opcode. So instruction expansion is a convenient way to do preprocessing. - Further SPIR-V has a GLSL exp extension via [Exp](https://registry.khronos.org/SPIR-V/specs/1.0/GLSL.std.450.html#Exp) and [Exp2](https://registry.khronos.org/SPIR-V/specs/1.0/GLSL.std.450.html#Exp2) Why `rcp` as instruction expansion? This one is a bit of the odd man out and might have to move to `cgbuiltins` when we better understand SPIRV requirements. However I included it because it seems like [fast math mode has an AllowRecip flag](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#_fp_fast_math_mode) which lets you compute the reciprocal without performing the division. We don't have that in DXIL so thought to include it.
farzonl
added a commit
that referenced
this issue
Mar 15, 2024
This change implements lowering for #70076, #70100, #70072, & #70102 `CGBuiltin.cpp` - - simplify `lerp` intrinsic `IntrinsicsDirectX.td` - simplify `lerp` intrinsic `SemaChecking.cpp` - remove unnecessary check `DXILIntrinsicExpansion.*` - add intrinsic to instruction expansion cases `DXILOpLowering.cpp` - make sure `DXILIntrinsicExpansion` happens first `DirectX.h` - changes to support new pass `DirectXTargetMachine.cpp` - changes to support new pass Why `any`, and `lerp` as instruction expansion just for DXIL? - SPIR-V there is an [OpAny](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpAny) - SPIR-V has a GLSL lerp extension via [Fmix](https://registry.khronos.org/SPIR-V/specs/1.0/GLSL.std.450.html#FMix) Why `exp` instruction expansion? - We have an `exp2` opcode and `exp` reuses that opcode. So instruction expansion is a convenient way to do preprocessing. - Further SPIR-V has a GLSL exp extension via [Exp](https://registry.khronos.org/SPIR-V/specs/1.0/GLSL.std.450.html#Exp) and [Exp2](https://registry.khronos.org/SPIR-V/specs/1.0/GLSL.std.450.html#Exp2) Why `rcp` as instruction expansion? This one is a bit of the odd man out and might have to move to `cgbuiltins` when we better understand SPIRV requirements. However I included it because it seems like [fast math mode has an AllowRecip flag](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#_fp_fast_math_mode) which lets you compute the reciprocal without performing the division. We don't have that in DXIL so thought to include it.
This was referenced Aug 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
clang:codegen
IR generation bugs: mangling, exceptions, etc.
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
HLSL
HLSL Language Support
Implement HLSL
rcp
intrinsic:https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/rcp
The text was updated successfully, but these errors were encountered: