3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-13 12:28:44 +00:00

Make cxxrtl tests work on 32-bit by using __builtin_clzll when needed

This commit is contained in:
Scott Ashcroft 2025-03-25 13:12:04 +00:00
parent 04bbd4e7e2
commit 518986d45c

View file

@ -241,6 +241,9 @@ struct CtlzTest
{
if (a == 0)
return bits;
if (sizeof(long) == 4)
return __builtin_clzll(a) - (64 - bits);
else
return __builtin_clzl(a) - (64 - bits);
}