[libc] Add generic cpp::byteswap to CPP/bit.h (#196274)

Added a constexpr byteswap template using recursive half-swap
decomposition. Accepts all integral types, matching C++23 std::byteswap
semantics. Signed types delegate to the unsigned path via static_cast,
which the compiler elides entirely.

A single recursive template handles all sizes from 8 to 128 bits with no
per-width specialisations or builtin fallbacks needed. Produces optimal
bswap/rolw instructions on Clang at -O2. A static_assert rejects types
larger than 128 bits.

Refactored endian_internal.h to call cpp::byteswap directly, replacing
the explicit template specialisations and builtin dispatch.

Assisted-by: Automated tooling, human reviewed.
GitOrigin-RevId: d24638888a16010c79bf7c45174b6afcc5b51671
4 files changed