llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[libc][math] Refactor `logb` to Header Only.

Open bassiounix opened this issue 10 months ago • 4 comments

We need to refactor logb to be header-only, constexpr (if possible), shared math function. We need make sure that the code compiles with the supported compilers and build systems in LLVM libc: Clang, GCC12.2, CMake and Bazel.

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

bassiounix avatar Jan 10 '26 17:01 bassiounix

Hi!

This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:

  1. Check that no other contributor is working on this issue. If someone is assigned to the issue or claimed to be working on it, ping the person. After one week without a response, the assignee may be changed.
  2. Leave a comment indicating that you are working on the issue, or just create a pull request after following the steps below. Mention this issue in the description of the pull request.
  3. Fix the issue locally.
  4. Run the test suite locally. Remember that the subdirectories under test/ create fine-grained testing targets, so you can e.g. use make check-clang-ast to only run Clang's AST tests.
  5. Create a Git commit.
  6. Run git clang-format HEAD~1 to format your changes.
  7. Open a pull request to the upstream repository on GitHub. Detailed instructions can be found in GitHub's documentation. Mention this issue in the description of the pull request.

If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below.

llvmbot avatar Jan 10 '26 17:01 llvmbot

@llvm/issue-subscribers-good-first-issue

Author: Muhammad Bassiouni (bassiounix)

We need to refactor `logb` to be header-only, `constexpr` (if possible), shared math function. We need make sure that the code compiles with the supported compilers and build systems in LLVM libc: `Clang`, `GCC12.2`, `CMake` and `Bazel`.

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>

llvmbot avatar Jan 10 '26 17:01 llvmbot

@llvm/issue-subscribers-libc

Author: Muhammad Bassiouni (bassiounix)

We need to refactor `logb` to be header-only, `constexpr` (if possible), shared math function. We need make sure that the code compiles with the supported compilers and build systems in LLVM libc: `Clang`, `GCC12.2`, `CMake` and `Bazel`.

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>

llvmbot avatar Jan 10 '26 17:01 llvmbot

Hi, @bassiounix could I be assigned this issue if that's okay? I'll reach out in this thread if I have questions.

dhr412 avatar Jan 12 '26 14:01 dhr412