https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126977
--- Comment #4 from Drea Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #2)
> There's also CLZ and friends with the value-at-zero and other magic IFNs
> (.DEFERRED_INIT comes to my mind, as well as the BIAS value for vector
> load/stores).
>
> Maybe some internal_flag_arg_p (code_helper, unsigned) helper would be
> useful. "internal flag" as in something that isn't a runtime value.
CLZ for bitint with different value-at-zero seems to work:
```
int clz (int z, unsigned _BitInt(129) p)
{
if (z)
return __builtin_clzg (p, 1);
else
return __builtin_clzg (p, 31);
}
```
But I don't know how to form it for non BitInt; I tried:
```
int clz1 (int z, unsigned int p)
{
if (z)
return __builtin_clzg (p, 0);
else
return __builtin_clzg (p, 32);
}
```
But CLZ is only produced for the one with 32 (for aarch64 that is).
But yes this needs to be double checked too.