[clang] [llvm] Add normalize builtins and normalize HLSL function to DirectX and SPIR-V backend (PR #102683)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 12 14:41:17 PDT 2024


================
@@ -4725,6 +4725,12 @@ def HLSLMad : LangBuiltin<"HLSL_LANG"> {
   let Prototype = "void(...)";
 }
 
+def HLSLNormalize : LangBuiltin<"HLSL_LANG"> {
+  let Spellings = ["__builtin_hlsl_normalize"];
----------------
farzonl wrote:

I guess the point i was trying to make was that for each element in x you are dividing by length. Thats actually the same behavior as many of the log cases except those multiplies are via a constant float value while `1/length(x)` is dynamic.

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


More information about the cfe-commits mailing list