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

Farzon Lotfi via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 27 20:11:16 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:

So my theory was that something about  using `#elif __is_target_arch(spirv)`

is forcing us to have to specify `-cc1 -triple ` in `clang/test/Driver/hlsl-lang-targets-spirv.hlsl` instead of `-target `.

I don't fully understand what though.

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


More information about the llvm-commits mailing list