Re: [PATCH v4 0/8] Add OPTPROBES feature on RISCV

From: Björn Töpel
Date: Tue Nov 08 2022 - 08:12:24 EST


"liaochang (A)" <liaochang1@xxxxxxxxxx> writes:

>>>> + *rd = ((kw | ow) == 1UL) ? 0 : __builtin_ctzl((kw | ow) & ~1UL);
>>>> + *ra = (kw == 1UL) ? 0 : __builtin_ctzl(kw & ~1UL);
>>>
>>> Hmm, __builtin_ctzl is undefined for 0, right? Can that be triggered
>>> here?
>
> This corner case has been taken into account, look these condition parts,
> if kw == 1UL this expression will return 0 directly, no chance to invoke __builtin_ctzl.

Indeed! Thanks for making that clear! Looking forward to the next
revision!


Björn