{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/165807731","pull_request_review_id":93809766,"id":165807731,"diff_hunk":"@@ -93,17 +93,34 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)\n \n             case 2:\n                 genConsumeOperands(node);\n+                op1Reg = op1->gtRegNum;\n+                op2Reg = op2->gtRegNum;\n                 if (category == HW_Category_MemoryStore)\n                 {\n-                    emit->emitIns_AR_R(ins, emitTypeSize(TYP_SIMD16), op2->gtRegNum, op1->gtRegNum, 0);\n+                    emit->emitIns_AR_R(ins, emitTypeSize(TYP_SIMD16), op2Reg, op1Reg, 0);\n                 }\n                 else if ((ival != -1) && varTypeIsFloating(baseType))\n                 {\n                     genHWIntrinsic_R_R_RM_I(node, ins);\n                 }\n                 else if (category == HW_Category_MemoryLoad)\n                 {\n-                    emit->emitIns_SIMD_R_R_AR(ins, emitTypeSize(TYP_SIMD16), targetReg, op1->gtRegNum, op2->gtRegNum);\n+                    emit->emitIns_SIMD_R_R_AR(ins, emitTypeSize(TYP_SIMD16), targetReg, op1Reg, op2Reg);\n+                }\n+                else if (Compiler::isImmHWIntrinsic(intrinsicID, op2))\n+                {\n+                    if (op2->IsCnsIntOrI())\n+                    {\n+                        ssize_t ival = op2->AsIntConCommon()->IconValue();","path":"src/jit/hwintrinsiccodegenxarch.cpp","position":35,"original_position":35,"commit_id":"fa8907ef8f7d23e0b92fd93451823fd4338d6bd7","original_commit_id":"fa8907ef8f7d23e0b92fd93451823fd4338d6bd7","user":{"login":"mikedn","id":9973420,"avatar_url":"https://avatars2.githubusercontent.com/u/9973420?v=4","gravatar_id":"","url":"https://api.github.com/users/mikedn","html_url":"https://github.com/mikedn","followers_url":"https://api.github.com/users/mikedn/followers","following_url":"https://api.github.com/users/mikedn/following{/other_user}","gists_url":"https://api.github.com/users/mikedn/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedn/subscriptions","organizations_url":"https://api.github.com/users/mikedn/orgs","repos_url":"https://api.github.com/users/mikedn/repos","events_url":"https://api.github.com/users/mikedn/events{/privacy}","received_events_url":"https://api.github.com/users/mikedn/received_events","type":"User","site_admin":false},"body":"Since you have used `IsCnsIntOrI` using `AsIntCon` would make more sense. `AsIntConCommon` also accepts `GT_CNS_LNG` which is not needed here.","created_at":"2018-02-03T07:19:04Z","updated_at":"2018-02-03T07:19:04Z","html_url":"https://github.com/dotnet/coreclr/pull/16183#discussion_r165807731","pull_request_url":"https://api.github.com/repos/dotnet/coreclr/pulls/16183","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/165807731"},"html":{"href":"https://github.com/dotnet/coreclr/pull/16183#discussion_r165807731"},"pull_request":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/16183"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/16183","id":166922864,"html_url":"https://github.com/dotnet/coreclr/pull/16183","diff_url":"https://github.com/dotnet/coreclr/pull/16183.diff","patch_url":"https://github.com/dotnet/coreclr/pull/16183.patch","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/16183","number":16183,"state":"open","locked":false,"title":"[WIP] Update the table-driven framework to support x86 imm-intrinsics","user":{"login":"fiigii","id":1263030,"avatar_url":"https://avatars1.githubusercontent.com/u/1263030?v=4","gravatar_id":"","url":"https://api.github.com/users/fiigii","html_url":"https://github.com/fiigii","followers_url":"https://api.github.com/users/fiigii/followers","following_url":"https://api.github.com/users/fiigii/following{/other_user}","gists_url":"https://api.github.com/users/fiigii/gists{/gist_id}","starred_url":"https://api.github.com/users/fiigii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fiigii/subscriptions","organizations_url":"https://api.github.com/users/fiigii/orgs","repos_url":"https://api.github.com/users/fiigii/repos","events_url":"https://api.github.com/users/fiigii/events{/privacy}","received_events_url":"https://api.github.com/users/fiigii/received_events","type":"User","site_admin":false},"body":"This PR updates the table-driven framework to support x86 imm-intrinsics. After this update, implementing imm-intrinsics just needs one-line definition in `hwintrinsiclistxarch.h`.\r\n\r\nThis PR implements certain imm-intrinsics which have special semanctics\r\n1. `Avx.Compare\\CompareScalar` just accepts imm-value in 0-31. Out of range argument will trigger `ArgumentOutOfRangeException`.\r\n2. `Avx2\\Sse2.ShiftLeftLogical\\ShiftRightLogical\\ShiftRightArithmetic` never throw any exception\r\n    - that will be converted to `shift* ymm, ymm, xmm` (or `shift* xmm, xmm`)form when the imm-arg is not a constant. For example, `Avx2.ShiftLeftLogical(v, i)` would generate `vmovd   xmm1, edi;  vpsllw  ymm0, ymm0, xmm1` instead of the jumptable fallback.\r\n    - `ShiftLeftLogical\\ShiftRightLogical` will be converted to `SetZeroVector256\\128` on out of range imm-arg.\r\n    - `ShiftRightArithmetic`'s imm-arg will be normalized to the maximum valid value on out of range imm-arg.\r\n3. `Avx2\\Sse2.ShiftLeftLogical128BitLane` will be converted to `SetZeroVector256\\128` on out of range imm-arg.","created_at":"2018-02-02T22:58:55Z","updated_at":"2018-02-03T07:19:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a1e56e7828856410c03b291571f7ee5b2ce9c7ae","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/coreclr/pulls/16183/commits","review_comments_url":"https://api.github.com/repos/dotnet/coreclr/pulls/16183/comments","review_comment_url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/16183/comments","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/fa8907ef8f7d23e0b92fd93451823fd4338d6bd7","head":{"label":"fiigii:refactor-imm","ref":"refactor-imm","sha":"fa8907ef8f7d23e0b92fd93451823fd4338d6bd7","user":{"login":"fiigii","id":1263030,"avatar_url":"https://avatars1.githubusercontent.com/u/1263030?v=4","gravatar_id":"","url":"https://api.github.com/users/fiigii","html_url":"https://github.com/fiigii","followers_url":"https://api.github.com/users/fiigii/followers","following_url":"https://api.github.com/users/fiigii/following{/other_user}","gists_url":"https://api.github.com/users/fiigii/gists{/gist_id}","starred_url":"https://api.github.com/users/fiigii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fiigii/subscriptions","organizations_url":"https://api.github.com/users/fiigii/orgs","repos_url":"https://api.github.com/users/fiigii/repos","events_url":"https://api.github.com/users/fiigii/events{/privacy}","received_events_url":"https://api.github.com/users/fiigii/received_events","type":"User","site_admin":false},"repo":{"id":81883824,"name":"coreclr","full_name":"fiigii/coreclr","owner":{"login":"fiigii","id":1263030,"avatar_url":"https://avatars1.githubusercontent.com/u/1263030?v=4","gravatar_id":"","url":"https://api.github.com/users/fiigii","html_url":"https://github.com/fiigii","followers_url":"https://api.github.com/users/fiigii/followers","following_url":"https://api.github.com/users/fiigii/following{/other_user}","gists_url":"https://api.github.com/users/fiigii/gists{/gist_id}","starred_url":"https://api.github.com/users/fiigii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fiigii/subscriptions","organizations_url":"https://api.github.com/users/fiigii/orgs","repos_url":"https://api.github.com/users/fiigii/repos","events_url":"https://api.github.com/users/fiigii/events{/privacy}","received_events_url":"https://api.github.com/users/fiigii/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fiigii/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR, and the base library, called mscorlib. It includes the garbage collector, JIT compiler, base .NET data types and many low-level classes.","fork":true,"url":"https://api.github.com/repos/fiigii/coreclr","forks_url":"https://api.github.com/repos/fiigii/coreclr/forks","keys_url":"https://api.github.com/repos/fiigii/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fiigii/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fiigii/coreclr/teams","hooks_url":"https://api.github.com/repos/fiigii/coreclr/hooks","issue_events_url":"https://api.github.com/repos/fiigii/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/fiigii/coreclr/events","assignees_url":"https://api.github.com/repos/fiigii/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/fiigii/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/fiigii/coreclr/tags","blobs_url":"https://api.github.com/repos/fiigii/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fiigii/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fiigii/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/fiigii/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fiigii/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/fiigii/coreclr/languages","stargazers_url":"https://api.github.com/repos/fiigii/coreclr/stargazers","contributors_url":"https://api.github.com/repos/fiigii/coreclr/contributors","subscribers_url":"https://api.github.com/repos/fiigii/coreclr/subscribers","subscription_url":"https://api.github.com/repos/fiigii/coreclr/subscription","commits_url":"https://api.github.com/repos/fiigii/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/fiigii/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/fiigii/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/fiigii/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/fiigii/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/fiigii/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fiigii/coreclr/merges","archive_url":"https://api.github.com/repos/fiigii/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fiigii/coreclr/downloads","issues_url":"https://api.github.com/repos/fiigii/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/fiigii/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/fiigii/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/fiigii/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fiigii/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/fiigii/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/fiigii/coreclr/deployments","created_at":"2017-02-13T23:46:21Z","updated_at":"2017-02-13T23:48:37Z","pushed_at":"2018-02-03T00:58:03Z","git_url":"git://github.com/fiigii/coreclr.git","ssh_url":"git@github.com:fiigii/coreclr.git","clone_url":"https://github.com/fiigii/coreclr.git","svn_url":"https://github.com/fiigii/coreclr","homepage":"https://docs.microsoft.com/dotnet/","size":203762,"stargazers_count":0,"watchers_count":0,"language":"C#","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":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"f6ba335278bb966e8e5f9cd33f51818c6fac44fa","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":30092893,"name":"coreclr","full_name":"dotnet/coreclr","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR, and the base library, called System.Private.Corelib (or mscorlib). It includes the garbage collector, JIT compiler, base .NET data types and many low-level classes. We welcome contributions.","fork":false,"url":"https://api.github.com/repos/dotnet/coreclr","forks_url":"https://api.github.com/repos/dotnet/coreclr/forks","keys_url":"https://api.github.com/repos/dotnet/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/coreclr/teams","hooks_url":"https://api.github.com/repos/dotnet/coreclr/hooks","issue_events_url":"https://api.github.com/repos/dotnet/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/coreclr/events","assignees_url":"https://api.github.com/repos/dotnet/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/coreclr/tags","blobs_url":"https://api.github.com/repos/dotnet/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/coreclr/languages","stargazers_url":"https://api.github.com/repos/dotnet/coreclr/stargazers","contributors_url":"https://api.github.com/repos/dotnet/coreclr/contributors","subscribers_url":"https://api.github.com/repos/dotnet/coreclr/subscribers","subscription_url":"https://api.github.com/repos/dotnet/coreclr/subscription","commits_url":"https://api.github.com/repos/dotnet/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/coreclr/merges","archive_url":"https://api.github.com/repos/dotnet/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/coreclr/downloads","issues_url":"https://api.github.com/repos/dotnet/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/coreclr/deployments","created_at":"2015-01-30T22:10:02Z","updated_at":"2018-02-03T07:10:08Z","pushed_at":"2018-02-03T07:17:14Z","git_url":"git://github.com/dotnet/coreclr.git","ssh_url":"git@github.com:dotnet/coreclr.git","clone_url":"https://github.com/dotnet/coreclr.git","svn_url":"https://github.com/dotnet/coreclr","homepage":"https://github.com/dotnet/core","size":204894,"stargazers_count":8895,"watchers_count":8895,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2240,"mirror_url":null,"archived":false,"open_issues_count":1494,"license":null,"forks":2240,"open_issues":1494,"watchers":8895,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/16183"},"html":{"href":"https://github.com/dotnet/coreclr/pull/16183"},"issue":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/16183"},"comments":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/16183/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/16183/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/16183/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/coreclr/statuses/fa8907ef8f7d23e0b92fd93451823fd4338d6bd7"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"mikedn"}}