42 changes: 42 additions & 0 deletions libc/test/src/math/smoke/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3630,6 +3630,20 @@ add_fp_unittest(
libc.src.math.setpayloadsigf16
)

add_fp_unittest(
f16div_test
SUITE
libc-math-smoke-tests
SRCS
f16div_test.cpp
HDRS
DivTest.h
DEPENDS
libc.hdr.fenv_macros
libc.src.__support.FPUtil.basic_operations
libc.src.math.f16div
)

add_fp_unittest(
f16divf_test
SUITE
Expand All @@ -3644,6 +3658,34 @@ add_fp_unittest(
libc.src.math.f16divf
)

add_fp_unittest(
f16divl_test
SUITE
libc-math-smoke-tests
SRCS
f16divl_test.cpp
HDRS
DivTest.h
DEPENDS
libc.hdr.fenv_macros
libc.src.__support.FPUtil.basic_operations
libc.src.math.f16divl
)

add_fp_unittest(
f16divf128_test
SUITE
libc-math-smoke-tests
SRCS
f16divf128_test.cpp
HDRS
DivTest.h
DEPENDS
libc.hdr.fenv_macros
libc.src.__support.FPUtil.basic_operations
libc.src.math.f16divf128
)

add_fp_unittest(
f16fma_test
SUITE
Expand Down
13 changes: 13 additions & 0 deletions libc/test/src/math/smoke/f16div_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//===-- Unittests for f16div ----------------------------------------------===//
//
// 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/f16div.h"

LIST_DIV_TESTS(float16, double, LIBC_NAMESPACE::f16div)
13 changes: 13 additions & 0 deletions libc/test/src/math/smoke/f16divf128_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//===-- Unittests for f16divf128 ------------------------------------------===//
//
// 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/f16divf128.h"

LIST_DIV_TESTS(float16, float128, LIBC_NAMESPACE::f16divf128)
13 changes: 13 additions & 0 deletions libc/test/src/math/smoke/f16divl_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//===-- Unittests for f16divl ---------------------------------------------===//
//
// 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/f16divl.h"

LIST_DIV_TESTS(float16, long double, LIBC_NAMESPACE::f16divl)
11 changes: 11 additions & 0 deletions libc/utils/MPFRWrapper/MPFRUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,10 @@ template void explain_binary_operation_one_output_error(
template void
explain_binary_operation_one_output_error(Operation, const BinaryInput<float> &,
float16, double, RoundingMode);
template void explain_binary_operation_one_output_error(
Operation, const BinaryInput<double> &, float16, double, RoundingMode);
template void explain_binary_operation_one_output_error(
Operation, const BinaryInput<long double> &, float16, double, RoundingMode);
#endif

template <typename InputType, typename OutputType>
Expand Down Expand Up @@ -1104,6 +1108,13 @@ template bool compare_binary_operation_one_output(Operation,
const BinaryInput<float> &,
float16, double,
RoundingMode);
template bool compare_binary_operation_one_output(Operation,
const BinaryInput<double> &,
float16, double,
RoundingMode);
template bool
compare_binary_operation_one_output(Operation, const BinaryInput<long double> &,
float16, double, RoundingMode);
#endif

template <typename InputType, typename OutputType>
Expand Down