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

via libc-commits libc-commits at lists.llvm.org
Wed Mar 20 08:18:01 PDT 2024


================
@@ -0,0 +1,27 @@
+//===-- Implementation of canonicalizel function
+//----------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===-------------------------------------------------------------------------------===//
+
+#include "src/math/canonicalizel.h"
+#include "src/__support/FPUtil/FEnvImpl.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/common.h"
+
+namespace LIBC_NAMESPACE {
+
+LLVM_LIBC_FUNCTION(int, canonicalizel,
+                   (long double *cx, const long double *x)) {
+  using FPB = fputil::FPBits<long double>;
----------------
lntue wrote:

You will need a separate implementation for x86-long double, following the description at https://en.wikipedia.org/wiki/Extended_precision#x86_extended_precision_format

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


More information about the libc-commits mailing list