zuochunwei commented on a change in pull request #8042:
URL: https://github.com/apache/incubator-doris/pull/8042#discussion_r805560855



##########
File path: be/src/service/doris_main.cpp
##########
@@ -74,6 +78,194 @@ static void thrift_output(const char* x) {
 
 } // namespace doris
 
+// These code is referenced from clickhouse
+// It is used to check the SIMD instructions
+enum class InstructionFail
+{
+    NONE = 0,
+    SSE3 = 1,
+    SSSE3 = 2,
+    SSE4_1 = 3,
+    SSE4_2 = 4,
+    POPCNT = 5,
+    AVX = 6,
+    AVX2 = 7,
+    AVX512 = 8
+};
+
+#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
+
+auto instruction_fail_to_string(InstructionFail fail)
+{
+    switch (fail)
+    {
+#define ret(x) return std::make_tuple(STDERR_FILENO, x, ARRAY_SIZE(x) - 1)
+        case InstructionFail::NONE:
+            ret("NONE");
+        case InstructionFail::SSE3:
+            ret("SSE3");
+        case InstructionFail::SSSE3:
+            ret("SSSE3");
+        case InstructionFail::SSE4_1:
+            ret("SSE4.1");
+        case InstructionFail::SSE4_2:
+            ret("SSE4.2");
+        case InstructionFail::POPCNT:
+            ret("POPCNT");
+        case InstructionFail::AVX:
+            ret("AVX");
+        case InstructionFail::AVX2:
+            ret("AVX2");
+        case InstructionFail::AVX512:
+            ret("AVX512");
+    }
+    __builtin_unreachable();
+}
+
+
+sigjmp_buf jmpbuf;
+
+[[noreturn]] void sig_ill_check_handler(int, siginfo_t *, void *)

Review comment:
       noreturn主要用来抑制警告:即声明为非void返回类型,并非在所有路径都有return语句。




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to