{"action":"created","comment":{"url":"https://api.github.com/repos/QuantStack/xsimd/pulls/comments/187023109","pull_request_review_id":118717222,"id":187023109,"diff_hunk":"@@ -0,0 +1,148 @@\n+/***************************************************************************\n+* Copyright (c) 2016, Johan Mabille and Sylvain Corlay                     *\n+*                                                                          *\n+* Distributed under the terms of the BSD 3-Clause License.                 *\n+*                                                                          *\n+* The full license is in the file LICENSE, distributed with this software. *\n+****************************************************************************/\n+\n+#ifndef XSIMD_AVX_SHUFFLING_HPP\n+#define XSIMD_AVX_SHUFFLING_HPP\n+\n+#include \"xsimd/types/xsimd_avx_conversion.hpp\"\n+\n+namespace xsimd \n+{\n+    // Version of select(a, b) with compile time mask\n+    template <class B>\n+    struct selector_immediate;\n+\n+    template <class T, std::size_t N>\n+    struct selector_immediate<batch<T, N>>\n+    {\n+        using type = int32_t;\n+    };\n+\n+    template <typename selector_immediate<batch<float, 8>>::type P, class T>\n+    batch<T, 8> select(const batch<T, 8>& a, const batch<T, 8>& b);\n+\n+    template <typename selector_immediate<batch<double, 4>>::type P, class T>\n+    batch<T, 4> select(const batch<T, 4>& a, const batch<T, 4>& b);\n+\n+    constexpr static int AaBbCcDd = 1;\n+    constexpr static int AaCc = 2;\n+    constexpr static int BbDd = 3;\n+    constexpr static int AaBbEeFf = 4;\n+    constexpr static int ABabEFef = 5;\n+    constexpr static int CcDdGgHh = 6;\n+    constexpr static int CDcdGHgh = 7;\n+\n+    template <uint64_t P, int B = -1, class T, size_t N>\n+    auto interleave(const batch<T, N>& a, const batch<T, N>& b);\n+\n+    namespace detail\n+    {\n+        template <uint64_t P, int B, class T, size_t N>\n+        struct interleave_impl;\n+\n+        template <class T, size_t N>\n+        struct interleave_impl<AaCc, 64, T, N>\n+        {\n+            batch<T, N> operator()(const batch<T, N>& a, const batch<T, N>& b)\n+            {\n+                // {a, b, c, d} Δ {A, B, C, D} → {a, A, c, C}\n+                batch<int64_t, 4> tmp = _mm256_unpacklo_epi64(bitwise_cast<batch<int64_t, 4>>(a),\n+                                                              bitwise_cast<batch<int64_t, 4>>(b));\n+                return bitwise_cast<batch<T, N>>(tmp);","path":"include/xsimd/types/xsimd_avx_shuffling.hpp","position":56,"original_position":56,"commit_id":"4a81c17b23b1bc12eb73adb23ca8a5206c21a848","original_commit_id":"4a81c17b23b1bc12eb73adb23ca8a5206c21a848","user":{"login":"wolfv","id":885054,"avatar_url":"https://avatars0.githubusercontent.com/u/885054?v=4","gravatar_id":"","url":"https://api.github.com/users/wolfv","html_url":"https://github.com/wolfv","followers_url":"https://api.github.com/users/wolfv/followers","following_url":"https://api.github.com/users/wolfv/following{/other_user}","gists_url":"https://api.github.com/users/wolfv/gists{/gist_id}","starred_url":"https://api.github.com/users/wolfv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolfv/subscriptions","organizations_url":"https://api.github.com/users/wolfv/orgs","repos_url":"https://api.github.com/users/wolfv/repos","events_url":"https://api.github.com/users/wolfv/events{/privacy}","received_events_url":"https://api.github.com/users/wolfv/received_events","type":"User","site_admin":false},"body":"What would be cool is to write a program with some optimizer that can find the optimal permutation sequence -- it could be written in python and use the cost of the instruction docs from agner fog :) (In case you're looking for a research project, haha).","created_at":"2018-05-09T12:29:34Z","updated_at":"2018-05-09T12:29:35Z","html_url":"https://github.com/QuantStack/xsimd/pull/109#discussion_r187023109","pull_request_url":"https://api.github.com/repos/QuantStack/xsimd/pulls/109","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/QuantStack/xsimd/pulls/comments/187023109"},"html":{"href":"https://github.com/QuantStack/xsimd/pull/109#discussion_r187023109"},"pull_request":{"href":"https://api.github.com/repos/QuantStack/xsimd/pulls/109"}},"in_reply_to_id":186993819},"pull_request":{"url":"https://api.github.com/repos/QuantStack/xsimd/pulls/109","id":186415137,"html_url":"https://github.com/QuantStack/xsimd/pull/109","diff_url":"https://github.com/QuantStack/xsimd/pull/109.diff","patch_url":"https://github.com/QuantStack/xsimd/pull/109.patch","issue_url":"https://api.github.com/repos/QuantStack/xsimd/issues/109","number":109,"state":"open","locked":false,"title":"WIP shuffling interleave etc","user":{"login":"wolfv","id":885054,"avatar_url":"https://avatars0.githubusercontent.com/u/885054?v=4","gravatar_id":"","url":"https://api.github.com/users/wolfv","html_url":"https://github.com/wolfv","followers_url":"https://api.github.com/users/wolfv/followers","following_url":"https://api.github.com/users/wolfv/following{/other_user}","gists_url":"https://api.github.com/users/wolfv/gists{/gist_id}","starred_url":"https://api.github.com/users/wolfv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolfv/subscriptions","organizations_url":"https://api.github.com/users/wolfv/orgs","repos_url":"https://api.github.com/users/wolfv/repos","events_url":"https://api.github.com/users/wolfv/events{/privacy}","received_events_url":"https://api.github.com/users/wolfv/received_events","type":"User","site_admin":false},"body":"@HadrienG2 I opened this PR because I thought you might be interested.\r\n\r\nThis adds the select stuff we've been talking about and also an initial interleave.\r\nI really like the explicitness of the interleave with the AbCc... syntax, although it might be quite a lot of typing for some.","created_at":"2018-05-07T17:39:24Z","updated_at":"2018-05-09T12:29:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"81585205ec5ec2f56cef596d447e37f714e587da","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/QuantStack/xsimd/pulls/109/commits","review_comments_url":"https://api.github.com/repos/QuantStack/xsimd/pulls/109/comments","review_comment_url":"https://api.github.com/repos/QuantStack/xsimd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/QuantStack/xsimd/issues/109/comments","statuses_url":"https://api.github.com/repos/QuantStack/xsimd/statuses/4a81c17b23b1bc12eb73adb23ca8a5206c21a848","head":{"label":"wolfv:select_interleave_permute_shuffle","ref":"select_interleave_permute_shuffle","sha":"4a81c17b23b1bc12eb73adb23ca8a5206c21a848","user":{"login":"wolfv","id":885054,"avatar_url":"https://avatars0.githubusercontent.com/u/885054?v=4","gravatar_id":"","url":"https://api.github.com/users/wolfv","html_url":"https://github.com/wolfv","followers_url":"https://api.github.com/users/wolfv/followers","following_url":"https://api.github.com/users/wolfv/following{/other_user}","gists_url":"https://api.github.com/users/wolfv/gists{/gist_id}","starred_url":"https://api.github.com/users/wolfv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolfv/subscriptions","organizations_url":"https://api.github.com/users/wolfv/orgs","repos_url":"https://api.github.com/users/wolfv/repos","events_url":"https://api.github.com/users/wolfv/events{/privacy}","received_events_url":"https://api.github.com/users/wolfv/received_events","type":"User","site_admin":false},"repo":{"id":94807761,"name":"xsimd","full_name":"wolfv/xsimd","owner":{"login":"wolfv","id":885054,"avatar_url":"https://avatars0.githubusercontent.com/u/885054?v=4","gravatar_id":"","url":"https://api.github.com/users/wolfv","html_url":"https://github.com/wolfv","followers_url":"https://api.github.com/users/wolfv/followers","following_url":"https://api.github.com/users/wolfv/following{/other_user}","gists_url":"https://api.github.com/users/wolfv/gists{/gist_id}","starred_url":"https://api.github.com/users/wolfv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolfv/subscriptions","organizations_url":"https://api.github.com/users/wolfv/orgs","repos_url":"https://api.github.com/users/wolfv/repos","events_url":"https://api.github.com/users/wolfv/events{/privacy}","received_events_url":"https://api.github.com/users/wolfv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wolfv/xsimd","description":"C++ wrappers for SIMD intrinsics","fork":true,"url":"https://api.github.com/repos/wolfv/xsimd","forks_url":"https://api.github.com/repos/wolfv/xsimd/forks","keys_url":"https://api.github.com/repos/wolfv/xsimd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wolfv/xsimd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wolfv/xsimd/teams","hooks_url":"https://api.github.com/repos/wolfv/xsimd/hooks","issue_events_url":"https://api.github.com/repos/wolfv/xsimd/issues/events{/number}","events_url":"https://api.github.com/repos/wolfv/xsimd/events","assignees_url":"https://api.github.com/repos/wolfv/xsimd/assignees{/user}","branches_url":"https://api.github.com/repos/wolfv/xsimd/branches{/branch}","tags_url":"https://api.github.com/repos/wolfv/xsimd/tags","blobs_url":"https://api.github.com/repos/wolfv/xsimd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wolfv/xsimd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wolfv/xsimd/git/refs{/sha}","trees_url":"https://api.github.com/repos/wolfv/xsimd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wolfv/xsimd/statuses/{sha}","languages_url":"https://api.github.com/repos/wolfv/xsimd/languages","stargazers_url":"https://api.github.com/repos/wolfv/xsimd/stargazers","contributors_url":"https://api.github.com/repos/wolfv/xsimd/contributors","subscribers_url":"https://api.github.com/repos/wolfv/xsimd/subscribers","subscription_url":"https://api.github.com/repos/wolfv/xsimd/subscription","commits_url":"https://api.github.com/repos/wolfv/xsimd/commits{/sha}","git_commits_url":"https://api.github.com/repos/wolfv/xsimd/git/commits{/sha}","comments_url":"https://api.github.com/repos/wolfv/xsimd/comments{/number}","issue_comment_url":"https://api.github.com/repos/wolfv/xsimd/issues/comments{/number}","contents_url":"https://api.github.com/repos/wolfv/xsimd/contents/{+path}","compare_url":"https://api.github.com/repos/wolfv/xsimd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wolfv/xsimd/merges","archive_url":"https://api.github.com/repos/wolfv/xsimd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wolfv/xsimd/downloads","issues_url":"https://api.github.com/repos/wolfv/xsimd/issues{/number}","pulls_url":"https://api.github.com/repos/wolfv/xsimd/pulls{/number}","milestones_url":"https://api.github.com/repos/wolfv/xsimd/milestones{/number}","notifications_url":"https://api.github.com/repos/wolfv/xsimd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wolfv/xsimd/labels{/name}","releases_url":"https://api.github.com/repos/wolfv/xsimd/releases{/id}","deployments_url":"https://api.github.com/repos/wolfv/xsimd/deployments","created_at":"2017-06-19T18:22:45Z","updated_at":"2017-06-19T18:22:47Z","pushed_at":"2018-05-07T17:48:47Z","git_url":"git://github.com/wolfv/xsimd.git","ssh_url":"git@github.com:wolfv/xsimd.git","clone_url":"https://github.com/wolfv/xsimd.git","svn_url":"https://github.com/wolfv/xsimd","homepage":null,"size":482,"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":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"QuantStack:master","ref":"master","sha":"d0149615b04910bace28d805ba04706c1df294ce","user":{"login":"QuantStack","id":19627246,"avatar_url":"https://avatars1.githubusercontent.com/u/19627246?v=4","gravatar_id":"","url":"https://api.github.com/users/QuantStack","html_url":"https://github.com/QuantStack","followers_url":"https://api.github.com/users/QuantStack/followers","following_url":"https://api.github.com/users/QuantStack/following{/other_user}","gists_url":"https://api.github.com/users/QuantStack/gists{/gist_id}","starred_url":"https://api.github.com/users/QuantStack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuantStack/subscriptions","organizations_url":"https://api.github.com/users/QuantStack/orgs","repos_url":"https://api.github.com/users/QuantStack/repos","events_url":"https://api.github.com/users/QuantStack/events{/privacy}","received_events_url":"https://api.github.com/users/QuantStack/received_events","type":"Organization","site_admin":false},"repo":{"id":52121329,"name":"xsimd","full_name":"QuantStack/xsimd","owner":{"login":"QuantStack","id":19627246,"avatar_url":"https://avatars1.githubusercontent.com/u/19627246?v=4","gravatar_id":"","url":"https://api.github.com/users/QuantStack","html_url":"https://github.com/QuantStack","followers_url":"https://api.github.com/users/QuantStack/followers","following_url":"https://api.github.com/users/QuantStack/following{/other_user}","gists_url":"https://api.github.com/users/QuantStack/gists{/gist_id}","starred_url":"https://api.github.com/users/QuantStack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuantStack/subscriptions","organizations_url":"https://api.github.com/users/QuantStack/orgs","repos_url":"https://api.github.com/users/QuantStack/repos","events_url":"https://api.github.com/users/QuantStack/events{/privacy}","received_events_url":"https://api.github.com/users/QuantStack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/QuantStack/xsimd","description":"C++ wrappers for SIMD intrinsics and parallelized, optimized math implementations","fork":false,"url":"https://api.github.com/repos/QuantStack/xsimd","forks_url":"https://api.github.com/repos/QuantStack/xsimd/forks","keys_url":"https://api.github.com/repos/QuantStack/xsimd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/QuantStack/xsimd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/QuantStack/xsimd/teams","hooks_url":"https://api.github.com/repos/QuantStack/xsimd/hooks","issue_events_url":"https://api.github.com/repos/QuantStack/xsimd/issues/events{/number}","events_url":"https://api.github.com/repos/QuantStack/xsimd/events","assignees_url":"https://api.github.com/repos/QuantStack/xsimd/assignees{/user}","branches_url":"https://api.github.com/repos/QuantStack/xsimd/branches{/branch}","tags_url":"https://api.github.com/repos/QuantStack/xsimd/tags","blobs_url":"https://api.github.com/repos/QuantStack/xsimd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/QuantStack/xsimd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/QuantStack/xsimd/git/refs{/sha}","trees_url":"https://api.github.com/repos/QuantStack/xsimd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/QuantStack/xsimd/statuses/{sha}","languages_url":"https://api.github.com/repos/QuantStack/xsimd/languages","stargazers_url":"https://api.github.com/repos/QuantStack/xsimd/stargazers","contributors_url":"https://api.github.com/repos/QuantStack/xsimd/contributors","subscribers_url":"https://api.github.com/repos/QuantStack/xsimd/subscribers","subscription_url":"https://api.github.com/repos/QuantStack/xsimd/subscription","commits_url":"https://api.github.com/repos/QuantStack/xsimd/commits{/sha}","git_commits_url":"https://api.github.com/repos/QuantStack/xsimd/git/commits{/sha}","comments_url":"https://api.github.com/repos/QuantStack/xsimd/comments{/number}","issue_comment_url":"https://api.github.com/repos/QuantStack/xsimd/issues/comments{/number}","contents_url":"https://api.github.com/repos/QuantStack/xsimd/contents/{+path}","compare_url":"https://api.github.com/repos/QuantStack/xsimd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/QuantStack/xsimd/merges","archive_url":"https://api.github.com/repos/QuantStack/xsimd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/QuantStack/xsimd/downloads","issues_url":"https://api.github.com/repos/QuantStack/xsimd/issues{/number}","pulls_url":"https://api.github.com/repos/QuantStack/xsimd/pulls{/number}","milestones_url":"https://api.github.com/repos/QuantStack/xsimd/milestones{/number}","notifications_url":"https://api.github.com/repos/QuantStack/xsimd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/QuantStack/xsimd/labels{/name}","releases_url":"https://api.github.com/repos/QuantStack/xsimd/releases{/id}","deployments_url":"https://api.github.com/repos/QuantStack/xsimd/deployments","created_at":"2016-02-19T22:41:39Z","updated_at":"2018-05-09T03:12:24Z","pushed_at":"2018-05-09T09:38:14Z","git_url":"git://github.com/QuantStack/xsimd.git","ssh_url":"git@github.com:QuantStack/xsimd.git","clone_url":"https://github.com/QuantStack/xsimd.git","svn_url":"https://github.com/QuantStack/xsimd","homepage":"","size":471,"stargazers_count":139,"watchers_count":139,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":16,"open_issues":15,"watchers":139,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/QuantStack/xsimd/pulls/109"},"html":{"href":"https://github.com/QuantStack/xsimd/pull/109"},"issue":{"href":"https://api.github.com/repos/QuantStack/xsimd/issues/109"},"comments":{"href":"https://api.github.com/repos/QuantStack/xsimd/issues/109/comments"},"review_comments":{"href":"https://api.github.com/repos/QuantStack/xsimd/pulls/109/comments"},"review_comment":{"href":"https://api.github.com/repos/QuantStack/xsimd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/QuantStack/xsimd/pulls/109/commits"},"statuses":{"href":"https://api.github.com/repos/QuantStack/xsimd/statuses/4a81c17b23b1bc12eb73adb23ca8a5206c21a848"}},"author_association":"OWNER"}}
{"actor":{"display_login":"wolfv"}}