[libc-commits] [libc] [libc][math] implemented dadd and ddiv (PR #100456)

via libc-commits libc-commits at lists.llvm.org
Wed Jul 24 13:04:26 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: None (aaryanshukla)

<details>
<summary>Changes</summary>

- **testing**
- **[libc][math] rest of basic operations**
- **implementing daddl and daddf128**
- **testing**
  **[libc][math] implemented dadd and ddiv**


---

Patch is 29.74 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/100456.diff


35 Files Affected:

- (modified) libc/CMakeLists.txt (+1-1) 
- (modified) libc/config/baremetal/arm/entrypoints.txt (+4) 
- (modified) libc/config/baremetal/riscv/entrypoints.txt (+4) 
- (modified) libc/config/darwin/arm/entrypoints.txt (+8) 
- (modified) libc/config/darwin/x86_64/entrypoints.txt (+8) 
- (modified) libc/config/gpu/entrypoints.txt (+4) 
- (modified) libc/config/linux/aarch64/entrypoints.txt (+4) 
- (modified) libc/config/linux/arm/entrypoints.txt (+8) 
- (modified) libc/config/linux/riscv/entrypoints.txt (+8) 
- (modified) libc/config/linux/x86_64/entrypoints.txt (+4) 
- (modified) libc/config/windows/entrypoints.txt (+4) 
- (modified) libc/docs/math/index.rst (+4-4) 
- (modified) libc/newhdrgen/yaml_to_classes.py (+2-2) 
- (modified) libc/spec/stdc.td (+5) 
- (modified) libc/src/math/CMakeLists.txt (+4) 
- (added) libc/src/math/daddf128.h (+22) 
- (added) libc/src/math/daddl.h (+21) 
- (added) libc/src/math/ddivf128.h (+21) 
- (added) libc/src/math/ddivl.h (+20) 
- (modified) libc/src/math/fadd.h (+1-2) 
- (modified) libc/src/math/generic/CMakeLists.txt (+53-1) 
- (added) libc/src/math/generic/daddf128.cpp (+22) 
- (added) libc/src/math/generic/daddl.cpp (+20) 
- (added) libc/src/math/generic/ddivf128.cpp (+22) 
- (added) libc/src/math/generic/ddivl.cpp (+20) 
- (modified) libc/test/src/math/CMakeLists.txt (+57) 
- (added) libc/test/src/math/daddf128_test.cpp (+13) 
- (added) libc/test/src/math/daddl_test.cpp (+13) 
- (added) libc/test/src/math/ddivf128_test.cpp (+13) 
- (added) libc/test/src/math/ddivl_test.cpp (+13) 
- (modified) libc/test/src/math/smoke/CMakeLists.txt (+52) 
- (added) libc/test/src/math/smoke/daddf128_test.cpp (+13) 
- (added) libc/test/src/math/smoke/daddl_test.cpp (+13) 
- (added) libc/test/src/math/smoke/ddivf128_test.cpp (+13) 
- (added) libc/test/src/math/smoke/ddivl_test.cpp (+13) 


``````````diff
diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index 6e0760724d963..45cca17562d26 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -73,7 +73,7 @@ if(LIBC_BUILD_GPU_LOADER OR (LLVM_LIBC_GPU_BUILD AND NOT LLVM_RUNTIMES_BUILD))
   add_subdirectory(utils/gpu)
 endif()
 
-option(LIBC_USE_NEW_HEADER_GEN "Generate header files using new headergen instead of the old one" OFF)
+option(LIBC_USE_NEW_HEADER_GEN "Generate header files using new headergen instead of the old one" ON)
 
 set(NEED_LIBC_HDRGEN FALSE)
 if(NOT LLVM_RUNTIMES_BUILD)
diff --git a/libc/config/baremetal/arm/entrypoints.txt b/libc/config/baremetal/arm/entrypoints.txt
index 8025ac09b9f82..d9ba57ef0b9c5 100644
--- a/libc/config/baremetal/arm/entrypoints.txt
+++ b/libc/config/baremetal/arm/entrypoints.txt
@@ -247,6 +247,10 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.cos
     libc.src.math.cosf
     libc.src.math.coshf
+    libc.src.math.daddl
+    libc.src.math.daddf128
+    libc.src.math.ddivl
+    libc.src.math.ddivf128
     libc.src.math.erff
     libc.src.math.exp
     libc.src.math.exp10
diff --git a/libc/config/baremetal/riscv/entrypoints.txt b/libc/config/baremetal/riscv/entrypoints.txt
index fb0308c953746..d1a54dc24e385 100644
--- a/libc/config/baremetal/riscv/entrypoints.txt
+++ b/libc/config/baremetal/riscv/entrypoints.txt
@@ -243,6 +243,10 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.cos
     libc.src.math.cosf
     libc.src.math.coshf
+    libc.src.math.daddl
+    libc.src.math.daddf128
+    libc.src.math.ddivl
+    libc.src.math.ddivf128
     libc.src.math.erff
     libc.src.math.exp
     libc.src.math.exp10
diff --git a/libc/config/darwin/arm/entrypoints.txt b/libc/config/darwin/arm/entrypoints.txt
index ea5c7b537bbec..6c5e86f7dcafc 100644
--- a/libc/config/darwin/arm/entrypoints.txt
+++ b/libc/config/darwin/arm/entrypoints.txt
@@ -135,7 +135,15 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.cos
     libc.src.math.cosf
     libc.src.math.cospif
+    libc.src.math.daddl
+    libc.src.math.daddf128
     libc.src.math.dsqrtl
+    libc.src.math.ddivl
+    libc.src.math.ddivf128
+    libc.src.math.ddivl
+    libc.src.math.ddivf128
+    libc.src.math.ddivl
+    libc.src.math.ddivf128
     libc.src.math.erff
     libc.src.math.exp
     libc.src.math.expf
diff --git a/libc/config/darwin/x86_64/entrypoints.txt b/libc/config/darwin/x86_64/entrypoints.txt
index 1a7353172d464..6e461c4828d42 100644
--- a/libc/config/darwin/x86_64/entrypoints.txt
+++ b/libc/config/darwin/x86_64/entrypoints.txt
@@ -119,7 +119,15 @@ set(TARGET_LIBM_ENTRYPOINTS
     #libc.src.math.ceill
     #libc.src.math.coshf
     #libc.src.math.cosf
+    libc.src.math.daddl
+    libc.src.math.daddf128
     #libc.src.math.dsqrtl
+    libc.src.math.ddivl
+    libc.src.math.ddivf128
+    libc.src.math.ddivl
+    libc.src.math.ddivf128
+    libc.src.math.ddivl
+    libc.src.math.ddivf128
     #libc.src.math.expf
     #libc.src.math.exp2f
     #libc.src.math.expm1f
diff --git a/libc/config/gpu/entrypoints.txt b/libc/config/gpu/entrypoints.txt
index 506c7d6d7b314..8c3dfa47cb2c1 100644
--- a/libc/config/gpu/entrypoints.txt
+++ b/libc/config/gpu/entrypoints.txt
@@ -254,6 +254,10 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.cosf
     libc.src.math.cosh
     libc.src.math.coshf
+    libc.src.math.daddl
+    libc.src.math.daddf128
+    libc.src.math.ddivl
+    libc.src.math.ddivf128
     libc.src.math.erf
     libc.src.math.erff
     libc.src.math.exp
diff --git a/libc/config/linux/aarch64/entrypoints.txt b/libc/config/linux/aarch64/entrypoints.txt
index 0be6f884f0368..f0d6981bca02a 100644
--- a/libc/config/linux/aarch64/entrypoints.txt
+++ b/libc/config/linux/aarch64/entrypoints.txt
@@ -358,6 +358,10 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.cosf
     libc.src.math.coshf
     libc.src.math.cospif
+    libc.src.math.daddl
+    libc.src.math.daddf128
+    libc.src.math.ddivl
+    libc.src.math.ddivf128
     libc.src.math.dmull
     libc.src.math.dsqrtl
     libc.src.math.erff
diff --git a/libc/config/linux/arm/entrypoints.txt b/libc/config/linux/arm/entrypoints.txt
index 55f118395c22e..13992055d7074 100644
--- a/libc/config/linux/arm/entrypoints.txt
+++ b/libc/config/linux/arm/entrypoints.txt
@@ -227,7 +227,15 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.cos
     libc.src.math.cosf
     libc.src.math.coshf
+    libc.src.math.daddl
+    libc.src.math.daddf128
     libc.src.math.dsqrtl
+    libc.src.math.ddivl
+    libc.src.math.ddivf128
+    libc.src.math.ddivl
+    libc.src.math.ddivf128
+    libc.src.math.ddivl
+    libc.src.math.ddivf128
     libc.src.math.erff
     libc.src.math.exp
     libc.src.math.exp10
diff --git a/libc/config/linux/riscv/entrypoints.txt b/libc/config/linux/riscv/entrypoints.txt
index ea08957f4ee89..bc142e7d46523 100644
--- a/libc/config/linux/riscv/entrypoints.txt
+++ b/libc/config/linux/riscv/entrypoints.txt
@@ -381,8 +381,16 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.cosf
     libc.src.math.coshf
     libc.src.math.cospif
+    libc.src.math.daddl
+    libc.src.math.daddf128
     libc.src.math.dmull
     libc.src.math.dsqrtl
+    libc.src.math.ddivl
+    libc.src.math.ddivf128
+    libc.src.math.ddivl
+    libc.src.math.ddivf128
+    libc.src.math.ddivl
+    libc.src.math.ddivf128
     libc.src.math.erff
     libc.src.math.exp
     libc.src.math.exp10
diff --git a/libc/config/linux/x86_64/entrypoints.txt b/libc/config/linux/x86_64/entrypoints.txt
index 7c422bad9f01d..5fe9e7d19606b 100644
--- a/libc/config/linux/x86_64/entrypoints.txt
+++ b/libc/config/linux/x86_64/entrypoints.txt
@@ -383,6 +383,10 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.cospif
     libc.src.math.dmull
     libc.src.math.dsqrtl
+    libc.src.math.daddl
+    libc.src.math.daddf128
+    libc.src.math.ddivl
+    libc.src.math.ddivf128
     libc.src.math.erff
     libc.src.math.exp
     libc.src.math.exp10
diff --git a/libc/config/windows/entrypoints.txt b/libc/config/windows/entrypoints.txt
index b6aced83c5815..72b665cdf3932 100644
--- a/libc/config/windows/entrypoints.txt
+++ b/libc/config/windows/entrypoints.txt
@@ -132,6 +132,10 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.cos
     libc.src.math.cosf
     libc.src.math.coshf
+    libc.src.math.daddl
+    libc.src.math.daddf128
+    libc.src.math.ddivl
+    libc.src.math.ddivf128
     libc.src.math.erff
     libc.src.math.exp
     libc.src.math.expf
diff --git a/libc/docs/math/index.rst b/libc/docs/math/index.rst
index f287c16fd01e2..f8b18e11c8aac 100644
--- a/libc/docs/math/index.rst
+++ b/libc/docs/math/index.rst
@@ -114,10 +114,10 @@ Basic Operations
 +------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
 | copysign         | |check|          | |check|         | |check|                | |check|              | |check|                | 7.12.11.1              | F.10.8.1                   |
 +------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| dadd             | N/A              | N/A             |                        | N/A                  |                        | 7.12.14.1              | F.10.11                    |
-+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| ddiv             | N/A              | N/A             |                        | N/A                  |                        | 7.12.14.4              | F.10.11                    |
+| dadd             | N/A              | N/A             | |check|                | N/A                  | |check|                | 7.12.14.1              | F.10.11                    |
 +------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
+| ddiv             | N/A              | N/A             | |check|                | N/A                  | |check|                | 7.12.14.4              | F.10.11                    |
++------------------+------------------+-----------------+------------------------+----------------------+- -----------------------+------------------------+----------------------------+
 | dfma             | N/A              | N/A             |                        | N/A                  |                        | 7.12.14.5              | F.10.11                    |
 +------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
 | dmul             | N/A              | N/A             | |check|                | N/A                  | |check|\*              | 7.12.14.3              | F.10.11                    |
@@ -136,7 +136,7 @@ Basic Operations
 +------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
 | fabs             | |check|          | |check|         | |check|                | |check|              | |check|                | 7.12.7.3               | F.10.4.3                   |
 +------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| fadd             | N/A              | |check|         | |check|                | N/A                  | |check|                | 7.12.14.1              | F.10.11                    |
+| fadd             | N/A              |                 |                        | N/A                  |                        | 7.12.14.1              | F.10.11                    |
 +------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
 | fdim             | |check|          | |check|         | |check|                | |check|              | |check|                | 7.12.12.1              | F.10.9.1                   |
 +------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
diff --git a/libc/newhdrgen/yaml_to_classes.py b/libc/newhdrgen/yaml_to_classes.py
index 78588055cc960..29a8ff5eef05d 100644
--- a/libc/newhdrgen/yaml_to_classes.py
+++ b/libc/newhdrgen/yaml_to_classes.py
@@ -118,7 +118,7 @@ def load_yaml_file(yaml_file, header_class, entry_points):
         HeaderFile: An instance of HeaderFile populated with the data.
     """
     with open(yaml_file, "r") as f:
-        yaml_data = yaml.safe_load(f)
+        yaml_data = yaml.load(f, Loader=yaml.FullLoader)
     return yaml_to_classes(yaml_data, header_class, entry_points)
 
 
@@ -173,7 +173,7 @@ def add_function_to_yaml(yaml_file, function_details):
     new_function = parse_function_details(function_details)
 
     with open(yaml_file, "r") as f:
-        yaml_data = yaml.safe_load(f)
+        yaml_data = yaml.load(f, Loader=yaml.FullLoader)
 
     if "functions" not in yaml_data:
         yaml_data["functions"] = []
diff --git a/libc/spec/stdc.td b/libc/spec/stdc.td
index 0aae65308d33a..55ec2f96ecdf5 100644
--- a/libc/spec/stdc.td
+++ b/libc/spec/stdc.td
@@ -397,6 +397,11 @@ def StdC : StandardSpec<"stdc"> {
           GuardedFunctionSpec<"ceilf16", RetValSpec<Float16Type>, [ArgSpec<Float16Type>], "LIBC_TYPES_HAS_FLOAT16">,
           GuardedFunctionSpec<"ceilf128", RetValSpec<Float128Type>, [ArgSpec<Float128Type>], "LIBC_TYPES_HAS_FLOAT128">,
 
+          FunctionSpec<"daddf128", RetValSpec<DoubleType>, [ArgSpec<Float128Type>, ArgSpec<Float128Type>]>,
+          FunctionSpec<"daddl", RetValSpec<DoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<LongDoubleType>]>,
+          FunctionSpec<"ddivl", RetValSpec<DoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<LongDoubleType>]>,
+          FunctionSpec<"ddivf128", RetValSpec<DoubleType>, [ArgSpec<Float128Type>, ArgSpec<Float128Type>]>,
+
           FunctionSpec<"fabs", RetValSpec<DoubleType>, [ArgSpec<DoubleType>], [ConstAttr]>,
           FunctionSpec<"fabsf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
           FunctionSpec<"fabsl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>]>,
diff --git a/libc/src/math/CMakeLists.txt b/libc/src/math/CMakeLists.txt
index 25aef3f72e3cd..5688c3590c18d 100644
--- a/libc/src/math/CMakeLists.txt
+++ b/libc/src/math/CMakeLists.txt
@@ -86,6 +86,10 @@ add_math_entrypoint_object(cosh)
 add_math_entrypoint_object(coshf)
 add_math_entrypoint_object(cospif)
 
+add_math_entrypoint_object(daddl)
+add_math_entrypoint_object(daddf128)
+add_math_entrypoint_object(ddivl)
+add_math_entrypoint_object(ddivf128)
 add_math_entrypoint_object(dmull)
 add_math_entrypoint_object(dmulf128)
 
diff --git a/libc/src/math/daddf128.h b/libc/src/math/daddf128.h
new file mode 100644
index 0000000000000..2ad261d525337
--- /dev/null
+++ b/libc/src/math/daddf128.h
@@ -0,0 +1,22 @@
+//===-- Implementation header for daddf128 --------------------------*- C++
+//-*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC_MATH_DADDF128_H
+#define LLVM_LIBC_SRC_MATH_DADDF128_H
+
+#include "include/llvm-libc-types/float128.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+double daddf128(float128 x, float128 y);
+
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC_MATH_DADDF128_H
diff --git a/libc/src/math/daddl.h b/libc/src/math/daddl.h
new file mode 100644
index 0000000000000..1b3bdeeb04894
--- /dev/null
+++ b/libc/src/math/daddl.h
@@ -0,0 +1,21 @@
+//===-- Implementation header for daddl --------------------------*- C++
+//-*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC_MATH_DADDL_H
+#define LLVM_LIBC_SRC_MATH_DADDL_H
+
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+double daddl(long double x, long double y);
+
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC_MATH_DADDL_H
diff --git a/libc/src/math/ddivf128.h b/libc/src/math/ddivf128.h
new file mode 100644
index 0000000000000..a32d2349f8952
--- /dev/null
+++ b/libc/src/math/ddivf128.h
@@ -0,0 +1,21 @@
+//===-- Implementation header for ddivf128 ----------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC_MATH_DDIVF128_H
+#define LLVM_LIBC_SRC_MATH_DDIVF128_H
+
+#include "include/llvm-libc-types/float128.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+double ddivf128(float128 x, float128 y);
+
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC_MATH_DDIVF128_H
diff --git a/libc/src/math/ddivl.h b/libc/src/math/ddivl.h
new file mode 100644
index 0000000000000..bf0da2887e330
--- /dev/null
+++ b/libc/src/math/ddivl.h
@@ -0,0 +1,20 @@
+//===-- Implementation header for ddivl -------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC_MATH_DDIVL_H
+#define LLVM_LIBC_SRC_MATH_DDIVL_H
+
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+double ddivl(long double x, long double y);
+
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC_MATH_DDIVL_H
diff --git a/libc/src/math/fadd.h b/libc/src/math/fadd.h
index ec3ce18bb676a..1186f1ef40954 100644
--- a/libc/src/math/fadd.h
+++ b/libc/src/math/fadd.h
@@ -6,11 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/__support/macros/config.h"
-
 #ifndef LLVM_LIBC_SRC_MATH_FADD_H
 #define LLVM_LIBC_SRC_MATH_FADD_H
 
+#include "src/__support/macros/config.h"
 namespace LIBC_NAMESPACE_DECL {
 
 float fadd(double x, double y);
diff --git a/libc/src/math/generic/CMakeLists.txt b/libc/src/math/generic/CMakeLists.txt
index 74360edff3f9a..61aa76a331c84 100644
--- a/libc/src/math/generic/CMakeLists.txt
+++ b/libc/src/math/generic/CMakeLists.txt
@@ -129,6 +129,58 @@ add_entrypoint_object(
     libc.src.__support.FPUtil.nearest_integer_operations
 )
 
+add_entrypoint_object(
+  daddl
+  SRCS
+    daddl.cpp
+  HDRS
+    ../daddl.h
+  COMPILE_OPTIONS
+    -O3
+  DEPENDS
+    libc.src.__support.macros.properties.types
+    libc.src.__support.FPUtil.generic.add_sub
+
+)
+
+add_entrypoint_object(
+  daddf128
+  SRCS
+    daddf128.cpp
+  HDRS
+    ../daddf128.h
+  COMPILE_OPTIONS
+    -O3
+ DEPENDS
+    libc.src.__support.macros.properties.types
+    libc.src.__support.FPUtil.generic.add_sub
+)
+
+add_entrypoint_object(
+  ddivl
+  SRCS
+    ddivl.cpp
+  HDRS
+    ../ddivl.h
+  COMPILE_OPTIONS
+    -O3
+  DEPENDS
+    libc.src.__support.macros.properties.types
+    libc.src.__support.FPUtil.generic.div
+)
+
+add_entrypoint_object(
+  ddivf128
+  SRCS
+    ddivf128.cpp
+  HDRS
+    ../ddivf128.h
+  COMPILE_OPTIONS
+    -O3
+  DEPENDS
+    libc.src.__support.FPUtil.generic.div
+)
+
 add_entrypoint_object(
   dsqrtl
   SRCS
@@ -492,7 +544,7 @@ add_entrypoint_object(
   HDRS
     ../fadd.h
   DEPENDS
-    libc.src.__support.FPUtil.basic_operations
+    libc.src.__support.FPUtil.generic.add_sub
   COMPILE_OPTIONS
     -O3
 )
diff --git a/libc/src/math/generic/daddf128.cpp b/libc/src/math/generic/daddf128.cpp
new file mode 100644
index 0000000000000..b967689ec9e81
--- /dev/null
+++ b/libc/src/math/generic/daddf128.cpp
@@ -0,0 +1,22 @@
+//===-- Implementation of daddf128 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/daddf128.h"
+#include "include/llvm-libc-types/float128.h"
+#include "src/__support/FPUtil/generic/add_sub.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(double, daddf128, (float128 x, float128 y)) {
+  return fputil::generic::add<double>(x, y);
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/daddl.cpp b/libc/src/math/generic/daddl.cpp
new file mode 100644
index 0000000000000..2ae1add239162
--- /dev/null
+++ b/libc/src/math/generic/daddl.cpp
@@ -0,0 +1,20 @@
+//===-- Implementation of daddl 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/daddl.h"
+#include "src/__support/FPUtil/generic/add_sub.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(double, daddl, (long double x, long double y)) {
+  return fputil::generic::add<double>(x, y);
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/ddivf128.cpp b/libc/src/math/generic/ddivf12...
[truncated]

``````````

</details>


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


More information about the libc-commits mailing list