{"action":"created","issue":{"url":"https://api.github.com/repos/chapel-lang/chapel/issues/4331","repository_url":"https://api.github.com/repos/chapel-lang/chapel","labels_url":"https://api.github.com/repos/chapel-lang/chapel/issues/4331/labels{/name}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/issues/4331/comments","events_url":"https://api.github.com/repos/chapel-lang/chapel/issues/4331/events","html_url":"https://github.com/chapel-lang/chapel/pull/4331","id":170967097,"number":4331,"title":"\"param ** value\" optimization for params that are positive powers of 2","user":{"login":"Ldelaney","id":15878705,"avatar_url":"https://avatars.githubusercontent.com/u/15878705?v=3","gravatar_id":"","url":"https://api.github.com/users/Ldelaney","html_url":"https://github.com/Ldelaney","followers_url":"https://api.github.com/users/Ldelaney/followers","following_url":"https://api.github.com/users/Ldelaney/following{/other_user}","gists_url":"https://api.github.com/users/Ldelaney/gists{/gist_id}","starred_url":"https://api.github.com/users/Ldelaney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ldelaney/subscriptions","organizations_url":"https://api.github.com/users/Ldelaney/orgs","repos_url":"https://api.github.com/users/Ldelaney/repos","events_url":"https://api.github.com/users/Ldelaney/events{/privacy}","received_events_url":"https://api.github.com/users/Ldelaney/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-08-12T21:58:21Z","updated_at":"2016-08-15T23:40:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/chapel-lang/chapel/pulls/4331","html_url":"https://github.com/chapel-lang/chapel/pull/4331","diff_url":"https://github.com/chapel-lang/chapel/pull/4331.diff","patch_url":"https://github.com/chapel-lang/chapel/pull/4331.patch"},"body":"Adds a version of the ** operator for the case where the LHS (base) is known at compile time and a positive power of two. \r\n\r\nUses bit-shifting to efficiently raise the power. Uses complement and compare as an efficient method of testing whether the param is a power of 2.\r\n\r\nAdds a performance test (possibly unneeded?) that compares the ** and << operators. Adds a correctness test to check that for bases 1-4 and powers 1-15, all of the results are correct. \r\n\r\nThis may change the value returned if an overflow occurs, as the << operator will wrap around. \r\n\r\nI have a couple of comments about how things work so that people who don’t understand bits well can follow along. Should internal module code have comments beyond general section comments?"},"comment":{"url":"https://api.github.com/repos/chapel-lang/chapel/issues/comments/239961466","html_url":"https://github.com/chapel-lang/chapel/pull/4331#issuecomment-239961466","issue_url":"https://api.github.com/repos/chapel-lang/chapel/issues/4331","id":239961466,"user":{"login":"Ldelaney","id":15878705,"avatar_url":"https://avatars.githubusercontent.com/u/15878705?v=3","gravatar_id":"","url":"https://api.github.com/users/Ldelaney","html_url":"https://github.com/Ldelaney","followers_url":"https://api.github.com/users/Ldelaney/followers","following_url":"https://api.github.com/users/Ldelaney/following{/other_user}","gists_url":"https://api.github.com/users/Ldelaney/gists{/gist_id}","starred_url":"https://api.github.com/users/Ldelaney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ldelaney/subscriptions","organizations_url":"https://api.github.com/users/Ldelaney/orgs","repos_url":"https://api.github.com/users/Ldelaney/repos","events_url":"https://api.github.com/users/Ldelaney/events{/privacy}","received_events_url":"https://api.github.com/users/Ldelaney/received_events","type":"User","site_admin":false},"created_at":"2016-08-15T23:40:49Z","updated_at":"2016-08-15T23:40:49Z","body":"param-exp-perf and param-exp-shift are both performance tests, and were used to compare the performance of ** vs << before and after the optimization. param-exp-correct is the only true correctness test in the directory. (It tests to ensure that 2^x, 3^x, and 4^x all work, which checks 2, a number that is not a power of 2, and a number other than 2 that is a power of 2)\r\n\r\nAt this point param-exp-shift isn't doing much. "}}
{"actor":{"display_login":"Ldelaney"}}