[libc-commits] [libc] [libc][math][c23] Implement canonicalize functions (PR #85940)

via libc-commits libc-commits at lists.llvm.org
Thu Mar 21 07:27:19 PDT 2024


================
@@ -570,6 +570,11 @@ def StdC : StandardSpec<"stdc"> {
           FunctionSpec<"nan", RetValSpec<DoubleType>, [ArgSpec<ConstCharPtr>]>,
           FunctionSpec<"nanl", RetValSpec<LongDoubleType>, [ArgSpec<ConstCharPtr>]>,
           GuardedFunctionSpec<"nanf128", RetValSpec<Float128Type>, [ArgSpec<ConstCharPtr>], "LIBC_TYPES_HAS_FLOAT128">,
+
+          FunctionSpec<"canonicalize", RetValSpec<IntType>, [ArgSpec<DoubleType>, ArgSpec<DoubleType>]>,
+          FunctionSpec<"canonicalizef", RetValSpec<IntType>, [ArgSpec<FloatType>, ArgSpec<FloatType>]>,
+          GuardedFunctionSpec<"canonicalizef128", RetValSpec<IntType>, [ArgSpec<Float128Type>, ArgSpec<Float128Type>]>,
----------------
lntue wrote:

Add the guard `LIBC_TYPES_HAS_FLOAT128` at the end, similar to L572.

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


More information about the libc-commits mailing list