{"id":22901072,"url":"https://github.com/mpdn/bitcount","last_synced_at":"2025-05-08T01:45:23.446Z","repository":{"id":10244434,"uuid":"12349707","full_name":"mpdn/bitcount","owner":"mpdn","description":"Fast cross-platform bit counting using intrinsic functions","archived":false,"fork":false,"pushed_at":"2013-08-25T21:30:58.000Z","size":128,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-08T01:45:14.096Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpdn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-24T20:50:34.000Z","updated_at":"2022-03-25T16:11:46.000Z","dependencies_parsed_at":"2022-08-20T13:31:27.923Z","dependency_job_id":null,"html_url":"https://github.com/mpdn/bitcount","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpdn%2Fbitcount","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpdn%2Fbitcount/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpdn%2Fbitcount/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpdn%2Fbitcount/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpdn","download_url":"https://codeload.github.com/mpdn/bitcount/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252983757,"owners_count":21835759,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-14T01:31:33.826Z","updated_at":"2025-05-08T01:45:23.412Z","avatar_url":"https://github.com/mpdn.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"bitcount\n========\n\nFast cross-platform bit counting using intrinsic functions.\n\nBitcount is a cross-platform implementation of GCC's intrinsic `__builtin_clz`,`__builtin_ctz`, and `__builtin_popcount`. Currently only intrinsic functions are used in VS 2012 (possibly older VS versions as well), and GCC-compatible compilers (including Clang). If Bitcount is used on a system that isn't either of these, it uses a C implementation of these functions as a fallback.\n\nThe library exposes three functions which follows the same API as the corresponing GCC intrinsics (which can be found [here][1]). Note that calls to clz and ctz with the value 0 are undefined.\n```c\n/* Returns the number of leading 0-bits in x, starting at the most significant\n   bit position. If v is 0, the result is undefined. */\nunsigned int bit_clz(unsigned int v)\n\n/* Returns the number of trailing 0-bits in x, starting at the least significant\n   bit position. If v is 0, the result is undefined. */\nunsigned int bit_ctz(unsigned int v)\n\n/* Returns the number of 1-bits in v. */\nunsigned int bit_popcount(unsigned int v)\n```\n\n[1]:http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Other-Builtins.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpdn%2Fbitcount","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpdn%2Fbitcount","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpdn%2Fbitcount/lists"}