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:
parent
04bbd4e7e2
commit
518986d45c
|
@ -241,6 +241,9 @@ struct CtlzTest
|
||||||
{
|
{
|
||||||
if (a == 0)
|
if (a == 0)
|
||||||
return bits;
|
return bits;
|
||||||
|
if (sizeof(long) == 4)
|
||||||
|
return __builtin_clzll(a) - (64 - bits);
|
||||||
|
else
|
||||||
return __builtin_clzl(a) - (64 - bits);
|
return __builtin_clzl(a) - (64 - bits);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue