[libc-commits] [libc] [libc][math][c23] Implement canonicalize functions (PR #85940)
via libc-commits
libc-commits at lists.llvm.org
Thu Mar 21 09:15:05 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:
>From the table **Interpretation of the fields of an x86 Extended Precision value** on the [wiki page](https://en.wikipedia.org/wiki/Extended_precision#x86_extended_precision_format), all the **pseudo** and **unnormal** are not canonical forms, and you will need to convert them to the canonical forms of the same values.
https://github.com/llvm/llvm-project/pull/85940
More information about the libc-commits
mailing list