[PATCH] D114425: [clang] Add __builtin_bswap128

Dávid Bolvanský via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 17 05:38:44 PST 2022


xbolva00 added a comment.

In D114425#3329303 <https://reviews.llvm.org/D114425#3329303>, @philnik wrote:

> In D114425#3225908 <https://reviews.llvm.org/D114425#3225908>, @erichkeane wrote:
>
>> In D114425#3225892 <https://reviews.llvm.org/D114425#3225892>, @craig.topper wrote:
>>
>>> I kind of wonder if we should detect the __int128 type being requested in ASTContext::GetBuiltinType and return an error up to Sema::LazilyCreateBuiltin. Probably requires a new error code and handling for it in LazilyCreateBuiltin. I assume that would catch the bad builtin earlier. As it stands now we'd still allow it if it constant folds away in ExprConstant.cpp so that it never reaches CGBuiltin.cpp. But I'm not a frontend expert. Adding more potential reviewers
>>
>> I think I like that idea, "DecodeTypeFromStr" should probably test if __int128 is supported.  Having us only diagnose in codegen is the wrong approach here, we need to reject it in Sema.
>>
>> I would also want to see some IR-tests to show how this looks in IR, particularly one where it takes an __int128 as parameter (plus others that show the return value is valid?).
>
> Where should I put the tests?

test/CodeGen

Test with -emit-llvm. There are other similar tests :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114425



More information about the cfe-commits mailing list