Skip to content

libc: implement common abs for various integer sizes #23893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

kada49
Copy link
Contributor

@kada49 kada49 commented May 15, 2025

Implemented common libc functions:

  • abs
  • imaxabs
  • labs
  • llabs

abs functions for floating point numbers are already implemented in compiler_rt.

@alexrp
Copy link
Member

alexrp commented May 16, 2025

abs functions for floating point numbers are already implemented in compiler_rt.

That means you can delete the duplicate libc implementations.

@kada49 kada49 force-pushed the common-impl-libc-abs branch from e730278 to 4bbb5df Compare May 17, 2025 09:03
@alexrp alexrp self-assigned this May 17, 2025
Copy link
Member

@alexrp alexrp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think it would be nice to use @abs in the implementation, but it's not required.

@kada49
Copy link
Contributor Author

kada49 commented May 20, 2025

I tried this locally (linux) and it works with @abs but what did I break for windows and macos?

@nektro
Copy link
Contributor

nektro commented May 20, 2025

#23937

kada49 and others added 7 commits May 20, 2025 15:16
Previously all the functions that were exported were handled equally,
though some may exist and some not inside the same file. Moving the
checks inside the file allows handling different functions differently
Co-authored-by: Alex Rønne Petersen <[email protected]>
Co-authored-by: Alex Rønne Petersen <[email protected]>
@kada49 kada49 force-pushed the common-impl-libc-abs branch from 9e146a3 to 18a2714 Compare May 20, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants