[libc-commits] [libc] [llvm] [libc][math] Refactor ffma implementation to header-only in src/__support/math folder (PR #175304)

Muhammad Bassiouni via libc-commits libc-commits at lists.llvm.org
Sat Jan 10 08:13:04 PST 2026


================
@@ -0,0 +1,26 @@
+//===-- Implementation header for ffma --------------------------*- 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___SUPPORT_MATH_FFMA_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_FFMA_H
+
+#include "src/__support/FPUtil/FMA.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE static float ffma(double x, double y, double z) {
----------------
bassiounix wrote:

```suggestion
LIBC_INLINE static constexpr float ffma(double x, double y, double z) {
```

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


More information about the libc-commits mailing list