{"action":"created","comment":{"url":"https://api.github.com/repos/scality/quadiron/pulls/comments/225581961","pull_request_review_id":165212676,"id":225581961,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNTU4MTk2MQ==","diff_hunk":"@@ -0,0 +1,124 @@\n+/*\n+ * Copyright 2017-2018 Scality\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ *\n+ * 1. Redistributions of source code must retain the above copyright notice,\n+ *    this list of conditions and the following disclaimer.\n+ *\n+ * 2. Redistributions in binary form must reproduce the above copyright notice,\n+ *    this list of conditions and the following disclaimer in the documentation\n+ *    and/or other materials provided with the distribution.\n+ *\n+ * 3. Neither the name of the copyright holder nor the names of its contributors\n+ *    may be used to endorse or promote products derived from this software\n+ *    without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+/** @file definitions.h\n+ *\n+ * Provide includes and constants that are platform-specific.\n+ */\n+\n+#ifndef __QUAD_SIMD_SIMD_DEFINITIONS_H__\n+#define __QUAD_SIMD_SIMD_DEFINITIONS_H__\n+\n+#include <climits>\n+#include <cstdint>\n+\n+// SIMD-specific includes {{{\n+\n+#ifdef QUADIRON_USE_SIMD\n+\n+// SIMD for x86 and x86_64\n+#if defined(__i386__) || defined(__x86_64__)\n+#include <x86intrin.h>\n+#endif\n+\n+// SIMD for ARM\n+#if defined(__ARM_NEON)\n+#include <arm_neon.h>\n+#endif\n+\n+#endif\n+\n+// }}}\n+\n+namespace quadiron {\n+namespace simd {\n+\n+/// Supported instruction set.\n+enum class InstructionSet {\n+    NONE, ///< No SIMD instruction (fallback).\n+    SSE,  ///< SSE4.1\n+    AVX,  ///< AVX2\n+};\n+\n+// Definitions for Intel AVX-256 {{{\n+\n+// We required AVX2 because we relies on some instructions (such as\n+// `_mm256_add_epi16` and others) that aren't available in the first version of\n+// AVX.\n+#if defined(__AVX__) && defined(__AVX2__)\n+\n+using RegisterType = __m256;\n+using MaskType = __m256i;\n+\n+static constexpr InstructionSet INSTRUCTION_SET = InstructionSet::AVX;\n+\n+// }}}\n+// Definitions for Intel SSE {{{\n+\n+#elif defined(__SSE__) && defined(__SSE4_1__)\n+\n+using RegisterType = __m128;\n+using MaskType = __m128i;\n+\n+static constexpr InstructionSet INSTRUCTION_SET = InstructionSet::SSE;\n+\n+// }}}\n+// Definitions for scalar fallback {{{","path":"src/simd/definitions.h","position":93,"original_position":93,"commit_id":"83e2bec3f28251017566aec5c6136e6a97161eb3","original_commit_id":"7ce4d386bb3e3e4c44bf69c650235f00cb4ff2e8","user":{"login":"lamphamsy","id":14222406,"node_id":"MDQ6VXNlcjE0MjIyNDA2","avatar_url":"https://avatars0.githubusercontent.com/u/14222406?v=4","gravatar_id":"","url":"https://api.github.com/users/lamphamsy","html_url":"https://github.com/lamphamsy","followers_url":"https://api.github.com/users/lamphamsy/followers","following_url":"https://api.github.com/users/lamphamsy/following{/other_user}","gists_url":"https://api.github.com/users/lamphamsy/gists{/gist_id}","starred_url":"https://api.github.com/users/lamphamsy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lamphamsy/subscriptions","organizations_url":"https://api.github.com/users/lamphamsy/orgs","repos_url":"https://api.github.com/users/lamphamsy/repos","events_url":"https://api.github.com/users/lamphamsy/events{/privacy}","received_events_url":"https://api.github.com/users/lamphamsy/received_events","type":"User","site_admin":false},"body":"Yes, it looks good. It looks similar what https://github.com/QuantStack/xsimd does\r\nBTW, in my PR #254, all 5 functions are combined in a templated one. There are still only wrappers of SIMD operations and basic operations that depend on register type and 16/32-bit packed elements","created_at":"2018-10-16T15:06:51Z","updated_at":"2018-10-16T15:06:52Z","html_url":"https://github.com/scality/quadiron/pull/255#discussion_r225581961","pull_request_url":"https://api.github.com/repos/scality/quadiron/pulls/255","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/scality/quadiron/pulls/comments/225581961"},"html":{"href":"https://github.com/scality/quadiron/pull/255#discussion_r225581961"},"pull_request":{"href":"https://api.github.com/repos/scality/quadiron/pulls/255"}},"in_reply_to_id":225497635},"pull_request":{"url":"https://api.github.com/repos/scality/quadiron/pulls/255","id":223088842,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzMDg4ODQy","html_url":"https://github.com/scality/quadiron/pull/255","diff_url":"https://github.com/scality/quadiron/pull/255.diff","patch_url":"https://github.com/scality/quadiron/pull/255.patch","issue_url":"https://api.github.com/repos/scality/quadiron/issues/255","number":255,"state":"open","locked":false,"title":"Bootstrap the new SIMD module","user":{"login":"slaperche-scality","id":34654278,"node_id":"MDQ6VXNlcjM0NjU0Mjc4","avatar_url":"https://avatars0.githubusercontent.com/u/34654278?v=4","gravatar_id":"","url":"https://api.github.com/users/slaperche-scality","html_url":"https://github.com/slaperche-scality","followers_url":"https://api.github.com/users/slaperche-scality/followers","following_url":"https://api.github.com/users/slaperche-scality/following{/other_user}","gists_url":"https://api.github.com/users/slaperche-scality/gists{/gist_id}","starred_url":"https://api.github.com/users/slaperche-scality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slaperche-scality/subscriptions","organizations_url":"https://api.github.com/users/slaperche-scality/orgs","repos_url":"https://api.github.com/users/slaperche-scality/repos","events_url":"https://api.github.com/users/slaperche-scality/events{/privacy}","received_events_url":"https://api.github.com/users/slaperche-scality/received_events","type":"User","site_admin":false},"body":"This PR just lay the foundation for the new SIMD module, the biggest part will come in the next PR.\r\n\r\nThat being said, here we defines the basic constants and helpers, as well as a custom allocator.","created_at":"2018-10-16T01:29:07Z","updated_at":"2018-10-16T15:06:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fef4a089c768afee3babd7e80cf4b805cbb0c1f4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/scality/quadiron/pulls/255/commits","review_comments_url":"https://api.github.com/repos/scality/quadiron/pulls/255/comments","review_comment_url":"https://api.github.com/repos/scality/quadiron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scality/quadiron/issues/255/comments","statuses_url":"https://api.github.com/repos/scality/quadiron/statuses/83e2bec3f28251017566aec5c6136e6a97161eb3","head":{"label":"slaperche-scality:eh/bootstrap_new_simd_api","ref":"eh/bootstrap_new_simd_api","sha":"83e2bec3f28251017566aec5c6136e6a97161eb3","user":{"login":"slaperche-scality","id":34654278,"node_id":"MDQ6VXNlcjM0NjU0Mjc4","avatar_url":"https://avatars0.githubusercontent.com/u/34654278?v=4","gravatar_id":"","url":"https://api.github.com/users/slaperche-scality","html_url":"https://github.com/slaperche-scality","followers_url":"https://api.github.com/users/slaperche-scality/followers","following_url":"https://api.github.com/users/slaperche-scality/following{/other_user}","gists_url":"https://api.github.com/users/slaperche-scality/gists{/gist_id}","starred_url":"https://api.github.com/users/slaperche-scality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slaperche-scality/subscriptions","organizations_url":"https://api.github.com/users/slaperche-scality/orgs","repos_url":"https://api.github.com/users/slaperche-scality/repos","events_url":"https://api.github.com/users/slaperche-scality/events{/privacy}","received_events_url":"https://api.github.com/users/slaperche-scality/received_events","type":"User","site_admin":false},"repo":{"id":120944925,"node_id":"MDEwOlJlcG9zaXRvcnkxMjA5NDQ5MjU=","name":"quadiron","full_name":"slaperche-scality/quadiron","private":false,"owner":{"login":"slaperche-scality","id":34654278,"node_id":"MDQ6VXNlcjM0NjU0Mjc4","avatar_url":"https://avatars0.githubusercontent.com/u/34654278?v=4","gravatar_id":"","url":"https://api.github.com/users/slaperche-scality","html_url":"https://github.com/slaperche-scality","followers_url":"https://api.github.com/users/slaperche-scality/followers","following_url":"https://api.github.com/users/slaperche-scality/following{/other_user}","gists_url":"https://api.github.com/users/slaperche-scality/gists{/gist_id}","starred_url":"https://api.github.com/users/slaperche-scality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slaperche-scality/subscriptions","organizations_url":"https://api.github.com/users/slaperche-scality/orgs","repos_url":"https://api.github.com/users/slaperche-scality/repos","events_url":"https://api.github.com/users/slaperche-scality/events{/privacy}","received_events_url":"https://api.github.com/users/slaperche-scality/received_events","type":"User","site_admin":false},"html_url":"https://github.com/slaperche-scality/quadiron","description":"NTT Based Erasure Coding Library","fork":true,"url":"https://api.github.com/repos/slaperche-scality/quadiron","forks_url":"https://api.github.com/repos/slaperche-scality/quadiron/forks","keys_url":"https://api.github.com/repos/slaperche-scality/quadiron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slaperche-scality/quadiron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slaperche-scality/quadiron/teams","hooks_url":"https://api.github.com/repos/slaperche-scality/quadiron/hooks","issue_events_url":"https://api.github.com/repos/slaperche-scality/quadiron/issues/events{/number}","events_url":"https://api.github.com/repos/slaperche-scality/quadiron/events","assignees_url":"https://api.github.com/repos/slaperche-scality/quadiron/assignees{/user}","branches_url":"https://api.github.com/repos/slaperche-scality/quadiron/branches{/branch}","tags_url":"https://api.github.com/repos/slaperche-scality/quadiron/tags","blobs_url":"https://api.github.com/repos/slaperche-scality/quadiron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slaperche-scality/quadiron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slaperche-scality/quadiron/git/refs{/sha}","trees_url":"https://api.github.com/repos/slaperche-scality/quadiron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slaperche-scality/quadiron/statuses/{sha}","languages_url":"https://api.github.com/repos/slaperche-scality/quadiron/languages","stargazers_url":"https://api.github.com/repos/slaperche-scality/quadiron/stargazers","contributors_url":"https://api.github.com/repos/slaperche-scality/quadiron/contributors","subscribers_url":"https://api.github.com/repos/slaperche-scality/quadiron/subscribers","subscription_url":"https://api.github.com/repos/slaperche-scality/quadiron/subscription","commits_url":"https://api.github.com/repos/slaperche-scality/quadiron/commits{/sha}","git_commits_url":"https://api.github.com/repos/slaperche-scality/quadiron/git/commits{/sha}","comments_url":"https://api.github.com/repos/slaperche-scality/quadiron/comments{/number}","issue_comment_url":"https://api.github.com/repos/slaperche-scality/quadiron/issues/comments{/number}","contents_url":"https://api.github.com/repos/slaperche-scality/quadiron/contents/{+path}","compare_url":"https://api.github.com/repos/slaperche-scality/quadiron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slaperche-scality/quadiron/merges","archive_url":"https://api.github.com/repos/slaperche-scality/quadiron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slaperche-scality/quadiron/downloads","issues_url":"https://api.github.com/repos/slaperche-scality/quadiron/issues{/number}","pulls_url":"https://api.github.com/repos/slaperche-scality/quadiron/pulls{/number}","milestones_url":"https://api.github.com/repos/slaperche-scality/quadiron/milestones{/number}","notifications_url":"https://api.github.com/repos/slaperche-scality/quadiron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slaperche-scality/quadiron/labels{/name}","releases_url":"https://api.github.com/repos/slaperche-scality/quadiron/releases{/id}","deployments_url":"https://api.github.com/repos/slaperche-scality/quadiron/deployments","created_at":"2018-02-09T19:10:29Z","updated_at":"2018-10-09T12:49:29Z","pushed_at":"2018-10-16T13:15:35Z","git_url":"git://github.com/slaperche-scality/quadiron.git","ssh_url":"git@github.com:slaperche-scality/quadiron.git","clone_url":"https://github.com/slaperche-scality/quadiron.git","svn_url":"https://github.com/slaperche-scality/quadiron","homepage":"","size":1205,"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","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scality:master","ref":"master","sha":"816b6341f6cc26c7c536c8a400983c763d9b091e","user":{"login":"scality","id":383812,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MzgxMg==","avatar_url":"https://avatars1.githubusercontent.com/u/383812?v=4","gravatar_id":"","url":"https://api.github.com/users/scality","html_url":"https://github.com/scality","followers_url":"https://api.github.com/users/scality/followers","following_url":"https://api.github.com/users/scality/following{/other_user}","gists_url":"https://api.github.com/users/scality/gists{/gist_id}","starred_url":"https://api.github.com/users/scality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scality/subscriptions","organizations_url":"https://api.github.com/users/scality/orgs","repos_url":"https://api.github.com/users/scality/repos","events_url":"https://api.github.com/users/scality/events{/privacy}","received_events_url":"https://api.github.com/users/scality/received_events","type":"Organization","site_admin":false},"repo":{"id":91633566,"node_id":"MDEwOlJlcG9zaXRvcnk5MTYzMzU2Ng==","name":"quadiron","full_name":"scality/quadiron","private":false,"owner":{"login":"scality","id":383812,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MzgxMg==","avatar_url":"https://avatars1.githubusercontent.com/u/383812?v=4","gravatar_id":"","url":"https://api.github.com/users/scality","html_url":"https://github.com/scality","followers_url":"https://api.github.com/users/scality/followers","following_url":"https://api.github.com/users/scality/following{/other_user}","gists_url":"https://api.github.com/users/scality/gists{/gist_id}","starred_url":"https://api.github.com/users/scality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scality/subscriptions","organizations_url":"https://api.github.com/users/scality/orgs","repos_url":"https://api.github.com/users/scality/repos","events_url":"https://api.github.com/users/scality/events{/privacy}","received_events_url":"https://api.github.com/users/scality/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/scality/quadiron","description":"NTT Based Erasure Coding Library","fork":false,"url":"https://api.github.com/repos/scality/quadiron","forks_url":"https://api.github.com/repos/scality/quadiron/forks","keys_url":"https://api.github.com/repos/scality/quadiron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scality/quadiron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scality/quadiron/teams","hooks_url":"https://api.github.com/repos/scality/quadiron/hooks","issue_events_url":"https://api.github.com/repos/scality/quadiron/issues/events{/number}","events_url":"https://api.github.com/repos/scality/quadiron/events","assignees_url":"https://api.github.com/repos/scality/quadiron/assignees{/user}","branches_url":"https://api.github.com/repos/scality/quadiron/branches{/branch}","tags_url":"https://api.github.com/repos/scality/quadiron/tags","blobs_url":"https://api.github.com/repos/scality/quadiron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scality/quadiron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scality/quadiron/git/refs{/sha}","trees_url":"https://api.github.com/repos/scality/quadiron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scality/quadiron/statuses/{sha}","languages_url":"https://api.github.com/repos/scality/quadiron/languages","stargazers_url":"https://api.github.com/repos/scality/quadiron/stargazers","contributors_url":"https://api.github.com/repos/scality/quadiron/contributors","subscribers_url":"https://api.github.com/repos/scality/quadiron/subscribers","subscription_url":"https://api.github.com/repos/scality/quadiron/subscription","commits_url":"https://api.github.com/repos/scality/quadiron/commits{/sha}","git_commits_url":"https://api.github.com/repos/scality/quadiron/git/commits{/sha}","comments_url":"https://api.github.com/repos/scality/quadiron/comments{/number}","issue_comment_url":"https://api.github.com/repos/scality/quadiron/issues/comments{/number}","contents_url":"https://api.github.com/repos/scality/quadiron/contents/{+path}","compare_url":"https://api.github.com/repos/scality/quadiron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scality/quadiron/merges","archive_url":"https://api.github.com/repos/scality/quadiron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scality/quadiron/downloads","issues_url":"https://api.github.com/repos/scality/quadiron/issues{/number}","pulls_url":"https://api.github.com/repos/scality/quadiron/pulls{/number}","milestones_url":"https://api.github.com/repos/scality/quadiron/milestones{/number}","notifications_url":"https://api.github.com/repos/scality/quadiron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scality/quadiron/labels{/name}","releases_url":"https://api.github.com/repos/scality/quadiron/releases{/id}","deployments_url":"https://api.github.com/repos/scality/quadiron/deployments","created_at":"2017-05-18T00:59:21Z","updated_at":"2018-10-05T14:12:56Z","pushed_at":"2018-10-16T13:15:37Z","git_url":"git://github.com/scality/quadiron.git","ssh_url":"git@github.com:scality/quadiron.git","clone_url":"https://github.com/scality/quadiron.git","svn_url":"https://github.com/scality/quadiron","homepage":"","size":1402,"stargazers_count":8,"watchers_count":8,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":18,"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","node_id":"MDc6TGljZW5zZTU="},"forks":2,"open_issues":18,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scality/quadiron/pulls/255"},"html":{"href":"https://github.com/scality/quadiron/pull/255"},"issue":{"href":"https://api.github.com/repos/scality/quadiron/issues/255"},"comments":{"href":"https://api.github.com/repos/scality/quadiron/issues/255/comments"},"review_comments":{"href":"https://api.github.com/repos/scality/quadiron/pulls/255/comments"},"review_comment":{"href":"https://api.github.com/repos/scality/quadiron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scality/quadiron/pulls/255/commits"},"statuses":{"href":"https://api.github.com/repos/scality/quadiron/statuses/83e2bec3f28251017566aec5c6136e6a97161eb3"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"lamphamsy"}}