[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 11:11:21 PDT 2024


================
@@ -4707,6 +4707,12 @@ def HLSLIsinf : LangBuiltin<"HLSL_LANG"> {
   let Prototype = "void(...)";
 }
 
+def HLSLLength : LangBuiltin<"HLSL_LANG"> {
+  let Spellings = ["__builtin_hlsl_elementwise_length"];
----------------
bogner wrote:

I think this should be "__builtin_hlsl_length", not "__builtin_hlsl_elementwise_length". The word "elementwise" means we do an operation to each element, whereas this is an operation on the whole vector.

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


More information about the llvm-commits mailing list