{"action":"created","comment":{"url":"https://api.github.com/repos/CraneStation/cranelift/pulls/comments/221815663","pull_request_review_id":160554946,"id":221815663,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTgxNTY2Mw==","diff_hunk":"@@ -248,26 +248,60 @@ def widen_imm(signed, op):\n                 ))\n \n \n+# int ops\n for binop in [iadd, isub, imul, udiv, urem]:\n     widen_two_arg(False, binop)\n \n-widen_two_arg(True, sdiv)\n-\n-widen_one_arg(False, bnot)\n+for binop in [sdiv, srem]:\n+    widen_two_arg(True, binop)\n \n for binop in [iadd_imm, imul_imm, udiv_imm, urem_imm]:\n     widen_imm(False, binop)\n \n for binop in [sdiv_imm, srem_imm]:\n     widen_imm(True, binop)\n \n+widen_imm(True, irsub_imm)\n+\n # bit ops\n+widen_one_arg(False, bnot)\n+\n for binop in [band, bor, bxor, band_not, bor_not, bxor_not]:\n     widen_two_arg(False, binop)\n \n for binop in [band_imm, bor_imm, bxor_imm]:\n     widen_imm(False, binop)\n \n+widen_one_arg(False, insts.popcnt)\n+\n+for (int_ty, num) in [(types.i8, 24), (types.i16, 16)]:\n+    widen.legalize(\n+        a << insts.clz.bind(int_ty)(b),\n+        Rtl(\n+            c << uextend.i32(b),\n+            d << ishl_imm(c, imm64(num)),\n+            e << insts.clz.i32(d),\n+            a << ireduce.bind(int_ty)(e)\n+        ))\n+\n+    widen.legalize(\n+        a << insts.cls.bind(int_ty)(b),\n+        Rtl(\n+            c << sextend.i32(b),\n+            d << ishl_imm(c, imm64(num)),\n+            e << insts.cls.i32(d),","path":"lib/codegen/meta-python/base/legalize.py","position":48,"original_position":48,"commit_id":"e62d7ff54688d503d773bfa62dc3f57b0c21a431","original_commit_id":"e62d7ff54688d503d773bfa62dc3f57b0c21a431","user":{"login":"sunfishcode","id":4503403,"node_id":"MDQ6VXNlcjQ1MDM0MDM=","avatar_url":"https://avatars1.githubusercontent.com/u/4503403?v=4","gravatar_id":"","url":"https://api.github.com/users/sunfishcode","html_url":"https://github.com/sunfishcode","followers_url":"https://api.github.com/users/sunfishcode/followers","following_url":"https://api.github.com/users/sunfishcode/following{/other_user}","gists_url":"https://api.github.com/users/sunfishcode/gists{/gist_id}","starred_url":"https://api.github.com/users/sunfishcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunfishcode/subscriptions","organizations_url":"https://api.github.com/users/sunfishcode/orgs","repos_url":"https://api.github.com/users/sunfishcode/repos","events_url":"https://api.github.com/users/sunfishcode/events{/privacy}","received_events_url":"https://api.github.com/users/sunfishcode/received_events","type":"User","site_admin":false},"body":"Same as clz; we can do a sub rather than a shift.","created_at":"2018-10-02T03:13:30Z","updated_at":"2018-10-02T03:20:55Z","html_url":"https://github.com/CraneStation/cranelift/pull/534#discussion_r221815663","pull_request_url":"https://api.github.com/repos/CraneStation/cranelift/pulls/534","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/CraneStation/cranelift/pulls/comments/221815663"},"html":{"href":"https://github.com/CraneStation/cranelift/pull/534#discussion_r221815663"},"pull_request":{"href":"https://api.github.com/repos/CraneStation/cranelift/pulls/534"}}},"pull_request":{"url":"https://api.github.com/repos/CraneStation/cranelift/pulls/534","id":219203446,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5MjAzNDQ2","html_url":"https://github.com/CraneStation/cranelift/pull/534","diff_url":"https://github.com/CraneStation/cranelift/pull/534.diff","patch_url":"https://github.com/CraneStation/cranelift/pull/534.patch","issue_url":"https://api.github.com/repos/CraneStation/cranelift/issues/534","number":534,"state":"open","locked":false,"title":"Add encodings for i8 and i16 copy, spill, fill, ireduce.i8.i16","user":{"login":"bjorn3","id":17426603,"node_id":"MDQ6VXNlcjE3NDI2NjAz","avatar_url":"https://avatars1.githubusercontent.com/u/17426603?v=4","gravatar_id":"","url":"https://api.github.com/users/bjorn3","html_url":"https://github.com/bjorn3","followers_url":"https://api.github.com/users/bjorn3/followers","following_url":"https://api.github.com/users/bjorn3/following{/other_user}","gists_url":"https://api.github.com/users/bjorn3/gists{/gist_id}","starred_url":"https://api.github.com/users/bjorn3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjorn3/subscriptions","organizations_url":"https://api.github.com/users/bjorn3/orgs","repos_url":"https://api.github.com/users/bjorn3/repos","events_url":"https://api.github.com/users/bjorn3/events{/privacy}","received_events_url":"https://api.github.com/users/bjorn3/received_events","type":"User","site_admin":false},"body":"Also adds legalization for srem, irsub_imm, {u,s}extend.i16.i8\r\n\r\nFixes #477 cc #466","created_at":"2018-09-30T12:50:13Z","updated_at":"2018-10-02T03:20:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"baf604ffe20fc66f04adbeb0621899d98aa3a141","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/CraneStation/cranelift/pulls/534/commits","review_comments_url":"https://api.github.com/repos/CraneStation/cranelift/pulls/534/comments","review_comment_url":"https://api.github.com/repos/CraneStation/cranelift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CraneStation/cranelift/issues/534/comments","statuses_url":"https://api.github.com/repos/CraneStation/cranelift/statuses/e62d7ff54688d503d773bfa62dc3f57b0c21a431","head":{"label":"bjorn3:add_encodings_for_some_insts","ref":"add_encodings_for_some_insts","sha":"e62d7ff54688d503d773bfa62dc3f57b0c21a431","user":{"login":"bjorn3","id":17426603,"node_id":"MDQ6VXNlcjE3NDI2NjAz","avatar_url":"https://avatars1.githubusercontent.com/u/17426603?v=4","gravatar_id":"","url":"https://api.github.com/users/bjorn3","html_url":"https://github.com/bjorn3","followers_url":"https://api.github.com/users/bjorn3/followers","following_url":"https://api.github.com/users/bjorn3/following{/other_user}","gists_url":"https://api.github.com/users/bjorn3/gists{/gist_id}","starred_url":"https://api.github.com/users/bjorn3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjorn3/subscriptions","organizations_url":"https://api.github.com/users/bjorn3/orgs","repos_url":"https://api.github.com/users/bjorn3/repos","events_url":"https://api.github.com/users/bjorn3/events{/privacy}","received_events_url":"https://api.github.com/users/bjorn3/received_events","type":"User","site_admin":false},"repo":{"id":91002761,"node_id":"MDEwOlJlcG9zaXRvcnk5MTAwMjc2MQ==","name":"cretonne","full_name":"bjorn3/cretonne","private":false,"owner":{"login":"bjorn3","id":17426603,"node_id":"MDQ6VXNlcjE3NDI2NjAz","avatar_url":"https://avatars1.githubusercontent.com/u/17426603?v=4","gravatar_id":"","url":"https://api.github.com/users/bjorn3","html_url":"https://github.com/bjorn3","followers_url":"https://api.github.com/users/bjorn3/followers","following_url":"https://api.github.com/users/bjorn3/following{/other_user}","gists_url":"https://api.github.com/users/bjorn3/gists{/gist_id}","starred_url":"https://api.github.com/users/bjorn3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjorn3/subscriptions","organizations_url":"https://api.github.com/users/bjorn3/orgs","repos_url":"https://api.github.com/users/bjorn3/repos","events_url":"https://api.github.com/users/bjorn3/events{/privacy}","received_events_url":"https://api.github.com/users/bjorn3/received_events","type":"User","site_admin":false},"html_url":"https://github.com/bjorn3/cretonne","description":"Cretonne code generator","fork":true,"url":"https://api.github.com/repos/bjorn3/cretonne","forks_url":"https://api.github.com/repos/bjorn3/cretonne/forks","keys_url":"https://api.github.com/repos/bjorn3/cretonne/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bjorn3/cretonne/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bjorn3/cretonne/teams","hooks_url":"https://api.github.com/repos/bjorn3/cretonne/hooks","issue_events_url":"https://api.github.com/repos/bjorn3/cretonne/issues/events{/number}","events_url":"https://api.github.com/repos/bjorn3/cretonne/events","assignees_url":"https://api.github.com/repos/bjorn3/cretonne/assignees{/user}","branches_url":"https://api.github.com/repos/bjorn3/cretonne/branches{/branch}","tags_url":"https://api.github.com/repos/bjorn3/cretonne/tags","blobs_url":"https://api.github.com/repos/bjorn3/cretonne/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bjorn3/cretonne/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bjorn3/cretonne/git/refs{/sha}","trees_url":"https://api.github.com/repos/bjorn3/cretonne/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bjorn3/cretonne/statuses/{sha}","languages_url":"https://api.github.com/repos/bjorn3/cretonne/languages","stargazers_url":"https://api.github.com/repos/bjorn3/cretonne/stargazers","contributors_url":"https://api.github.com/repos/bjorn3/cretonne/contributors","subscribers_url":"https://api.github.com/repos/bjorn3/cretonne/subscribers","subscription_url":"https://api.github.com/repos/bjorn3/cretonne/subscription","commits_url":"https://api.github.com/repos/bjorn3/cretonne/commits{/sha}","git_commits_url":"https://api.github.com/repos/bjorn3/cretonne/git/commits{/sha}","comments_url":"https://api.github.com/repos/bjorn3/cretonne/comments{/number}","issue_comment_url":"https://api.github.com/repos/bjorn3/cretonne/issues/comments{/number}","contents_url":"https://api.github.com/repos/bjorn3/cretonne/contents/{+path}","compare_url":"https://api.github.com/repos/bjorn3/cretonne/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bjorn3/cretonne/merges","archive_url":"https://api.github.com/repos/bjorn3/cretonne/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bjorn3/cretonne/downloads","issues_url":"https://api.github.com/repos/bjorn3/cretonne/issues{/number}","pulls_url":"https://api.github.com/repos/bjorn3/cretonne/pulls{/number}","milestones_url":"https://api.github.com/repos/bjorn3/cretonne/milestones{/number}","notifications_url":"https://api.github.com/repos/bjorn3/cretonne/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bjorn3/cretonne/labels{/name}","releases_url":"https://api.github.com/repos/bjorn3/cretonne/releases{/id}","deployments_url":"https://api.github.com/repos/bjorn3/cretonne/deployments","created_at":"2017-05-11T16:52:19Z","updated_at":"2018-08-13T17:57:40Z","pushed_at":"2018-09-30T14:25:37Z","git_url":"git://github.com/bjorn3/cretonne.git","ssh_url":"git@github.com:bjorn3/cretonne.git","clone_url":"https://github.com/bjorn3/cretonne.git","svn_url":"https://github.com/bjorn3/cretonne","homepage":null,"size":6475,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"CraneStation:master","ref":"master","sha":"7629192fac6ff209bed5c91020278c3827bd74f2","user":{"login":"CraneStation","id":11573910,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNTczOTEw","avatar_url":"https://avatars3.githubusercontent.com/u/11573910?v=4","gravatar_id":"","url":"https://api.github.com/users/CraneStation","html_url":"https://github.com/CraneStation","followers_url":"https://api.github.com/users/CraneStation/followers","following_url":"https://api.github.com/users/CraneStation/following{/other_user}","gists_url":"https://api.github.com/users/CraneStation/gists{/gist_id}","starred_url":"https://api.github.com/users/CraneStation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CraneStation/subscriptions","organizations_url":"https://api.github.com/users/CraneStation/orgs","repos_url":"https://api.github.com/users/CraneStation/repos","events_url":"https://api.github.com/users/CraneStation/events{/privacy}","received_events_url":"https://api.github.com/users/CraneStation/received_events","type":"Organization","site_admin":false},"repo":{"id":50268165,"node_id":"MDEwOlJlcG9zaXRvcnk1MDI2ODE2NQ==","name":"cranelift","full_name":"CraneStation/cranelift","private":false,"owner":{"login":"CraneStation","id":11573910,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNTczOTEw","avatar_url":"https://avatars3.githubusercontent.com/u/11573910?v=4","gravatar_id":"","url":"https://api.github.com/users/CraneStation","html_url":"https://github.com/CraneStation","followers_url":"https://api.github.com/users/CraneStation/followers","following_url":"https://api.github.com/users/CraneStation/following{/other_user}","gists_url":"https://api.github.com/users/CraneStation/gists{/gist_id}","starred_url":"https://api.github.com/users/CraneStation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CraneStation/subscriptions","organizations_url":"https://api.github.com/users/CraneStation/orgs","repos_url":"https://api.github.com/users/CraneStation/repos","events_url":"https://api.github.com/users/CraneStation/events{/privacy}","received_events_url":"https://api.github.com/users/CraneStation/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/CraneStation/cranelift","description":"Cranelift code generator (formerly, Cretonne)","fork":false,"url":"https://api.github.com/repos/CraneStation/cranelift","forks_url":"https://api.github.com/repos/CraneStation/cranelift/forks","keys_url":"https://api.github.com/repos/CraneStation/cranelift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CraneStation/cranelift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CraneStation/cranelift/teams","hooks_url":"https://api.github.com/repos/CraneStation/cranelift/hooks","issue_events_url":"https://api.github.com/repos/CraneStation/cranelift/issues/events{/number}","events_url":"https://api.github.com/repos/CraneStation/cranelift/events","assignees_url":"https://api.github.com/repos/CraneStation/cranelift/assignees{/user}","branches_url":"https://api.github.com/repos/CraneStation/cranelift/branches{/branch}","tags_url":"https://api.github.com/repos/CraneStation/cranelift/tags","blobs_url":"https://api.github.com/repos/CraneStation/cranelift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CraneStation/cranelift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CraneStation/cranelift/git/refs{/sha}","trees_url":"https://api.github.com/repos/CraneStation/cranelift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CraneStation/cranelift/statuses/{sha}","languages_url":"https://api.github.com/repos/CraneStation/cranelift/languages","stargazers_url":"https://api.github.com/repos/CraneStation/cranelift/stargazers","contributors_url":"https://api.github.com/repos/CraneStation/cranelift/contributors","subscribers_url":"https://api.github.com/repos/CraneStation/cranelift/subscribers","subscription_url":"https://api.github.com/repos/CraneStation/cranelift/subscription","commits_url":"https://api.github.com/repos/CraneStation/cranelift/commits{/sha}","git_commits_url":"https://api.github.com/repos/CraneStation/cranelift/git/commits{/sha}","comments_url":"https://api.github.com/repos/CraneStation/cranelift/comments{/number}","issue_comment_url":"https://api.github.com/repos/CraneStation/cranelift/issues/comments{/number}","contents_url":"https://api.github.com/repos/CraneStation/cranelift/contents/{+path}","compare_url":"https://api.github.com/repos/CraneStation/cranelift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CraneStation/cranelift/merges","archive_url":"https://api.github.com/repos/CraneStation/cranelift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CraneStation/cranelift/downloads","issues_url":"https://api.github.com/repos/CraneStation/cranelift/issues{/number}","pulls_url":"https://api.github.com/repos/CraneStation/cranelift/pulls{/number}","milestones_url":"https://api.github.com/repos/CraneStation/cranelift/milestones{/number}","notifications_url":"https://api.github.com/repos/CraneStation/cranelift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CraneStation/cranelift/labels{/name}","releases_url":"https://api.github.com/repos/CraneStation/cranelift/releases{/id}","deployments_url":"https://api.github.com/repos/CraneStation/cranelift/deployments","created_at":"2016-01-24T02:04:11Z","updated_at":"2018-09-29T02:54:46Z","pushed_at":"2018-10-02T02:17:28Z","git_url":"git://github.com/CraneStation/cranelift.git","ssh_url":"git@github.com:CraneStation/cranelift.git","clone_url":"https://github.com/CraneStation/cranelift.git","svn_url":"https://github.com/CraneStation/cranelift","homepage":"https://cranelift.readthedocs.io/","size":6526,"stargazers_count":957,"watchers_count":957,"language":"Rust","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":90,"mirror_url":null,"archived":false,"open_issues_count":73,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":90,"open_issues":73,"watchers":957,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CraneStation/cranelift/pulls/534"},"html":{"href":"https://github.com/CraneStation/cranelift/pull/534"},"issue":{"href":"https://api.github.com/repos/CraneStation/cranelift/issues/534"},"comments":{"href":"https://api.github.com/repos/CraneStation/cranelift/issues/534/comments"},"review_comments":{"href":"https://api.github.com/repos/CraneStation/cranelift/pulls/534/comments"},"review_comment":{"href":"https://api.github.com/repos/CraneStation/cranelift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CraneStation/cranelift/pulls/534/commits"},"statuses":{"href":"https://api.github.com/repos/CraneStation/cranelift/statuses/e62d7ff54688d503d773bfa62dc3f57b0c21a431"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"sunfishcode"}}