{"action":"created","issue":{"url":"https://api.github.com/repos/stevenhoving/integer_division/issues/2","repository_url":"https://api.github.com/repos/stevenhoving/integer_division","labels_url":"https://api.github.com/repos/stevenhoving/integer_division/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/stevenhoving/integer_division/issues/2/comments","events_url":"https://api.github.com/repos/stevenhoving/integer_division/issues/2/events","html_url":"https://github.com/stevenhoving/integer_division/issues/2","id":323711582,"node_id":"MDU6SXNzdWUzMjM3MTE1ODI=","number":2,"title":"Optimize the forgotten easy case of division by power-of-two","user":{"login":"fidergo-stephane-gourichon","id":2843528,"node_id":"MDQ6VXNlcjI4NDM1Mjg=","avatar_url":"https://avatars0.githubusercontent.com/u/2843528?v=4","gravatar_id":"","url":"https://api.github.com/users/fidergo-stephane-gourichon","html_url":"https://github.com/fidergo-stephane-gourichon","followers_url":"https://api.github.com/users/fidergo-stephane-gourichon/followers","following_url":"https://api.github.com/users/fidergo-stephane-gourichon/following{/other_user}","gists_url":"https://api.github.com/users/fidergo-stephane-gourichon/gists{/gist_id}","starred_url":"https://api.github.com/users/fidergo-stephane-gourichon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fidergo-stephane-gourichon/subscriptions","organizations_url":"https://api.github.com/users/fidergo-stephane-gourichon/orgs","repos_url":"https://api.github.com/users/fidergo-stephane-gourichon/repos","events_url":"https://api.github.com/users/fidergo-stephane-gourichon/events{/privacy}","received_events_url":"https://api.github.com/users/fidergo-stephane-gourichon/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-05-16T17:14:10Z","updated_at":"2018-06-08T10:32:27Z","closed_at":"2018-06-07T19:58:05Z","author_association":"NONE","body":"https://github.com/stevenhoving/integer_division/blob/master/integer_division_uint8.h show results that are technically correct for powers-of-two, although they can be obviously much simpler.\r\n\r\nAs we all know here, dividing by 2^n is just right shift by n bits. Current implementation shifts left by 7, then right by 8, then right by n-1.\r\n\r\nSome compilers for regular platforms will most certainly simplify and generate code for the one simple shift.\r\n\r\nSimpler compilers, especially for embedded machines which needs this kind of hack more than others, may not generate optimal assembly.\r\n\r\nOne might say \"these are compile-time macros, if the divisor is a power of two, just do the usual shift\".\r\n\r\nStill, this is especially interesting for usage where the source code calling those macros is not written by a human but generated by some preprocessing step. \r\n\r\nAlso this work can be a basis for a division by a variable not known at compile time, via a table lookup of parameters. This case needs power-of-two to be handled also.\r\n"},"comment":{"url":"https://api.github.com/repos/stevenhoving/integer_division/issues/comments/395721145","html_url":"https://github.com/stevenhoving/integer_division/issues/2#issuecomment-395721145","issue_url":"https://api.github.com/repos/stevenhoving/integer_division/issues/2","id":395721145,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTcyMTE0NQ==","user":{"login":"fidergo-stephane-gourichon","id":2843528,"node_id":"MDQ6VXNlcjI4NDM1Mjg=","avatar_url":"https://avatars0.githubusercontent.com/u/2843528?v=4","gravatar_id":"","url":"https://api.github.com/users/fidergo-stephane-gourichon","html_url":"https://github.com/fidergo-stephane-gourichon","followers_url":"https://api.github.com/users/fidergo-stephane-gourichon/followers","following_url":"https://api.github.com/users/fidergo-stephane-gourichon/following{/other_user}","gists_url":"https://api.github.com/users/fidergo-stephane-gourichon/gists{/gist_id}","starred_url":"https://api.github.com/users/fidergo-stephane-gourichon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fidergo-stephane-gourichon/subscriptions","organizations_url":"https://api.github.com/users/fidergo-stephane-gourichon/orgs","repos_url":"https://api.github.com/users/fidergo-stephane-gourichon/repos","events_url":"https://api.github.com/users/fidergo-stephane-gourichon/events{/privacy}","received_events_url":"https://api.github.com/users/fidergo-stephane-gourichon/received_events","type":"User","site_admin":false},"created_at":"2018-06-08T10:32:27Z","updated_at":"2018-06-08T10:32:27Z","author_association":"NONE","body":"Do not worry. :-)\r\n\r\n> its only purpose is to only archive the blogpost and the source code that came with it. So that others like yourself can fork/use it.\r\n\r\nThat's a pretty good purpose. It served it well and I thank you for that. \r\n\r\nMay I suggest something? The suggestion is, as some repositories with similar \"archival-only\" purposes do, to in the beginning of the `Readme.md`,  (1) state that purpose (2) tell visitors not to open issues or offer PRs, but consider visiting [forks](https://github.com/stevenhoving/integer_division/network/members) for activity and do issues and PR there.\r\n"}}
{"actor":{"display_login":"fidergo-stephane-gourichon"}}