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:
parent
04bbd4e7e2
commit
518986d45c
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue