Mehdi Amini
efd9dc83f2
Revert "[APFloat] Add exp function for APFloat::IEEESsingle using expf implementation from LLVM libc. ( #143959 )" ( #172325 )
...
This reverts commit 4190d576823c18f45ee0632baee7d798448178ac.
See https://lab.llvm.org/buildbot/#/builders/181/builds/33524
```
from /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/llvm/lib/Support/APFloat.cpp:32:
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/llvm/../libc/src/__support/math/asin_utils.h:548:1: in ‘constexpr’ expansion of ‘__llvm_libc::fputil::DyadicFloat<128>(__llvm_libc::Sign::POS, -127, __llvm_libc::BigInt<128, false, long unsigned int>(__llvm_libc::operator""_u128(((const char*)"0x80000000\'00000000\'00000000\'00000000"))))’
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/llvm/../libc/src/__support/FPUtil/dyadic_float.h:109:5: in ‘constexpr’ expansion of ‘((__llvm_libc::fputil::DyadicFloat<128>*)this)->__llvm_libc::fputil::DyadicFloat<128>::normalize()’
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/llvm/../libc/src/__support/FPUtil/dyadic_float.h:118:16: in ‘constexpr’ expansion of ‘((__llvm_libc::fputil::DyadicFloat<128>*)this)->__llvm_libc::fputil::DyadicFloat<128>::mantissa.__llvm_libc::BigInt<128, false, long unsigned int>::operator<<=(((size_t)shift_length))’
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/llvm/../libc/src/__support/big_int.h:829:52: in ‘constexpr’ expansion of ‘__llvm_libc::multiword::shift<__llvm_libc::multiword::LEFT, false, long unsigned int, 2>(((__llvm_libc::BigInt<128, false, long unsigned int>*)this)->__llvm_libc::BigInt<128, false, long unsigned int>::val, s)’
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/llvm/../libc/src/__support/big_int.h:264:35: error: ‘constexpr __llvm_libc::cpp::enable_if_t<((((sizeof (To) == sizeof (From)) && __llvm_libc::cpp::is_trivially_constructible<To>::value) && __llvm_libc::cpp::is_trivially_copyable<T>::value) && __llvm_libc::cpp::is_trivially_copyable<From>::value), To> __llvm_libc::cpp::bit_cast(const From&) [with To = __int128 unsigned; From = __llvm_libc::cpp::array<long unsigned int, 2>; __llvm_libc::cpp::enable_if_t<((((sizeof (To) == sizeof (From)) && __llvm_libc::cpp::is_trivially_constructible<To>::value) && __llvm_libc::cpp::is_trivially_copyable<T>::value) && __llvm_libc::cpp::is_trivially_copyable<From>::value), To> = __int128 unsigned]’ called in a constant expression
264 | auto tmp = cpp::bit_cast<type>(array);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~
from /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/llvm/lib/Support/APFloat.cpp:32:
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/llvm/../libc/src/__support/CPP/bit.h:48:1: note: ‘constexpr __llvm_libc::cpp::enable_if_t<((((sizeof (To) == sizeof (From)) && __llvm_libc::cpp::is_trivially_constructible<To>::value) && __llvm_libc::cpp::is_trivially_copyable<T>::value) && __llvm_libc::cpp::is_trivially_copyable<From>::value), To> __llvm_libc::cpp::bit_cast(const From&) [with To = __int128 unsigned; From = __llvm_libc::cpp::array<long unsigned int, 2>; __llvm_libc::cpp::enable_if_t<((((sizeof (To) == sizeof (From)) && __llvm_libc::cpp::is_trivially_constructible<To>::value) && __llvm_libc::cpp::is_trivially_copyable<T>::value) && __llvm_libc::cpp::is_trivially_copyable<From>::value), To> = __int128 unsigned]’ is not usable as a ‘constexpr’ function because:
48 | bit_cast(const From &from) {
| ^~~~~~~~
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/llvm/../libc/src/__support/CPP/bit.h:56:28: error: call to non-‘constexpr’ function ‘void __llvm_libc::cpp::inline_copy(const char*, char*) [with unsigned int N = 16]’
56 | inline_copy<sizeof(From)>(src, dst);
```
2025-12-15 16:57:37 +01:00
lntue
4190d57682
[APFloat] Add exp function for APFloat::IEEESsingle using expf implementation from LLVM libc. ( #143959 )
...
Discourse RFC:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
- The implementation in LLVM libc is header-only.
- expf implementation in LLVM libc is correctly rounded for all rounding
modes.
- LLVM libc implementation will round to the floating point
environment's rounding mode.
- No cmake build dependency between LLVM and LLVM libc, only requires
LLVM libc source presents in llvm-project/libc folder.
2025-12-15 10:21:45 -05:00
Muhammad Bassiouni
e8defb503d
[libc][math] Refactor expm1 implementation to header-only in src/__support/math folder. ( #162127 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-12-04 16:51:43 +02:00
Muhammad Bassiouni
0d77cba6e1
[libc][math] Refactor exp2m1f16 implementation to header-only in src/__support/math folder. ( #162019 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-11-05 14:50:40 +02:00
Muhammad Bassiouni
a55c4c812e
[libc][math] Refactor exp2m1f implementation to header-only in src/__support/math folder. ( #162017 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-10-17 18:27:51 +03:00
Muhammad Bassiouni
878527651a
[libc][math] Refactor exp2f16 implementation to header-only in src/__support/math folder. ( #161993 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-10-11 23:27:00 +03:00
Anton Shepelev
1244fd24d9
[libc][math][c23] Add rsqrtf() function ( #159615 )
...
Closes #159614
**Changes:**
- Initial implementation of rsqrt for single precision float
**Some small unrelated style changes to this PR (that I missed in my
rsqrtf16 PR):**
- Added extra - to the top comments to make it look nicer in
libc/shared/math/rsqrtf16.h
- Put rsqrtf16 inside of libc/src/__support/math/CMakeLists.txt in
sorted order
- Rearanged libc_math_function rsqrtf16 in Bazel to match alphabetical
order
2025-10-08 23:37:01 -04:00
Muhammad Bassiouni
596ff855d0
[libc][math] Refactor exp2f implementation to header-only in src/__support/math folder. ( #161992 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-10-06 21:23:44 +03:00
Muhammad Bassiouni
3e78c313bc
[libc][math] Refactor exp2 implementation to header-only in src/__support/math folder. ( #161297 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-10-05 06:31:39 +03:00
Muhammad Bassiouni
6c032fa600
[libc][math] Refactor exp10m1f16 implementation to header-only in src/__support/math folder. ( #161119 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-10-01 11:21:19 +03:00
Muhammad Bassiouni
23d3caf854
[libc][math] Refactor exp10m1f implementation to header-only in src/__support/math folder. ( #159897 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-09-29 07:58:03 +03:00
Muhammad Bassiouni
2b937daa13
[libc][math] Refactor dsqrtl implementation to header-only in src/__support/math folder. ( #154868 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-09-20 07:24:21 +03:00
Anton Shepelev
80f9c72a1e
[libc][math][c23] Add rsqrtf16() function ( #137545 )
...
Addresses #132818
Part of #95250
2025-09-17 10:19:20 -04:00
Muhammad Bassiouni
4d323206ed
[libc][math] Refactor cospif16 implementation to header-only in src/__support/math folder. ( #154222 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-08-22 05:04:13 +03:00
Muhammad Bassiouni
783859b2a0
[libc][math] Refactor cospif implementation to header-only in src/__support/math folder. ( #154215 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-08-22 04:53:18 +03:00
Muhammad Bassiouni
2c79dc1082
[libc][math] Refactor coshf16 implementation to header-only in src/__support/math folder. ( #153582 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-08-19 02:08:07 +03:00
Muhammad Bassiouni
9ddc85f6d5
[libc][math] Refactor coshf implementation to header-only in src/__support/math folder. ( #153427 )
...
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-08-14 17:19:47 +03:00
Muhammad Bassiouni
0f6d3ad0fe
[libc][math] Refactor cosf16 implementation to header-only in src/__support/math folder. ( #152871 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-08-13 18:04:35 +03:00
Muhammad Bassiouni
200a99073f
[libc][math] Refactor cosf implementation to header-only in src/__support/math folder. ( #152069 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-08-11 21:08:21 +03:00
Muhammad Bassiouni
e86c9b6b1b
[libc][math] Refactor cos implementation to header-only in src/__support/math folder. ( #151883 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-08-09 18:51:54 +03:00
Muhammad Bassiouni
66734f4c3c
[libc][math] Refactor cbrtf implementation to header-only in src/__support/math folder. ( #151846 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-08-08 18:28:50 +03:00
Muhammad Bassiouni
003f6ada15
[libc][math] Refactor cbrt implementation to header-only in src/__support/math folder. ( #151837 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-08-03 21:02:53 +03:00
Muhammad Bassiouni
bb3cd6221b
[libc][math] Refactor atanhf16 implementation to header-only in src/__support/math folder. ( #151779 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-08-02 23:04:02 +03:00
Muhammad Bassiouni
99cd1d8aef
[libc][math] Refactor atanhf implementation to header-only in src/__support/math folder. ( #151399 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-08-02 02:54:13 +03:00
Muhammad Bassiouni
920079b793
[libc][math] Refactor atan2f128 implementation to header-only in src/__support/math folder. ( #151012 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-08-02 00:18:57 +03:00
Muhammad Bassiouni
9af2c21be4
[libc][math] Refactor atan2f implementation to header-only in src/__support/math folder. ( #150993 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-08-01 16:06:09 +03:00
Muhammad Bassiouni
c8b6ddf3a3
[libc][math] Refactor atan2 implementation to header-only in src/__support/math folder. ( #150968 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-31 01:07:55 +03:00
Muhammad Bassiouni
729b0d1b61
[libc][math] Refactor atanf16 implementation to header-only in src/__support/math folder. ( #150868 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-30 23:31:07 +03:00
Muhammad Bassiouni
f2a476d79a
[libc][math] Refactor atanf implementation to header-only in src/__support/math folder. ( #150854 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-30 07:24:49 +03:00
Muhammad Bassiouni
551dcc3e82
[libc][math] Refactor atan implementation to header-only in src/__support/math folder. ( #150852 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-29 21:16:57 +03:00
Muhammad Bassiouni
efbbc0b319
[libc][math] Refactor asinhf16 implementation to header-only in src/__support/math folder. ( #150849 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-29 20:19:01 +03:00
Muhammad Bassiouni
5bcbcf8d53
[libc][math] Refactor asinhf implementation to header-only in src/__support/math folder. ( #150843 )
...
Part of #147386
in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-28 18:14:47 +03:00
Muhammad Bassiouni
85213f2f88
[libc][math] Refactor asinf16 implementation to header-only in src/__support/math folder. ( #150800 )
...
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-27 20:03:10 +03:00
Muhammad Bassiouni
2eb112d78d
[libc][math] Refactor asinf implementation to header-only in src/__support/math folder. ( #150697 )
...
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-26 02:05:09 +03:00
Muhammad Bassiouni
bc19aedba2
[libc][math] Refactor asin implementation to header-only in src/__support/math folder. ( #148578 )
...
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-25 22:46:43 +03:00
Muhammad Bassiouni
47e2de0d50
[libc][math] Refactor acospif16 implementation to header-only in src/__support/math folder. ( #148574 )
...
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-25 21:28:27 +03:00
lntue
a883a67916
[libc] Fix dependency list of libc.src.__support.math.exp10f16. ( #150434 )
2025-07-25 16:10:47 +00:00
Muhammad Bassiouni
520398e752
[libc][math] Refactor acoshf16 implementation to header-only in src/__support/math folder. ( #148568 )
...
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-22 00:18:15 +03:00
Muhammad Bassiouni
84781c0ed3
[libc][math] Refactor acoshf implementation to header-only in src/__support/math folder. ( #148418 )
...
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-21 23:02:19 +03:00
Muhammad Bassiouni
fe267860c1
[libc][math] Refactor erff implementation to header-only in src/__support/math folder. ( #148413 )
...
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-21 22:24:24 +03:00
Muhammad Bassiouni
9ad7edef42
[libc][math] Refactor acosf16 implementation to header-only in src/__support/math folder. ( #148412 )
...
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-21 21:35:39 +03:00
Muhammad Bassiouni
2865f1ba96
[libc][math] add smoke tests to shared/math.h ( #149741 )
...
Adding smoke tests for shared math header.
part of #147386
2025-07-21 20:48:57 +03:00
Muhammad Bassiouni
ef4e4a0084
[libc][math] Refactor acosf implementation to header-only in src/__support/math folder. ( #148411 )
...
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-20 22:41:28 +03:00
Muhammad Bassiouni
cfddb401db
[libc][math] Refactor acos implementation to header-only in src/__support/math folder. ( #148409 )
...
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-19 05:21:34 +03:00
Muhammad Bassiouni
7e0ae019f8
[libc][math] Refactor exp10f16 implementation to header-only in src/__support/math folder. ( #148408 )
...
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-18 20:00:04 +03:00
Muhammad Bassiouni
b8bc3ff9be
[libc][math] Refactor exp10f implementation to header-only in src/__support/math folder. ( #148405 )
...
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-17 20:25:00 +03:00
Muhammad Bassiouni
3a6ef8b359
[libc][math] Refactor exp10 implementation to header-only in src/__support/math folder. ( #148400 )
...
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-16 22:48:29 +03:00
Muhammad Bassiouni
d969ec9422
[libc][math] Refactor exp implementation to header-only in src/__support/math folder. ( #148761 )
...
- **[libc][math] Refactor exp implementation to header-only in
src/__support/math folder.**
- **Reapply "[libc][math] Refactor exp implementation to header-only in
src/__support/math folder." (#148668 )**
2025-07-15 12:10:08 -04:00
lntue
f4630baaa2
Revert "[libc][math] Refactor exp implementation to header-only in src/__support/math folder." ( #148668 )
...
Reverts llvm/llvm-project#148091
Full build bots are failing.
2025-07-14 12:46:26 -04:00
Muhammad Bassiouni
a76dfde936
[libc][math] Refactor exp implementation to header-only in src/__support/math folder. ( #148091 )
...
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-14 12:21:27 -04:00