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

I don't believe normalize is an elementwise operation. 
"elementwise" semantically means "for each element". We have operations like 
elementwise_log, and elementwise_pow, etc. What they do is apply a specific 
binary operation to each element in a vector. Applying log to each element of a 
vector is applying log "elementwise", for each element.
The normalize operation can never be applied to a singular element in a vector, 
it doesn't make sense to normalize a single vector element. Normalization 
always applies to the whole vector, although what is actually happening is a 
division across each element in the vector. 
So I don't think elementwise_normalize makes sense, because it doesn't make 
sense to normalize a singular vector element, say a float.

https://github.com/llvm/llvm-project/pull/102683
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to