[PATCH] D114425: [clang] Add __builtin_bswap128

2023-09-21 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik abandoned this revision. philnik added a comment. I don't plan to work on this any time soon, so I'll abandon it to clean up the review queue. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114425/new/ https://reviews.llvm.org/D114425

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-03-03 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:11071-11072 -QualType ElementType = DecodeTypeFromStr(Str, Context, Error, - RequiresICE, false); +QualType ElementType = +DecodeTypeFromStr(Str, C

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-03-03 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:11071-11072 -QualType ElementType = DecodeTypeFromStr(Str, Context, Error, - RequiresICE, false); +QualType ElementType = +DecodeTypeFromStr

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-03-02 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik added a comment. Herald added a project: All. ping 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.o

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-02-26 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik updated this revision to Diff 411600. philnik marked an inline comment as done. philnik added a comment. - Fix rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114425/new/ https://reviews.llvm.org/D114425 Files: clang/docs/ReleaseNot

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-02-25 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added inline comments. Comment at: clang/docs/ReleaseNotes.rst:64 +- Maximum _ExtInt size was decreased from 16,777,215 bits to 8,388,608 bits. + Motivation for this was discussed in PR51829. +- Configuration file syntax extended with token. This expands to ---

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-02-25 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik added a comment. ping 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

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-02-17 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik updated this revision to Diff 409629. philnik marked an inline comment as done. philnik added a comment. Herald added a subscriber: mstorsjo. - Add tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114425/new/ https://reviews.llvm.org/D11

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-02-17 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:10987 case 'i': -if (HowLong == 3) +if (HowLong == 3) { + if (!AllowInt128 && !Context.getTargetInfo().hasInt128Type()) { Please add a test in Sema as well to validate the

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-02-17 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment. In D114425#3329303 , @philnik wrote: > In D114425#3225908 , @erichkeane > wrote: > >> In D114425#3225892 , @craig.topper >> wrote: >> >>> I kin

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-02-17 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik updated this revision to Diff 409607. philnik added a comment. - Rebased - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114425/new/ https://reviews.llvm.org/D114425 Files: clang/docs/ReleaseNotes.rst clang/include/cla

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-02-17 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik added a comment. In D114425#3225908 , @erichkeane wrote: > In D114425#3225892 , @craig.topper > wrote: > >> I kind of wonder if we should detect the __int128 type being requested in >> ASTContext::GetBu

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-01-06 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. In 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 ne

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-01-06 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added reviewers: aaron.ballman, erichkeane. craig.topper added a comment. 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

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-01-06 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik updated this revision to Diff 397866. philnik marked 3 inline comments as done. philnik added a comment. - Addressed comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114425/new/ https://reviews.llvm.org/D114425 Files: clang/docs/Re

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-01-03 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. In D114425#3217478 , @Quuxplusone wrote: > In D114425#3216802 , @majnemer > wrote: > >> OOC, how hard would it be to generalize this builtin a little? It is nice >> that we have builti

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-01-03 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added inline comments. Comment at: clang/lib/CodeGen/CGBuiltin.cpp:2930 + } + [[fallthrough]]; case Builtin::BI__builtin_bswap16: craig.topper wrote: > Quuxplusone wrote: > > Re clang-format's complaint: I would either move `[[fallthrough]];` in

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-01-03 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added inline comments. Comment at: clang/lib/CodeGen/CGBuiltin.cpp:2930 + } + [[fallthrough]]; case Builtin::BI__builtin_bswap16: Quuxplusone wrote: > Re clang-format's complaint: I would either move `[[fallthrough]];` inside > the curly braces

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-01-03 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added a comment. In D114425#3216802 , @majnemer wrote: > OOC, how hard would it be to generalize this builtin a little? It is nice > that we have builtins like `__builtin_add_overflow` which do the right thing > regardless of their input. >

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-01-02 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. OOC, how hard would it be to generalize this builtin a little? It is nice that we have builtins like `__builtin_add_overflow` which do the right thing regardless of their input. It seems like it would be nice if we started to expose more intrinsics which did the right

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-01-02 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik updated this revision to Diff 396960. philnik added a comment. - Rebased - Error if `__int128` is not supported Should it be tested that the compiler errors when calling `__builtin_bswap128` with __int128 not available? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-01-02 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added a comment. In D114425#3216531 , @Quuxplusone wrote: > In D114425#3216490 , @craig.topper > wrote: > >> In D114425#3216231 , @philnik >> wrote: >> >>>

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-01-02 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added a comment. In D114425#3216490 , @craig.topper wrote: > In D114425#3216231 , @philnik wrote: > >> In D114425#3209794 , @craig.topper >> wrote: >> >>> Wh

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-01-02 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added a comment. In D114425#3216231 , @philnik wrote: > In D114425#3209794 , @craig.topper > wrote: > >> What does the builtin due if __int128 isn't supported? Even though the type >> isn't legal th

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-01-02 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik added a comment. In 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

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-01-02 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment. int num = …; __builtin_bswap64(num); // works, no error __builtin_bswap128(num); // should work as well Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114425/new/ https://reviews.llvm.org/D114425 _

[PATCH] D114425: [clang] Add __builtin_bswap128

2022-01-02 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik added a comment. In D114425#3209794 , @craig.topper wrote: > What does the builtin due if __int128 isn't supported? Even though the type > isn't legal the builtin can still be called with a narrower type that would > be implicitly converted. Do

[PATCH] D114425: [clang] Add __builtin_bswap128

2021-12-25 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added a comment. What does the builtin due if __int128 isn't supported? Even though the type isn't legal the builtin can still be called with a narrower type that would be implicitly converted. Does that work correctly? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACT

[PATCH] D114425: [clang] Add __builtin_bswap128

2021-12-19 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik updated this revision to Diff 395338. philnik added a comment. Guarding test now Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114425/new/ https://reviews.llvm.org/D114425 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/Bu

[PATCH] D114425: [clang] Add __builtin_bswap128

2021-12-19 Thread Simon Pilgrim via Phabricator via cfe-commits
RKSimon added inline comments. Comment at: clang/test/Sema/constant-builtins-2.c:219 int h5 = __builtin_bswap64(0x1234) == 0x3412 ? 1 : f(); +int h6 = __builtin_bswap128(0x1234) == (((__int128)0x3412) << 112) ? 1 : f(); extern long int bi0; ``` #if

[PATCH] D114425: [clang] Add __builtin_bswap128

2021-12-19 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment. Looks fine. 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

[PATCH] D114425: [clang] Add __builtin_bswap128

2021-12-19 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik updated this revision to Diff 395319. philnik added a comment. Added constexpr test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114425/new/ https://reviews.llvm.org/D114425 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic

[PATCH] D114425: [clang] Add __builtin_bswap128

2021-12-19 Thread Simon Pilgrim via Phabricator via cfe-commits
RKSimon added a comment. please can you add a constexpr test? Existing bswap tests are in clang/test/Sema/constant-builtins-2.c Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114425/new/ https://reviews.llvm.org/D114425 ___

[PATCH] D114425: [clang] Add __builtin_bswap128

2021-12-19 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik updated this revision to Diff 395316. philnik added a comment. Is that enough or do you want something more? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114425/new/ https://reviews.llvm.org/D114425 Files: clang/docs/ReleaseNotes.rst

[PATCH] D114425: [clang] Add __builtin_bswap128

2021-12-19 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment. Please update Release Notes 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 ht

[PATCH] D114425: [clang] Add __builtin_bswap128

2021-12-19 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik added a comment. ping 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

[PATCH] D114425: [clang] Add __builtin_bswap128

2021-12-07 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik added a subscriber: rsmith. philnik added a comment. ping 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

[PATCH] D114425: [clang] Add __builtin_bswap128

2021-11-23 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik created this revision. philnik requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. GCC has a `__builtin_bswap128` which is used for `std::byteswap()`. Clang should also add this builtin. Repository: rG LLVM Github Monorepo https:/