Skip to content

Commit

Permalink
[opt](arm)Remove negative optimizations of SSE2NEON on memcmp for ARM… (
Browse files Browse the repository at this point in the history
apache#43510)

… (apache#38759)
apache#38759
The main issue is that _mm_movemask_epi8 does not have a one-to-one
corresponding instruction on ARM. Testing shows that it performs worse
compared to using memcmp, which allows the compiler to generate the
corresponding ARM instructions.
The following tests were conducted on ARM.
```
--------------------------------------------------------------
Benchmark                    Time             CPU   Iterations
--------------------------------------------------------------
BM_memequal16_sse         3.77 ns         3.77 ns    743238946
BM_memequal16_orgin       2.11 ns         2.11 ns   1000000000
```
  • Loading branch information
Mryange authored Nov 10, 2024
1 parent 91eb8f8 commit 138103f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion be/src/vec/common/memcmp_small.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int cmp(T a, T b) {
/// Results don't depend on the values inside uninitialized memory but Memory Sanitizer cannot see it.
/// Disable optimized functions if compile with Memory Sanitizer.

#if (defined(__SSE2__) || defined(__aarch64__)) && !defined(MEMORY_SANITIZER)
#if (defined(__SSE2__) && !defined(__aarch64__)) && !defined(MEMORY_SANITIZER)
#include "util/sse_util.hpp"

/** All functions works under the following assumptions:
Expand Down

0 comments on commit 138103f

Please sign in to comment.