================
@@ -871,6 +871,34 @@ float3 degrees(float3);
 _HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_degrees)
 float4 degrees(float4);
 
+//===----------------------------------------------------------------------===//
+// distance builtins
+//===----------------------------------------------------------------------===//
+
+/// \fn K distance(T X, T Y)
+/// \brief Returns a distance scalar between two vectors of \a X and \a Y.
----------------
farzonl wrote:

I see what you are saying. The comment was copied from the official 
documentation and technically the scalar version is just `abs(X-Y)`. In past 
intrinsics I've just used this first line: 
https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src/direct3dhlsl/dx-graphics-hlsl-distance.md?plain=1#L20

I could instead use this line for return value as it makes no mention of 
vectors: 
https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src/direct3dhlsl/dx-graphics-hlsl-distance.md?plain=1#L46


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

Reply via email to