summaryrefslogtreecommitdiff
path: root/bitops.c
AgeCommit message (Collapse)Author
2016-02-26add Lua module, move noise into subdirectories, and make build portable by ↵William Ahern
only using POSIX make syntax and semantics
2016-02-22Fix bitops on 32-bit MSVC buildsNick Mathewson
According to the documentation, 32-bit x86 builds do not have the 64-bit _BitScan{Forward,Reverse}64 intrinsics.
2016-02-22Remove two more unneeded zero checks in bitops.cNick Mathewson
2016-02-22Add comments demonstrating that c[tl]z() input is always nonzeroNick Mathewson
Given these, we can remove the code to check for the zero case.
2016-02-19Port timeout.c to platforms without __builtin_c[tl]zNick Mathewson
This patch includes an intrinsic implementation for these functions when the compiler is GCC, Clang, or MSVC--or if the compiler claims to be one of those. Otherwise, a naive implementation is used. Tests are included for all of these functions, which turned up a possible problem: according to the gcc documentation, __builtin_ctz and __builtin_clz give an undefined result when their inputs is zero. I was not able to persuade myself that we always called them with a nonzero argument.