Skip to content

Commit 1ceafa2

Browse files
committed
Add float128 same-type MPFR tests
1 parent d644891 commit 1ceafa2

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

libc/test/src/math/add_same_type_test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ LIST_ADD_SAME_TYPE_TESTS(LongDouble, long double, long double,
2020
#ifdef LIBC_TYPES_HAS_FLOAT16
2121
LIST_ADD_SAME_TYPE_TESTS(Float16, float16, float16, ADD_FUNC(float16))
2222
#endif
23+
#ifdef LIBC_TYPES_HAS_FLOAT128
24+
LIST_ADD_SAME_TYPE_TESTS(Float128, float128, float128, ADD_FUNC(float128))
25+
#endif

libc/test/src/math/sub_same_type_test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ LIST_SUB_SAME_TYPE_TESTS(LongDouble, long double, long double,
2020
#ifdef LIBC_TYPES_HAS_FLOAT16
2121
LIST_SUB_SAME_TYPE_TESTS(Float16, float16, float16, SUB_FUNC(float16))
2222
#endif
23+
#ifdef LIBC_TYPES_HAS_FLOAT128
24+
LIST_SUB_SAME_TYPE_TESTS(Float128, float128, float128, SUB_FUNC(float128))
25+
#endif

libc/utils/MPFRWrapper/MPFRUtils.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,10 @@ template void explain_binary_operation_one_output_error(
401401
template void explain_binary_operation_one_output_error(
402402
Operation, const BinaryInput<long double> &, float16, double, RoundingMode);
403403
#endif
404+
#ifdef LIBC_TYPES_HAS_FLOAT128
405+
template void explain_binary_operation_one_output_error(
406+
Operation, const BinaryInput<float128> &, float128, double, RoundingMode);
407+
#endif
404408

405409
template <typename InputType, typename OutputType>
406410
void explain_ternary_operation_one_output_error(
@@ -625,6 +629,12 @@ template bool
625629
compare_binary_operation_one_output(Operation, const BinaryInput<long double> &,
626630
float16, double, RoundingMode);
627631
#endif
632+
#ifdef LIBC_TYPES_HAS_FLOAT128
633+
template bool compare_binary_operation_one_output(Operation,
634+
const BinaryInput<float128> &,
635+
float128, double,
636+
RoundingMode);
637+
#endif
628638

629639
template <typename InputType, typename OutputType>
630640
bool compare_ternary_operation_one_output(Operation op,

0 commit comments

Comments
 (0)