[clang] [clang] Fix sub-integer __builtin_elementwise_(add|sub)_sat (PR #119423)

Fraser Cormack via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 11 06:59:47 PST 2024


frasercrmck wrote:

> I thought bitreverse/popcount are only supposed to work with unsigned types?

Good question. The [documentation](https://clang.llvm.org/docs/LanguageExtensions.html) doesn't mention they're only for signed types, as `abs` does, for example. So if there is such a restriction, it's not documented, nor checked in the code.

Tangentially, in OpenCL (where I'm coming from) there's no restriction on `popcount` to be only on unsigned types.

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


More information about the cfe-commits mailing list