[clang] [llvm] Adding splitdouble HLSL function (PR #109331)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 27 12:16:45 PDT 2024


================
@@ -422,6 +422,55 @@ template <typename T> constexpr uint asuint(T F) {
   return __detail::bit_cast<uint, T>(F);
 }
 
+//===----------------------------------------------------------------------===//
+// asuint splitdouble builtins
+//===----------------------------------------------------------------------===//
+
+/// \fn void asuint(double D, out uint lowbits, out int highbits)
+/// \brief Split and interprets the lowbits and highbits of double D into uints.
+/// \param D The input double.
+/// \param lowbits The output lowbits of D.
+/// \param highbits The highbits lowbits D.
+#if __is_target_arch(dxil)
----------------
farzonl wrote:

I might be confused here so I apologize ahead of time.  Isn't `__is_target_arch` a compile time check? I'm confused with how this work when we can change the compiler target after compilation via `-triple dxil-pc-shadermodel6.3-library` or  `-triple spirv--vulkan-library`?

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


More information about the cfe-commits mailing list