{"action":"opened","number":7348,"pull_request":{"url":"https://api.github.com/repos/facebook/hhvm/pulls/7348","id":85549190,"html_url":"https://github.com/facebook/hhvm/pull/7348","diff_url":"https://github.com/facebook/hhvm/pull/7348.diff","patch_url":"https://github.com/facebook/hhvm/pull/7348.patch","issue_url":"https://api.github.com/repos/facebook/hhvm/issues/7348","number":7348,"state":"open","locked":false,"title":"Fix overflowing integer multiplication for AArch64","user":{"login":"ptomsich","id":14983582,"avatar_url":"https://avatars.githubusercontent.com/u/14983582?v=3","gravatar_id":"","url":"https://api.github.com/users/ptomsich","html_url":"https://github.com/ptomsich","followers_url":"https://api.github.com/users/ptomsich/followers","following_url":"https://api.github.com/users/ptomsich/following{/other_user}","gists_url":"https://api.github.com/users/ptomsich/gists{/gist_id}","starred_url":"https://api.github.com/users/ptomsich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptomsich/subscriptions","organizations_url":"https://api.github.com/users/ptomsich/orgs","repos_url":"https://api.github.com/users/ptomsich/repos","events_url":"https://api.github.com/users/ptomsich/events{/privacy}","received_events_url":"https://api.github.com/users/ptomsich/received_events","type":"User","site_admin":false},"body":"AArch64 does not set flags on an integer-multiply and the common\r\nway to detect an overflow on integer multiplication will only\r\nprovide EQ/NEQ flags.  To avoid taking a major penalty when\r\nchecking for overflows on integer multiplication, we make the\r\nlowering of MulIntO architecture-specific and introduce a new\r\narchitecture-independent mulint (similarily to divint) vasm-insn.\r\n\r\nThe MulIntO node is lowered into the new 'mulint' vasm-instr, which\r\nis a special kind of branching instruction (i.e. it takes a label\r\nfor the slow-path, in case an integer-overflow occurs).\r\n'mulint' is marked to clobber the condition-code register.\r\n\r\nThe recommended way to detect an overflow on integer multiplication\r\non AArch64 is:\r\n  mul\t  calculate lower 64bit of the result\r\n  smulh\t  calculate the upper (signed/sign-extended) 64bits\r\n  cmp\t  compare if the upper 64bits are the sign-extension\r\n\t      of the lower 64bits (i.e. if all bits in the\r\n \t      upper register are the same as the sign-bit in\r\n\t      the lower register.\r\n\r\nTo efficiently expand into such a sequence, the following vasm\r\ninstructions have been added:\r\n  smulh\t     upper 64bits of the 128bit result of a signed multiply\r\n\t       (could be named more nicely, but as only AArch64 is\r\n\t        using anyway...)\r\n  cmpqsign   compare if one operand is the sign-extension of the\r\n               other operand (i.e if all bits in one register are\r\n               equivalent to the sign-bit of the other)\r\n  mulint     integer-multiplication w/ overflow-checking\r\n\r\nAt the same time, the 'imul' vasm has been altered to _not_ set any\r\nflags and _not_ perform any overflow-checking.  As it's only used\r\nfrom the non-overflowing multiplication path in irlower-arith.c this\r\nseems to be safe.  We an not remove 'imul', as it will still be used\r\nto expand to lower 'MulInt'.\r\n\r\nX-AffectedTests: quick/float-overflow.php\r\nSigned-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>","created_at":"2016-09-16T10:17:34Z","updated_at":"2016-09-16T10:17:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/facebook/hhvm/pulls/7348/commits","review_comments_url":"https://api.github.com/repos/facebook/hhvm/pulls/7348/comments","review_comment_url":"https://api.github.com/repos/facebook/hhvm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/hhvm/issues/7348/comments","statuses_url":"https://api.github.com/repos/facebook/hhvm/statuses/90941456503b19d2ec8bbe7fcd2b30549696e3a2","head":{"label":"ptomsich:mulint-v3","ref":"mulint-v3","sha":"90941456503b19d2ec8bbe7fcd2b30549696e3a2","user":{"login":"ptomsich","id":14983582,"avatar_url":"https://avatars.githubusercontent.com/u/14983582?v=3","gravatar_id":"","url":"https://api.github.com/users/ptomsich","html_url":"https://github.com/ptomsich","followers_url":"https://api.github.com/users/ptomsich/followers","following_url":"https://api.github.com/users/ptomsich/following{/other_user}","gists_url":"https://api.github.com/users/ptomsich/gists{/gist_id}","starred_url":"https://api.github.com/users/ptomsich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptomsich/subscriptions","organizations_url":"https://api.github.com/users/ptomsich/orgs","repos_url":"https://api.github.com/users/ptomsich/repos","events_url":"https://api.github.com/users/ptomsich/events{/privacy}","received_events_url":"https://api.github.com/users/ptomsich/received_events","type":"User","site_admin":false},"repo":{"id":67024357,"name":"hhvm","full_name":"ptomsich/hhvm","owner":{"login":"ptomsich","id":14983582,"avatar_url":"https://avatars.githubusercontent.com/u/14983582?v=3","gravatar_id":"","url":"https://api.github.com/users/ptomsich","html_url":"https://github.com/ptomsich","followers_url":"https://api.github.com/users/ptomsich/followers","following_url":"https://api.github.com/users/ptomsich/following{/other_user}","gists_url":"https://api.github.com/users/ptomsich/gists{/gist_id}","starred_url":"https://api.github.com/users/ptomsich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptomsich/subscriptions","organizations_url":"https://api.github.com/users/ptomsich/orgs","repos_url":"https://api.github.com/users/ptomsich/repos","events_url":"https://api.github.com/users/ptomsich/events{/privacy}","received_events_url":"https://api.github.com/users/ptomsich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ptomsich/hhvm","description":"A virtual machine designed for executing programs written in Hack and PHP. ","fork":true,"url":"https://api.github.com/repos/ptomsich/hhvm","forks_url":"https://api.github.com/repos/ptomsich/hhvm/forks","keys_url":"https://api.github.com/repos/ptomsich/hhvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ptomsich/hhvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ptomsich/hhvm/teams","hooks_url":"https://api.github.com/repos/ptomsich/hhvm/hooks","issue_events_url":"https://api.github.com/repos/ptomsich/hhvm/issues/events{/number}","events_url":"https://api.github.com/repos/ptomsich/hhvm/events","assignees_url":"https://api.github.com/repos/ptomsich/hhvm/assignees{/user}","branches_url":"https://api.github.com/repos/ptomsich/hhvm/branches{/branch}","tags_url":"https://api.github.com/repos/ptomsich/hhvm/tags","blobs_url":"https://api.github.com/repos/ptomsich/hhvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ptomsich/hhvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ptomsich/hhvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/ptomsich/hhvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ptomsich/hhvm/statuses/{sha}","languages_url":"https://api.github.com/repos/ptomsich/hhvm/languages","stargazers_url":"https://api.github.com/repos/ptomsich/hhvm/stargazers","contributors_url":"https://api.github.com/repos/ptomsich/hhvm/contributors","subscribers_url":"https://api.github.com/repos/ptomsich/hhvm/subscribers","subscription_url":"https://api.github.com/repos/ptomsich/hhvm/subscription","commits_url":"https://api.github.com/repos/ptomsich/hhvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/ptomsich/hhvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/ptomsich/hhvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/ptomsich/hhvm/issues/comments{/number}","contents_url":"https://api.github.com/repos/ptomsich/hhvm/contents/{+path}","compare_url":"https://api.github.com/repos/ptomsich/hhvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ptomsich/hhvm/merges","archive_url":"https://api.github.com/repos/ptomsich/hhvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ptomsich/hhvm/downloads","issues_url":"https://api.github.com/repos/ptomsich/hhvm/issues{/number}","pulls_url":"https://api.github.com/repos/ptomsich/hhvm/pulls{/number}","milestones_url":"https://api.github.com/repos/ptomsich/hhvm/milestones{/number}","notifications_url":"https://api.github.com/repos/ptomsich/hhvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ptomsich/hhvm/labels{/name}","releases_url":"https://api.github.com/repos/ptomsich/hhvm/releases{/id}","deployments_url":"https://api.github.com/repos/ptomsich/hhvm/deployments","created_at":"2016-08-31T09:38:47Z","updated_at":"2016-08-31T09:40:01Z","pushed_at":"2016-09-16T10:14:01Z","git_url":"git://github.com/ptomsich/hhvm.git","ssh_url":"git@github.com:ptomsich/hhvm.git","clone_url":"https://github.com/ptomsich/hhvm.git","svn_url":"https://github.com/ptomsich/hhvm","homepage":"http://hhvm.com","size":240018,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"a704ce292c9339a5d4ffc0222abe42f5694e8edb","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":455600,"name":"hhvm","full_name":"facebook/hhvm","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/hhvm","description":"A virtual machine designed for executing programs written in Hack and PHP. ","fork":false,"url":"https://api.github.com/repos/facebook/hhvm","forks_url":"https://api.github.com/repos/facebook/hhvm/forks","keys_url":"https://api.github.com/repos/facebook/hhvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/hhvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/hhvm/teams","hooks_url":"https://api.github.com/repos/facebook/hhvm/hooks","issue_events_url":"https://api.github.com/repos/facebook/hhvm/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/hhvm/events","assignees_url":"https://api.github.com/repos/facebook/hhvm/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/hhvm/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/hhvm/tags","blobs_url":"https://api.github.com/repos/facebook/hhvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/hhvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/hhvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/hhvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/hhvm/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/hhvm/languages","stargazers_url":"https://api.github.com/repos/facebook/hhvm/stargazers","contributors_url":"https://api.github.com/repos/facebook/hhvm/contributors","subscribers_url":"https://api.github.com/repos/facebook/hhvm/subscribers","subscription_url":"https://api.github.com/repos/facebook/hhvm/subscription","commits_url":"https://api.github.com/repos/facebook/hhvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/hhvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/hhvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/hhvm/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/hhvm/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/hhvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/hhvm/merges","archive_url":"https://api.github.com/repos/facebook/hhvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/hhvm/downloads","issues_url":"https://api.github.com/repos/facebook/hhvm/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/hhvm/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/hhvm/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/hhvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/hhvm/labels{/name}","releases_url":"https://api.github.com/repos/facebook/hhvm/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/hhvm/deployments","created_at":"2010-01-02T01:17:06Z","updated_at":"2016-09-16T05:25:11Z","pushed_at":"2016-09-16T07:40:47Z","git_url":"git://github.com/facebook/hhvm.git","ssh_url":"git@github.com:facebook/hhvm.git","clone_url":"https://github.com/facebook/hhvm.git","svn_url":"https://github.com/facebook/hhvm","homepage":"http://hhvm.com","size":295401,"stargazers_count":13921,"watchers_count":13921,"language":"C++","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":2558,"mirror_url":null,"open_issues_count":880,"forks":2558,"open_issues":880,"watchers":13921,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/hhvm/pulls/7348"},"html":{"href":"https://github.com/facebook/hhvm/pull/7348"},"issue":{"href":"https://api.github.com/repos/facebook/hhvm/issues/7348"},"comments":{"href":"https://api.github.com/repos/facebook/hhvm/issues/7348/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/hhvm/pulls/7348/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/hhvm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/hhvm/pulls/7348/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/hhvm/statuses/90941456503b19d2ec8bbe7fcd2b30549696e3a2"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":60,"deletions":53,"changed_files":8}}
{"actor":{"display_login":"ptomsich"}}