[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-05-02 Thread Björn Pettersson via cfe-commits
@@ -3216,7 +3216,8 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, case Builtin::BI__popcnt64: case Builtin::BI__builtin_popcount: case Builtin::BI__builtin_popcountl: - case Builtin::BI__builtin_popcountll: { + case

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-26 Thread via cfe-commits
overmighty wrote: Thanks. I plan to fix it soon, so I will probably just open a PR then. https://github.com/llvm/llvm-project/pull/82359 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-26 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Oh, I should have caught that when reviewing. (I thought I checked the test was doing the right thing when I looked at it, but I guess I'm misremembering.) Probably need to mark the intrinsic CustomTypeChecking, then make the code in SemaChecking explicitly perform

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-26 Thread via cfe-commits
overmighty wrote: Maybe the semantic analysis and docs should have been changed to match GCC's better. GCC's docs say their `__builtin_popcountg` takes a "type-generic unsigned integer" but that "No integral argument promotions are performed on the argument." Our builtin accepts signed

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-26 Thread Nick Desaulniers via cfe-commits
nickdesaulniers wrote: > @nickdesaulniers I am interested in implementing more builtins like this one. > :) Cool, I've filed: 1. https://github.com/llvm/llvm-project/issues/83075 2. https://github.com/llvm/llvm-project/issues/83076 Those would be helpful to have next, and I suspect as

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-26 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers closed https://github.com/llvm/llvm-project/pull/82359 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-26 Thread via cfe-commits
overmighty wrote: @nickdesaulniers I need someone to merge this for me, I don't have write/push access. Thanks. https://github.com/llvm/llvm-project/pull/82359 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-26 Thread Nick Desaulniers via cfe-commits
nickdesaulniers wrote: Looks like the linter is upset with pre-existing changes. ok2land. Are you able to merge this @overmighty or do you need us to? https://github.com/llvm/llvm-project/pull/82359 ___ cfe-commits mailing list

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-22 Thread via cfe-commits
overmighty wrote: Rebased. @nickdesaulniers I am interested in implementing more builtins like this one. :) https://github.com/llvm/llvm-project/pull/82359 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-22 Thread via cfe-commits
https://github.com/overmighty updated https://github.com/llvm/llvm-project/pull/82359 >From e41f7bec8aa663d1f9d924e71e8471d40e30f495 Mon Sep 17 00:00:00 2001 From: OverMighty Date: Tue, 20 Feb 2024 13:45:13 + Subject: [PATCH 1/5] [clang] Implement __builtin_popcountg Fixes #82058. ---

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-22 Thread Nick Desaulniers via cfe-commits
nickdesaulniers wrote: Perhaps worth rebasing then force pushing to this branch to rekick the build bots? Thanks for implementing this @overmighty ! There's a few more builtins like this that would simplify implementations of more C23 library additions. Let me know if you're interested in

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-21 Thread via cfe-commits
overmighty wrote: Done. https://github.com/llvm/llvm-project/pull/82359 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-21 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Please fix your GitHub settings so your email address is public. Looks like the bot didn't trigger for some reason; see https://github.com/llvm/llvm-project/pull/82429#issuecomment-1955214651 for the normal message. https://github.com/llvm/llvm-project/pull/82359

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-21 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/82359 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-21 Thread via cfe-commits
https://github.com/overmighty updated https://github.com/llvm/llvm-project/pull/82359 >From c14dab5f9419507cc3d0ac803e1bfebb3f3b0f94 Mon Sep 17 00:00:00 2001 From: OverMighty Date: Tue, 20 Feb 2024 13:45:13 + Subject: [PATCH 1/5] [clang] Implement __builtin_popcountg Fixes #82058. ---

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-21 Thread Simon Pilgrim via cfe-commits
RKSimon wrote: > @RKSimon The builtin currently can't be used with `constexpr`. Support for > constant evaluation is planned for a follow-up PR unless you would like me to > add it in this one. Should I remove the `Constexpr` attribute from the > builtin in Builtins.td for now? Yes please!

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-21 Thread via cfe-commits
overmighty wrote: @RKSimon The builtin currently can't be used with `constexpr`. Support for constant evaluation is planned for a follow-up PR unless you would like me to add it in this one. Should I remove the `Constexpr` attribute from the builtin in Builtins.td for now?

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-21 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon commented: Please can you add constexpr test coverage? https://github.com/llvm/llvm-project/pull/82359 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-21 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers commented: Awesome, thanks! Don't forget to update https://clang.llvm.org/docs/LanguageExtensions.html#builtin-functions https://github.com/llvm/llvm-project/pull/82359 ___ cfe-commits mailing list

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-20 Thread via cfe-commits
https://github.com/overmighty updated https://github.com/llvm/llvm-project/pull/82359 >From c14dab5f9419507cc3d0ac803e1bfebb3f3b0f94 Mon Sep 17 00:00:00 2001 From: OverMighty Date: Tue, 20 Feb 2024 13:45:13 + Subject: [PATCH 1/3] [clang] Implement __builtin_popcountg Fixes #82058. ---

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-20 Thread via cfe-commits
https://github.com/overmighty updated https://github.com/llvm/llvm-project/pull/82359 >From c14dab5f9419507cc3d0ac803e1bfebb3f3b0f94 Mon Sep 17 00:00:00 2001 From: OverMighty Date: Tue, 20 Feb 2024 13:45:13 + Subject: [PATCH 1/2] [clang] Implement __builtin_popcountg Fixes #82058. ---

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-20 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Missing semantic analysis. Since the signature is unspecified in Builtin.td, you have to check that there's one argument, and that argument is an integer. That code should go in SemaChecking.cpp. You can leave constant evaluation to a followup, sure.

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-20 Thread via cfe-commits
overmighty wrote: Should I add support for `__builtin_popcountg` in constant expressions in this PR too or in a later one? https://github.com/llvm/llvm-project/pull/82359 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-20 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: OverMighty (overmighty) Changes Fixes #82058. --- Full diff: https://github.com/llvm/llvm-project/pull/82359.diff 3 Files Affected: - (modified) clang/include/clang/Basic/Builtins.td (+6) - (modified) clang/lib/CodeGen/CGBuiltin.cpp

[clang] [clang] Implement __builtin_popcountg (PR #82359)

2024-02-20 Thread via cfe-commits
https://github.com/overmighty created https://github.com/llvm/llvm-project/pull/82359 Fixes #82058. >From c14dab5f9419507cc3d0ac803e1bfebb3f3b0f94 Mon Sep 17 00:00:00 2001 From: OverMighty Date: Tue, 20 Feb 2024 13:45:13 + Subject: [PATCH] [clang] Implement __builtin_popcountg Fixes