cyb70289 commented on a change in pull request #9657:
URL: https://github.com/apache/arrow/pull/9657#discussion_r590136872



##########
File path: cpp/src/arrow/util/cpu_info.cc
##########
@@ -330,6 +346,29 @@ void CpuInfo::Init() {
   if (QueryPerformanceFrequency(&performance_frequency)) {
     max_mhz = static_cast<float>(performance_frequency.QuadPart);
   }
+#elif defined(__APPLE__)
+  // On macOS, get CPU information from system information base
+  struct SysCtlCpuFeature {
+    const char* name;
+    int64_t flag;
+  };
+  for (auto feature : std::vector<SysCtlCpuFeature>{
+           {"hw.optional.sse4_2", SSSE3 | SSE4_1 | SSE4_2 | POPCNT},
+           {"hw.optional.avx1_0", AVX},
+           {"hw.optional.avx2_0", AVX2},
+           {"hw.optional.bmi1", BMI1},
+           {"hw.optional.bmi2", BMI2},
+           {"hw.optional.avx512f", AVX512F},
+           {"hw.optional.avx512cd", AVX512CD},
+           {"hw.optional.avx512dq", AVX512DQ},
+           {"hw.optional.avx512bw", AVX512BW},
+           {"hw.optional.avx512vl", AVX512VL},

Review comment:
       Per my knowledge, `NEON` exists since 32 bit Arm, and `ASIMD` extends it 
to 64 bit system, with additional instructions and wider registers. `ASIMD` 
should be the correct term for Arm64 world, but obviously `NEON` is well known 
and widely used.




----------------------------------------------------------------
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.

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


Reply via email to