4 Commits

Author SHA1 Message Date
Nick Desaulniers
edbd93d370
[libc][stdbit] fix return types (#80337)
All of the functions I've previously implemented return an unsigned int; not
the parameter type.
2024-02-01 13:09:33 -08:00
Nick Desaulniers
f883365cc7
[libc] fix stdbit include test when not all entrypoints are available (#80323)
The intent of the test is to check that: 1. The type generic macros are
defined. 2. Those macros dispatch to the correct underlying function.

The issue is that when new functionality is added to our stdbit.h without
rolling out the new entrypoint to all targets, this test breaks because our
generated stdbit.h will not contain declarations for the underlying function.
In that case, we should just declare the underlying functions first before
including our generated stdbit.h which just contains declarations. A definition
is a declaration, but redeclarations must match, hence the additions of
noexcept and extern "C".
2024-02-01 12:08:00 -08:00
Nick Desaulniers
6a3fde6d60
[libc] implement stdc_leading_ones (C23) (#80082) 2024-02-01 10:14:22 -08:00
Nick Desaulniers
7bc5eaa02f
[libc] implement stdc_leading_zeros_u* for stdbit.h (#79669)
- stdbit.stdc_leading_zeros_uc
- stdbit.stdc_leading_zeros_us
- stdbit.stdc_leading_zeros_ui
- stdbit.stdc_leading_zeros_ul
- stdbit.stdc_leading_zeros_ull

Test via:
$ ninja libc-stdbit-tests libc_include_tests
2024-01-29 15:47:55 -08:00