[libc-commits] [libc] [libc][math][c++23] Add Fmabf16 math function (PR #182836)

Anton Shepelev via libc-commits libc-commits at lists.llvm.org
Mon Feb 23 20:11:38 PST 2026


================
@@ -0,0 +1,69 @@
+//===-- Exhaustive test for fmabf16 ---------------------------------------===//
+//
+// 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/__support/FPUtil/bfloat16.h"
+#include "src/math/fmabf16.h"
+#include "test/UnitTest/FPMatcher.h"
+#include "test/UnitTest/Test.h"
+#include "utils/MPFRWrapper/MPFRUtils.h"
+
+using LlvmLibcFmaBf16Test = LIBC_NAMESPACE::testing::FPTest<bfloat16>;
+
+namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
+
+// subnormal range (negative)
+static constexpr uint16_t SUBNORM_NEG_START = 0x8001U;
+static constexpr uint16_t SUBNORM_NEG_STOP = 0x807FU;
+
+TEST_F(LlvmLibcFmaBf16Test, SubnormalNegativeRange) {
+  const bfloat16 z_values[] = {zero,    neg_zero,   inf,
----------------
amemov wrote:

I think these in tests can be `constexpr`?

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


More information about the libc-commits mailing list