3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-12 12:08:19 +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,7 +241,10 @@ struct CtlzTest
{ {
if (a == 0) if (a == 0)
return bits; return bits;
return __builtin_clzl(a) - (64 - bits); if (sizeof(long) == 4)
return __builtin_clzll(a) - (64 - bits);
else
return __builtin_clzl(a) - (64 - bits);
} }
template<size_t Bits> template<size_t Bits>