philnik added a comment.

In D114425#3216233 <https://reviews.llvm.org/D114425#3216233>, @xbolva00 wrote:

> int num = …;
>
> __builtin_bswap64(num); // works, no error
> __builtin_bswap128(num); // should work as well
>
> Highly likely this case works already with ur patch, so it would be great to 
> add a test for this scenario.

This should already be tested, because `0x1234` is an `int` and should be 
implicitly converted to `__int128`.

The question was about the scenario where clang doesn't support `__int128`. 
`__builtin_bswap128()` returns an `unsigned __int128`. This would allow someone 
to do weird stuff like:

  using int128 = decltype(__builtin_bswap128(0));
  static_assert(sizeof(int128) == 16);

This actually works with the current patch and doesn't seem like it should work.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114425/new/

https://reviews.llvm.org/D114425

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to