This is an automated email from the ASF dual-hosted git repository.

zykkk pushed a commit to branch clucene
in repository https://gitbox.apache.org/repos/asf/doris-thirdparty.git


The following commit(s) were added to refs/heads/clucene by this push:
     new 2761b1af [Fix](PFOR) fix build error in arm (#120)
2761b1af is described below

commit 2761b1afe48cb1bd272ce8959e3aa3049b6e63ac
Author: airborne12 <[email protected]>
AuthorDate: Sat Sep 9 13:29:03 2023 +0800

    [Fix](PFOR) fix build error in arm (#120)
---
 src/core/CLucene/util/PFORUtil.cpp | 5 ++++-
 src/core/CLucene/util/PFORUtil.h   | 1 -
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/core/CLucene/util/PFORUtil.cpp 
b/src/core/CLucene/util/PFORUtil.cpp
index eaf628c7..a9a32dfb 100644
--- a/src/core/CLucene/util/PFORUtil.cpp
+++ b/src/core/CLucene/util/PFORUtil.cpp
@@ -16,6 +16,9 @@
 // under the License.
 #include "PFORUtil.h"
 #include "vp4.h"
+#if (defined(__i386) || defined(__x86_64__))
+#include <cpuid.h>
+#endif
 
 namespace {
 using DEC_FUNC = size_t (*)(unsigned char *__restrict, size_t, uint32_t 
*__restrict);
@@ -27,12 +30,12 @@ ENC_FUNC g_p4nzenc;
 } // anonymous namespace
 
 __attribute__((constructor)) void SelectPFORFunctions() {
+#if (defined(__i386) || defined(__x86_64__))
     uint32_t eax, ebx, ecx, edx;
     __cpuid(1, eax, ebx, ecx, edx);
 
     bool sse2 = (edx & bit_SSE2) != 0;
     bool sse42 = (ecx & bit_SSE4_2) != 0;
-#if (defined(__i386) || defined(__x86_64__))
 #if defined(USE_AVX2)
     g_p4nd1dec = p4nd1dec256v32;
     g_p4nzdec = p4nzdec256v32;
diff --git a/src/core/CLucene/util/PFORUtil.h b/src/core/CLucene/util/PFORUtil.h
index 5ba664aa..29acb7fe 100644
--- a/src/core/CLucene/util/PFORUtil.h
+++ b/src/core/CLucene/util/PFORUtil.h
@@ -18,7 +18,6 @@
 
 #include <cstddef>
 #include <cstdint>
-#include <cpuid.h>
 
 size_t P4DEC(unsigned char *__restrict in, size_t n, uint32_t *__restrict out);
 size_t P4NZDEC(unsigned char *__restrict in, size_t n, uint32_t *__restrict 
out);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to