Re: Help with clz(0) and optimization

2023-10-31 Thread Jeff Law via Gcc
On 10/31/23 08:26, Enrico via Gcc wrote: I am working on GCC for a target architecture where clz(0) is defined and is 32 (TriCore). The code under test is the following: #include int f(unsigned int a) { unsigned int res = 32 - __builtin_clz(a); if(res > 0) printf("test"); retu

Help with clz(0) and optimization

2023-10-31 Thread Enrico via Gcc
I am working on GCC for a target architecture where clz(0) is defined and is 32 (TriCore). The code under test is the following: #include int f(unsigned int a) { unsigned int res = 32 - __builtin_clz(a); if(res > 0) printf("test"); return res; } >From GCC version greater and equal to