[clang] [Clang] Add __builtin_bswapg (PR #162433)

Nikolas Klauser via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 3 10:46:56 PST 2025


================
@@ -12951,6 +12951,9 @@ def err_builtin_invalid_arg_type: Error<
   "%plural{0:|: }3"
   "%plural{[0,3]:type|:types}1 (was %4)">;
 
+def err_bswapg_bitint_not_16bit_aligned : Error<
----------------
philnik777 wrote:

I don't think you can pass bit-field types here? You can't form references to them, so they should be treated the same as the underlying type, right?

I haven't thought about vector types so far, but I don't think it makes sense to allow them here. IMO the semantics aren't very clear. If you want to actually shuffle the elements you have `__builtin_shufflevector`, and if you want to reverse the elements we should probably introduce a `__builtin_elementwise_bwapg`.

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


More information about the cfe-commits mailing list