Skip to content

Commit

Permalink
chore: update macro define of SSE4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
catdogpandas committed Dec 17, 2024
1 parent 5f11f21 commit 2c8459f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
4 changes: 1 addition & 3 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ else ()
endif ()

if (NOT WITHSPL)
add_definitions(-D__EXCLUDE_SPL__)
else ()
add_definitions(-D__ENABLE_SSE4_2__)
add_definitions(-D__EXCLUDE_SSE4_2__)
endif()

# Default C/CXX flags.
Expand Down
4 changes: 2 additions & 2 deletions core/pipeline/plugin/PluginRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
#include "plugin/processor/inner/ProcessorSplitLogStringNative.h"
#include "plugin/processor/inner/ProcessorSplitMultilineLogStringNative.h"
#include "plugin/processor/inner/ProcessorTagNative.h"
#if defined(__linux__) && !defined(__ANDROID__) && !defined(__EXCLUDE_SPL__)
#if defined(__linux__) && !defined(__ANDROID__) && !defined(__EXCLUDE_SSE4_2__)
#include "plugin/processor/ProcessorSPL.h"
#endif

Expand Down Expand Up @@ -154,7 +154,7 @@ void PluginRegistry::LoadStaticPlugins() {
RegisterProcessorCreator(new StaticProcessorCreator<ProcessorFilterNative>());
RegisterProcessorCreator(new StaticProcessorCreator<ProcessorPromParseMetricNative>());
RegisterProcessorCreator(new StaticProcessorCreator<ProcessorPromRelabelMetricNative>());
#if defined(__linux__) && !defined(__ANDROID__) && !defined(__EXCLUDE_SPL__)
#if defined(__linux__) && !defined(__ANDROID__) && !defined(__EXCLUDE_SSE4_2__)
if (BOOL_FLAG(enable_processor_spl)) {
RegisterProcessorCreator(new StaticProcessorCreator<ProcessorSPL>());
}
Expand Down
6 changes: 3 additions & 3 deletions core/prometheus/labels/TextParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ bool TextParser::ParseLine(StringView line, MetricEvent& metricEvent) {

std::optional<size_t> TextParser::FindFirstLetter(const char* s, size_t len, char target) {
size_t res = 0;
#if defined(__ENABLE_SSE4_2__)
#if !defined(__EXCLUDE_SSE4_2__)
__m128i targetVec = _mm_set1_epi8(target);

while (res + 16 < len) {
Expand Down Expand Up @@ -106,7 +106,7 @@ std::optional<size_t> TextParser::FindFirstLetter(const char* s, size_t len, cha
std::optional<size_t> TextParser::FindFirstWhiteSpace(const char* s, size_t len) {
size_t res = 0;

#if defined(__ENABLE_SSE4_2__)
#if !defined(__EXCLUDE_SSE4_2__)
static __m128i sTargetVec1 = _mm_set1_epi8(' ');
static __m128i sTargetVec2 = _mm_set1_epi8('\t');

Expand Down Expand Up @@ -142,7 +142,7 @@ std::optional<size_t> TextParser::FindFirstWhiteSpace(const char* s, size_t len)
std::optional<size_t> TextParser::FindWhiteSpaceAndExemplar(const char* s, size_t len) {
size_t res = 0;

#if defined(__ENABLE_SSE4_2__)
#if !defined(__EXCLUDE_SSE4_2__)
static __m128i sTargetVec1 = _mm_set1_epi8(' ');
static __m128i sTargetVec2 = _mm_set1_epi8('\t');
static __m128i sTargetVec3 = _mm_set1_epi8('#');
Expand Down
2 changes: 1 addition & 1 deletion core/unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ if (UNIX)
endif()
# add core subdir
set(UT_BASE_TARGET "unittest_base")
add_definitions(-D__EXCLUDE_SPL__)
add_definitions(-D__EXCLUDE_SSE4_2__)
add_library(${UT_BASE_TARGET} SHARED ${SOURCE_FILES_CORE})
target_compile_options(${UT_BASE_TARGET} PRIVATE -Werror)
add_core_subdir()
Expand Down

0 comments on commit 2c8459f

Please sign in to comment.