fix countOnesBuiltin for vcc 32 bit

This commit is contained in:
jangko 2020-06-15 21:46:01 +07:00
parent 74d8ff707b
commit 9385fabe6c
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
1 changed files with 2 additions and 2 deletions

View File

@ -266,8 +266,8 @@ elif defined(vcc) and useBuiltins:
when arch64:
builtin_popcnt64(v).int
else:
builtin_popcnt32((v and 0xFFFFFFFF'u64).uint32).int +
builtin_popcnt32((v shr 32'u64).uint32).int
builtin_popcnt32((v and 0xFFFFFFFF'u64).cint).int +
builtin_popcnt32((v shr 32'u64).cint).int
func firstOneBuiltin(v: uint8|uint16|uint32): int =
1 + checkedScan(bitScanForward, v.culong, -1)