[clang] Add __builtin_bswap128 (PR #198172)

via cfe-commits cfe-commits at lists.llvm.org
Sun May 31 08:23:08 PDT 2026


Disservin wrote:

> > well libc++ also has it ? :D
> > https://github.com/llvm/llvm-project/blob/0b806bca3f3fe0dbe4d70d46404e4978af1fd731/libcxx/include/__bit/byteswap.h#L38
> 
> Yeah, and we'll replace it with `__builtin_bswapg` as part of the effort to support `_BitInt` (and would do it anyways, since that builtin is just better).

now since, https://github.com/llvm/llvm-project/commit/fdfb99f6336401e534f611c4b2df5a338e26b997 we make use of __builtin_bswapg, but have the __builtin_bswap128 as a fallback in place if it's not available.. I don't have a big preference on this patch for now except make compatibility outside of std::byteswap

https://github.com/llvm/llvm-project/pull/198172


More information about the cfe-commits mailing list