[libc-commits] [libc] [libc] Add `lgamma` and `lgamma_r` stubs for the GPU (PR #102019)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Mon Aug 5 12:19:34 PDT 2024


================
@@ -767,6 +767,14 @@ def StdC : StandardSpec<"stdc"> {
           GuardedFunctionSpec<"f16divf128", RetValSpec<Float16Type>, [ArgSpec<Float128Type>, ArgSpec<Float128Type>], "LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128">,
 
           GuardedFunctionSpec<"f16sqrtf128", RetValSpec<Float16Type>, [ArgSpec<Float128Type>], "LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128">,
+
+          FunctionSpec<"lgamma", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
+          FunctionSpec<"lgammaf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
+          FunctionSpec<"lgammal", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>]>,
+
+          FunctionSpec<"lgamma_r", RetValSpec<DoubleType>, [ArgSpec<DoubleType, IntPtr>]>,
----------------
jhuber6 wrote:

> The lgamma() functions are specified in C99 and POSIX.1-2001. signgam is specified in POSIX.1-2001, but not in C99. The lgamma_r() functions are nonstandard, but present on several other systems.

No standard lol.

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


More information about the libc-commits mailing list