{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/pulls/comments/200923704","pull_request_review_id":135324113,"id":200923704,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDkyMzcwNA==","diff_hunk":"@@ -42,68 +46,112 @@ macro_rules! impl_swap_bytes {\n     };\n }\n \n-#[cfg(test)]\n-macro_rules! test_swap_bytes {\n-    (u8x2) => {\n-        #[test]\n-        fn swap_bytes() {\n-            use coresimd::simd::u8x2;\n-            use std::mem;\n-\n-            let x: u16 = 0x2d99;\n-            let expected = x.swap_bytes();\n-\n-            let vec: u8x2 = unsafe { mem::transmute(x) };\n-            let actual = unsafe { mem::transmute(vec.swap_bytes()) };\n+macro_rules! impl_test {\n+    ($id:ident, $vec8:ident) => {","path":"coresimd/ppsv/api/swap_bytes.rs","position":null,"original_position":46,"commit_id":"c52e192f252bd2a41561c623174a7f699f921b68","original_commit_id":"c52e192f252bd2a41561c623174a7f699f921b68","user":{"login":"gnzlbg","id":904614,"node_id":"MDQ6VXNlcjkwNDYxNA==","avatar_url":"https://avatars0.githubusercontent.com/u/904614?v=4","gravatar_id":"","url":"https://api.github.com/users/gnzlbg","html_url":"https://github.com/gnzlbg","followers_url":"https://api.github.com/users/gnzlbg/followers","following_url":"https://api.github.com/users/gnzlbg/following{/other_user}","gists_url":"https://api.github.com/users/gnzlbg/gists{/gist_id}","starred_url":"https://api.github.com/users/gnzlbg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnzlbg/subscriptions","organizations_url":"https://api.github.com/users/gnzlbg/orgs","repos_url":"https://api.github.com/users/gnzlbg/repos","events_url":"https://api.github.com/users/gnzlbg/events{/privacy}","received_events_url":"https://api.github.com/users/gnzlbg/received_events","type":"User","site_admin":false},"body":"I think it would be better to just use a `[u8; 64]`, initialize that, and then use the `$id::{load,store}_unaligned` methods to load that into a vector, call `swap_bytes`/`to_le`/`to_be`, and then write the result back to an `[u8; 64]` array. Then you just compare the first `size_of::<$id>()` bytes of the array against the result that they should have.\r\n ","created_at":"2018-07-09T08:41:26Z","updated_at":"2018-07-09T08:41:27Z","html_url":"https://github.com/rust-lang-nursery/stdsimd/pull/517#discussion_r200923704","pull_request_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/pulls/517","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/rust-lang-nursery/stdsimd/pulls/comments/200923704"},"html":{"href":"https://github.com/rust-lang-nursery/stdsimd/pull/517#discussion_r200923704"},"pull_request":{"href":"https://api.github.com/repos/rust-lang-nursery/stdsimd/pulls/517"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/pulls/517","id":199852525,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5ODUyNTI1","html_url":"https://github.com/rust-lang-nursery/stdsimd/pull/517","diff_url":"https://github.com/rust-lang-nursery/stdsimd/pull/517.diff","patch_url":"https://github.com/rust-lang-nursery/stdsimd/pull/517.patch","issue_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/issues/517","number":517,"state":"open","locked":false,"title":"add swap_bytes/to_le/to_be","user":{"login":"TheIronBorn","id":7707250,"node_id":"MDQ6VXNlcjc3MDcyNTA=","avatar_url":"https://avatars2.githubusercontent.com/u/7707250?v=4","gravatar_id":"","url":"https://api.github.com/users/TheIronBorn","html_url":"https://github.com/TheIronBorn","followers_url":"https://api.github.com/users/TheIronBorn/followers","following_url":"https://api.github.com/users/TheIronBorn/following{/other_user}","gists_url":"https://api.github.com/users/TheIronBorn/gists{/gist_id}","starred_url":"https://api.github.com/users/TheIronBorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheIronBorn/subscriptions","organizations_url":"https://api.github.com/users/TheIronBorn/orgs","repos_url":"https://api.github.com/users/TheIronBorn/repos","events_url":"https://api.github.com/users/TheIronBorn/events{/privacy}","received_events_url":"https://api.github.com/users/TheIronBorn/received_events","type":"User","site_admin":false},"body":"We could add some `llvm.bswap` implementations (https://godbolt.org/g/jH2FCR suggests it might be better).\r\n\r\nTesting could be better.","created_at":"2018-07-06T21:37:01Z","updated_at":"2018-07-09T08:41:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"451ba90ca903d6387dc5749b90a0ebf6e72e2bea","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/pulls/517/commits","review_comments_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/pulls/517/comments","review_comment_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/issues/517/comments","statuses_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/statuses/c52e192f252bd2a41561c623174a7f699f921b68","head":{"label":"TheIronBorn:patch-2","ref":"patch-2","sha":"c52e192f252bd2a41561c623174a7f699f921b68","user":{"login":"TheIronBorn","id":7707250,"node_id":"MDQ6VXNlcjc3MDcyNTA=","avatar_url":"https://avatars2.githubusercontent.com/u/7707250?v=4","gravatar_id":"","url":"https://api.github.com/users/TheIronBorn","html_url":"https://github.com/TheIronBorn","followers_url":"https://api.github.com/users/TheIronBorn/followers","following_url":"https://api.github.com/users/TheIronBorn/following{/other_user}","gists_url":"https://api.github.com/users/TheIronBorn/gists{/gist_id}","starred_url":"https://api.github.com/users/TheIronBorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheIronBorn/subscriptions","organizations_url":"https://api.github.com/users/TheIronBorn/orgs","repos_url":"https://api.github.com/users/TheIronBorn/repos","events_url":"https://api.github.com/users/TheIronBorn/events{/privacy}","received_events_url":"https://api.github.com/users/TheIronBorn/received_events","type":"User","site_admin":false},"repo":{"id":137392572,"node_id":"MDEwOlJlcG9zaXRvcnkxMzczOTI1NzI=","name":"stdsimd","full_name":"TheIronBorn/stdsimd","owner":{"login":"TheIronBorn","id":7707250,"node_id":"MDQ6VXNlcjc3MDcyNTA=","avatar_url":"https://avatars2.githubusercontent.com/u/7707250?v=4","gravatar_id":"","url":"https://api.github.com/users/TheIronBorn","html_url":"https://github.com/TheIronBorn","followers_url":"https://api.github.com/users/TheIronBorn/followers","following_url":"https://api.github.com/users/TheIronBorn/following{/other_user}","gists_url":"https://api.github.com/users/TheIronBorn/gists{/gist_id}","starred_url":"https://api.github.com/users/TheIronBorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheIronBorn/subscriptions","organizations_url":"https://api.github.com/users/TheIronBorn/orgs","repos_url":"https://api.github.com/users/TheIronBorn/repos","events_url":"https://api.github.com/users/TheIronBorn/events{/privacy}","received_events_url":"https://api.github.com/users/TheIronBorn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TheIronBorn/stdsimd","description":"Experiments with adding SIMD support to Rust's standard library.","fork":true,"url":"https://api.github.com/repos/TheIronBorn/stdsimd","forks_url":"https://api.github.com/repos/TheIronBorn/stdsimd/forks","keys_url":"https://api.github.com/repos/TheIronBorn/stdsimd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TheIronBorn/stdsimd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TheIronBorn/stdsimd/teams","hooks_url":"https://api.github.com/repos/TheIronBorn/stdsimd/hooks","issue_events_url":"https://api.github.com/repos/TheIronBorn/stdsimd/issues/events{/number}","events_url":"https://api.github.com/repos/TheIronBorn/stdsimd/events","assignees_url":"https://api.github.com/repos/TheIronBorn/stdsimd/assignees{/user}","branches_url":"https://api.github.com/repos/TheIronBorn/stdsimd/branches{/branch}","tags_url":"https://api.github.com/repos/TheIronBorn/stdsimd/tags","blobs_url":"https://api.github.com/repos/TheIronBorn/stdsimd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TheIronBorn/stdsimd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TheIronBorn/stdsimd/git/refs{/sha}","trees_url":"https://api.github.com/repos/TheIronBorn/stdsimd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TheIronBorn/stdsimd/statuses/{sha}","languages_url":"https://api.github.com/repos/TheIronBorn/stdsimd/languages","stargazers_url":"https://api.github.com/repos/TheIronBorn/stdsimd/stargazers","contributors_url":"https://api.github.com/repos/TheIronBorn/stdsimd/contributors","subscribers_url":"https://api.github.com/repos/TheIronBorn/stdsimd/subscribers","subscription_url":"https://api.github.com/repos/TheIronBorn/stdsimd/subscription","commits_url":"https://api.github.com/repos/TheIronBorn/stdsimd/commits{/sha}","git_commits_url":"https://api.github.com/repos/TheIronBorn/stdsimd/git/commits{/sha}","comments_url":"https://api.github.com/repos/TheIronBorn/stdsimd/comments{/number}","issue_comment_url":"https://api.github.com/repos/TheIronBorn/stdsimd/issues/comments{/number}","contents_url":"https://api.github.com/repos/TheIronBorn/stdsimd/contents/{+path}","compare_url":"https://api.github.com/repos/TheIronBorn/stdsimd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TheIronBorn/stdsimd/merges","archive_url":"https://api.github.com/repos/TheIronBorn/stdsimd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TheIronBorn/stdsimd/downloads","issues_url":"https://api.github.com/repos/TheIronBorn/stdsimd/issues{/number}","pulls_url":"https://api.github.com/repos/TheIronBorn/stdsimd/pulls{/number}","milestones_url":"https://api.github.com/repos/TheIronBorn/stdsimd/milestones{/number}","notifications_url":"https://api.github.com/repos/TheIronBorn/stdsimd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TheIronBorn/stdsimd/labels{/name}","releases_url":"https://api.github.com/repos/TheIronBorn/stdsimd/releases{/id}","deployments_url":"https://api.github.com/repos/TheIronBorn/stdsimd/deployments","created_at":"2018-06-14T18:08:53Z","updated_at":"2018-07-07T18:47:30Z","pushed_at":"2018-07-07T23:16:33Z","git_url":"git://github.com/TheIronBorn/stdsimd.git","ssh_url":"git@github.com:TheIronBorn/stdsimd.git","clone_url":"https://github.com/TheIronBorn/stdsimd.git","svn_url":"https://github.com/TheIronBorn/stdsimd","homepage":null,"size":10836,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang-nursery:master","ref":"master","sha":"9c2006c8a0ae849a2faae947d6724156f0fadfc5","user":{"login":"rust-lang-nursery","id":14631425,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0NjMxNDI1","avatar_url":"https://avatars1.githubusercontent.com/u/14631425?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang-nursery","html_url":"https://github.com/rust-lang-nursery","followers_url":"https://api.github.com/users/rust-lang-nursery/followers","following_url":"https://api.github.com/users/rust-lang-nursery/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang-nursery/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang-nursery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang-nursery/subscriptions","organizations_url":"https://api.github.com/users/rust-lang-nursery/orgs","repos_url":"https://api.github.com/users/rust-lang-nursery/repos","events_url":"https://api.github.com/users/rust-lang-nursery/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang-nursery/received_events","type":"Organization","site_admin":false},"repo":{"id":74716300,"node_id":"MDEwOlJlcG9zaXRvcnk3NDcxNjMwMA==","name":"stdsimd","full_name":"rust-lang-nursery/stdsimd","owner":{"login":"rust-lang-nursery","id":14631425,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0NjMxNDI1","avatar_url":"https://avatars1.githubusercontent.com/u/14631425?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang-nursery","html_url":"https://github.com/rust-lang-nursery","followers_url":"https://api.github.com/users/rust-lang-nursery/followers","following_url":"https://api.github.com/users/rust-lang-nursery/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang-nursery/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang-nursery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang-nursery/subscriptions","organizations_url":"https://api.github.com/users/rust-lang-nursery/orgs","repos_url":"https://api.github.com/users/rust-lang-nursery/repos","events_url":"https://api.github.com/users/rust-lang-nursery/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang-nursery/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang-nursery/stdsimd","description":"Experiments with adding SIMD support to Rust's standard library.","fork":false,"url":"https://api.github.com/repos/rust-lang-nursery/stdsimd","forks_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/forks","keys_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/teams","hooks_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/hooks","issue_events_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/events","assignees_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/tags","blobs_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/languages","stargazers_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/stargazers","contributors_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/contributors","subscribers_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/subscribers","subscription_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/subscription","commits_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/merges","archive_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/downloads","issues_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/releases{/id}","deployments_url":"https://api.github.com/repos/rust-lang-nursery/stdsimd/deployments","created_at":"2016-11-25T01:41:18Z","updated_at":"2018-07-09T05:02:20Z","pushed_at":"2018-07-08T15:45:57Z","git_url":"git://github.com/rust-lang-nursery/stdsimd.git","ssh_url":"git@github.com:rust-lang-nursery/stdsimd.git","clone_url":"https://github.com/rust-lang-nursery/stdsimd.git","svn_url":"https://github.com/rust-lang-nursery/stdsimd","homepage":null,"size":11741,"stargazers_count":276,"watchers_count":276,"language":"Rust","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":66,"mirror_url":null,"archived":false,"open_issues_count":61,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":66,"open_issues":61,"watchers":276,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang-nursery/stdsimd/pulls/517"},"html":{"href":"https://github.com/rust-lang-nursery/stdsimd/pull/517"},"issue":{"href":"https://api.github.com/repos/rust-lang-nursery/stdsimd/issues/517"},"comments":{"href":"https://api.github.com/repos/rust-lang-nursery/stdsimd/issues/517/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang-nursery/stdsimd/pulls/517/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang-nursery/stdsimd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang-nursery/stdsimd/pulls/517/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang-nursery/stdsimd/statuses/c52e192f252bd2a41561c623174a7f699f921b68"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"gnzlbg"}}