[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 11:05:48 PDT 2025


================
@@ -21,3 +21,4 @@ def subgroup_local_invocation_id : SPIRVBuiltin<"uint32_t()", [NoThrow, Const]>;
 def distance : SPIRVBuiltin<"void(...)", [NoThrow, Const]>;
 def length : SPIRVBuiltin<"void(...)", [NoThrow, Const]>;
 def smoothstep : SPIRVBuiltin<"void(...)", [NoThrow, Const, CustomTypeChecking]>;
+def fwidth : SPIRVBuiltin<"void(...)", [NoThrow, Const, CustomTypeChecking]>;
----------------
farzonl wrote:

we only put things here if this builtin should work for both CL and VK contexts. If this is just a VK feature please move to 
`clang/include/clang/Basic/BuiltinsSPIRVVK.td`

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


More information about the cfe-commits mailing list