aykevl added a comment.

I checked this, and it seems good to me although I would like someone else to 
also take a look.

In D86547#2287353 <https://reviews.llvm.org/D86547#2287353>, @atrosinenko wrote:

> In D86547#2284095 <https://reviews.llvm.org/D86547#2284095>, @MaskRay wrote:
>
>> The `(aWidth - 1) - clzsi(a)` change is correct, but why is the ctz change?
>
> `d.s.low` and `d.s.high` are `su_int`. While some helpers from `libgcc` are 
> documented with `int`, `long`, etc. types //for simplicity// and use machine 
> modes under the hood, the `__builtin_ctz()` function (as well as clz), on the 
> other hand, seems to **really** accept an `int`-sized argument:

I can confirm this. This is why I introduced the `clzsi` and `ctzsi` macros in 
D78662 <https://reviews.llvm.org/D78662>. They are not intended for use with 
plain `int` types, but for use with `si_int` / `su_int` types (that are always 
32-bit, unlike `int`).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86547

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

Reply via email to