aboutsummaryrefslogtreecommitdiff
path: root/libc/shared
AgeCommit message (Collapse)AuthorFilesLines
2026-01-12[libc][math] Refactor ilogbf16 implementation to header-only in ↵mitchell2-0/+29
src/__support/math folder. (#175450) Closes [#175346](https://github.com/llvm/llvm-project/issues/175346), Part of #175344
2026-01-12[libc][math] Fix GPU build fails (#175474)Muhammad Bassiouni1-1/+1
2026-01-12[libc][math] Refactor log to header-only shared math (#175395)CarvedCoder2-0/+23
Refactors log to a header-only shared math implementation. Fixes #175369
2026-01-09[libc][math] Refactor sin implementation to header-only in ↵lntue2-0/+24
src/__support/math folder. (#175200) 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
2026-01-10[libc][math] Refactor expm1f16 implementation to header-only in ↵Muhammad Bassiouni2-0/+30
src/__support/math folder. (#162132) 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-22[libc][math] Add LIBC_CONF_MATH_USE_SYSTEM_FENV / LIBC_MATH_USE_SYSTEM_FENV ↵lntue1-0/+5
(#172902) This is to allow math function implementations to use system libc's fenv.h instead of internal fenv implementations.
2025-12-19[libc][math] Refactor expm1f implementation to header-only in ↵Muhammad Bassiouni2-0/+24
src/__support/math folder. (#162131) 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-15Revert "[APFloat] Add exp function for APFloat::IEEESsingle using expf ↵Mehdi Amini1-1/+0
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[APFloat] Add exp function for APFloat::IEEESsingle using expf ↵lntue1-0/+1
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-04[libc][math] Refactor expm1 implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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-11-13[libc][NFC] Fix warnings in RPC server codeJoseph Huber1-3/+3
2025-11-05[libc][math] Refactor exp2m1f16 implementation to header-only in ↵Muhammad Bassiouni2-0/+30
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-10-17[libc][math] Refactor exp2m1f implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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-11[libc][math] Refactor exp2f16 implementation to header-only in ↵Muhammad Bassiouni2-0/+30
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-08[libc][math][c23] Add rsqrtf() function (#159615)Anton Shepelev3-2/+25
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-06[libc][math] Refactor exp2f implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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-05[libc][math] Refactor exp2 implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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-01[libc][math] Refactor exp10m1f16 implementation to header-only in ↵Muhammad Bassiouni2-0/+30
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-09-29[libc][math] Refactor exp10m1f implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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-22[libc] Remove separate RPC test handling (#160206)Joseph Huber1-1/+6
Summary: This was originally kept separate so it didn't pollute the name space, but now I'm thinking it's just easier to bundle it in with the default interface. This means that we'll have a bit of extra code for people using the server.h file to handle libc opcodes, but it's minimal (3 functions) and it simplifies this. I'm doing this because I'm hoping to move the GPU tester binary to liboffload which handles `libc` opcodes internally except these. This is the easier option compared to adding a hook to register custom handlers there.
2025-09-20[libc][math] Refactor dsqrtl implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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-17[libc][math][c23] Add rsqrtf16() function (#137545)Anton Shepelev2-0/+31
Addresses #132818 Part of #95250
2025-08-22[libc][math] Refactor cospif16 implementation to header-only in ↵Muhammad Bassiouni2-0/+29
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[libc][math] Refactor cospif implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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-19[libc][math] Refactor coshf16 implementation to header-only in ↵Muhammad Bassiouni2-0/+29
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-14[libc][math] Refactor coshf implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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-13[libc][math] Refactor cosf16 implementation to header-only in ↵Muhammad Bassiouni2-0/+29
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-11[libc][math] Refactor cosf implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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-09[libc][math] Refactor cos implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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-08[libc] Fix server code when GPU is acting as the serverJoseph Huber1-0/+3
Summary: Small fix that just ignores all the extra lanes if we're running the server from a platform that potentially has more.
2025-08-08[libc][math] Refactor cbrtf implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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-03[libc][math] Refactor cbrt implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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-02[libc][math] Refactor atanhf16 implementation to header-only in ↵Muhammad Bassiouni2-0/+29
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[libc][math] Refactor atanhf implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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[libc][math] Refactor atan2f128 implementation to header-only in ↵Muhammad Bassiouni2-0/+30
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-01[libc][math] Refactor atan2f implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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-07-31[libc][math] Refactor atan2 implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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-30[libc][math] Refactor atanf16 implementation to header-only in ↵Muhammad Bassiouni2-0/+29
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[libc][math] Refactor atanf implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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-29[libc][math] Refactor atan implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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[libc][math] Refactor asinhf16 implementation to header-only in ↵Muhammad Bassiouni3-1/+30
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-28[libc][math] Refactor asinhf implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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-27[libc][math] Refactor asinf16 implementation to header-only in ↵Muhammad Bassiouni2-0/+29
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-26[libc][math] Refactor asinf implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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-25[libc][math] Refactor asin implementation to header-only in ↵Muhammad Bassiouni2-0/+24
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[libc][math] Refactor acospif16 implementation to header-only in ↵Muhammad Bassiouni2-0/+30
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[libc] Fix dependency list of libc.src.__support.math.exp10f16. (#150434)lntue1-3/+3
2025-07-22[libc] Fix incorrect macro usage in shared/sign.h (#150140)Leandro Lacerda1-1/+1
This patch corrects the `using`-declaration in `libc/shared/sign.h`. The previous change (#150083) incorrectly used the `LIBC_NAMESPACE_DECL` macro. This is corrected to use `LIBC_NAMESPACE`.
2025-07-22[libc] Expose the Sign type for shared use (#150083)Leandro Lacerda1-0/+23
This patch exposes the internal `Sign` type for shared use by other LLVM subprojects, following the pattern established by `FPBits`. The `FPBits` utility is exposed via `libc/shared/fp_bits.h`. However, its public interface relies on the `Sign` type for, e.g., creating signed infinities and returning the sign of a value. Currently, users of the shared `FPBits` have no way to access the `Sign` type. Following the existing pattern for sharing `libc` utilities, this patch adds a new public header `libc/shared/sign.h`. This header simply includes the internal `src/__support/sign.h` and brings the `Sign` type into the `shared` namespace.
2025-07-22[libc][math] Refactor acoshf16 implementation to header-only in ↵Muhammad Bassiouni2-0/+30
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