[clang] [llvm] [HLSL] Implement the `fwidth` intrinsic for DXIL and SPIR-V target (PR #161378)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 15 10:52:45 PDT 2025


================
@@ -162,6 +162,8 @@ def int_dx_splitdouble : DefaultAttrsIntrinsic<[llvm_anyint_ty, LLVMMatchType<0>
     [LLVMScalarOrSameVectorWidth<0, llvm_double_ty>], [IntrNoMem]>;
 def int_dx_radians : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>], [IntrNoMem]>;
 def int_dx_discard : DefaultAttrsIntrinsic<[], [llvm_i1_ty], []>;
+def int_dx_deriv_coarse_x : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>], [IntrNoMem]>;
+def int_dx_deriv_coarse_y : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>], [IntrNoMem]>;
----------------
farzonl wrote:

I have concerns with how we are going about this because these need spirv implementations and we are half implementing other tickets to make progress on fwidth. I kind of feel like fwidth should be blocked until we do these two tickets
- https://github.com/llvm/llvm-project/issues/99100
- https://github.com/llvm/llvm-project/issues/99097

https://github.com/llvm/llvm-project/pull/161378


More information about the cfe-commits mailing list