[libc-commits] [libc] [libc][math][c23] Add dadd{l, f128} and ddiv{l, f128} C23 math functions (PR #100456)

via libc-commits libc-commits at lists.llvm.org
Wed Jul 31 01:36:50 PDT 2024


================
@@ -0,0 +1,13 @@
+//===-- Unittests for ddivl -----------------------------------------------===//
+//
+// 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 "DivTest.h"
+
+#include "src/math/ddivl.h"
+
+LIST_ADD_TESTS(double, long double, LIBC_NAMESPACE::ddivl)
----------------
overmighty wrote:

When math tests fail only for `long double`, it's usually because the format of `long double` on x86 needs special care. I would suggest you remove `ddivl` from this PR so that we can merge it. Then, if you want to fix `ddivl` yourself, you can read https://en.wikipedia.org/wiki/Extended_precision#x86_extended_precision_format.

I'm not sure why the tests passed on your machine. Could you enter these commands in a terminal and show the output?

```sh
builddir=replace/with/path/to/your/build/directory
cmake --build "${builddir}" --target libc.test.src.math.ddivl_test.__unit__.__build__
file "${builddir}"/projects/libc/test/src/math/libc.test.src.math.ddivl_test.__unit__.__build__
```

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


More information about the libc-commits mailing list