{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/1830","repository_url":"https://api.github.com/repos/dotnet/coreclr","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/1830/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/1830/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/1830/events","html_url":"https://github.com/dotnet/coreclr/pull/1830","id":112714399,"number":1830,"title":"     Generate efficient code for rotation patterns.","user":{"login":"erozenfeld","id":10624223,"avatar_url":"https://avatars.githubusercontent.com/u/10624223?v=3","gravatar_id":"","url":"https://api.github.com/users/erozenfeld","html_url":"https://github.com/erozenfeld","followers_url":"https://api.github.com/users/erozenfeld/followers","following_url":"https://api.github.com/users/erozenfeld/following{/other_user}","gists_url":"https://api.github.com/users/erozenfeld/gists{/gist_id}","starred_url":"https://api.github.com/users/erozenfeld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erozenfeld/subscriptions","organizations_url":"https://api.github.com/users/erozenfeld/orgs","repos_url":"https://api.github.com/users/erozenfeld/repos","events_url":"https://api.github.com/users/erozenfeld/events{/privacy}","received_events_url":"https://api.github.com/users/erozenfeld/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/coreclr/labels/cla-already-signed","name":"cla-already-signed","color":"009800"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2015-10-22T01:58:16Z","updated_at":"2016-08-25T13:06:33Z","closed_at":"2015-10-22T22:37:41Z","pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/1830","html_url":"https://github.com/dotnet/coreclr/pull/1830","diff_url":"https://github.com/dotnet/coreclr/pull/1830.diff","patch_url":"https://github.com/dotnet/coreclr/pull/1830.patch"},"body":"     This change adds code to recognize rotation idioms and generate efficient instructions for them.\r\n\r\n     Two new operators are added: GT_ROL and GT_ROR.\r\n\r\n     The patterns recognized:\r\n     (x << c1) | (x >>> c2) => x rol c1\r\n     (x >>> c1) | (x << c2) => x ror c2\r\n\r\n     where c1 and c2  are constant and c1 + c2 == bitsize(x)\r\n\r\n     (x << y) | (x >>> (N - y)) => x rol y\r\n     (x >>> y) | (x << (N - y)) => x ror y\r\n\r\n     where N == bitsize(x)\r\n\r\n     (x << y & M1) | (x >>> (N - y) & M2) => x rol y\r\n     (x >>> y & M1) | (x << (N - y) & M2) => x ror y\r\n\r\n     where N == bitsize(x)\r\n     M1 & (N - 1) == N - 1\r\n     M2 & (N - 1) == N - 1\r\n\r\n     For a simple benchmark with 4 rotation patterns in a tight loop\r\n     time goes from 7.324 to 2.600 (2.8 speedup).\r\n\r\n     Rotations found and optimized in mscorlib:\r\n     System.Security.Cryptography.SHA256Managed::RotateRight\r\n     System.Security.Cryptography.SHA384Managed::RotateRight\r\n     System.Security.Cryptography.SHA512Managed::RotateRight\r\n     System.Security.Cryptography.RIPEMD160Managed:MDTransform (320 instances!)\r\n     System.Diagnostics.Tracing.EventSource.Sha1ForNonSecretPurposes::Rol1\r\n     System.Diagnostics.Tracing.EventSource.Sha1ForNonSecretPurposes::Rol5\r\n     System.Diagnostics.Tracing.EventSource.Sha1ForNonSecretPurposes::Rol30\r\n     System.Diagnostics.Tracing.EventSource.Sha1ForNonSecretPurposes::Drain\r\n     (9 instances of Sha1ForNonSecretPurposes::Rol* inlined)\r\n\r\n     Closes #1619."},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/242378810","html_url":"https://github.com/dotnet/coreclr/pull/1830#issuecomment-242378810","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/1830","id":242378810,"user":{"login":"LMLB","id":6322603,"avatar_url":"https://avatars.githubusercontent.com/u/6322603?v=3","gravatar_id":"","url":"https://api.github.com/users/LMLB","html_url":"https://github.com/LMLB","followers_url":"https://api.github.com/users/LMLB/followers","following_url":"https://api.github.com/users/LMLB/following{/other_user}","gists_url":"https://api.github.com/users/LMLB/gists{/gist_id}","starred_url":"https://api.github.com/users/LMLB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LMLB/subscriptions","organizations_url":"https://api.github.com/users/LMLB/orgs","repos_url":"https://api.github.com/users/LMLB/repos","events_url":"https://api.github.com/users/LMLB/events{/privacy}","received_events_url":"https://api.github.com/users/LMLB/received_events","type":"User","site_admin":false},"created_at":"2016-08-25T13:06:33Z","updated_at":"2016-08-25T13:06:33Z","body":"In the case with the masks, does the `N == bitsize(x)` test take into account that N will be masked?"}}
{"actor":{"display_login":"LMLB"}}