Skip to content

Commit 2fe5644

Browse files
committed
not use no_memmove for arm64
1 parent 3dd9bb8 commit 2fe5644

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

bench/xjb/float_to_string/ftoa.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
# define XJB_NO_MEMMOVE 0
105105
# elif XJB_USE_NEON
106106
// On other aarch64 implementations the performance characteristics of memmove may differ.
107-
# define XJB_NO_MEMMOVE 1
107+
# define XJB_NO_MEMMOVE 0
108108
# else
109109
# define XJB_NO_MEMMOVE 0
110110
# endif

bench/xjb/perf/main.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const u64 N = (1ull << 25); // data size
2424
#else
2525
double *data;
2626
#endif
27-
u64 get_cycle()
27+
static u64 get_cycle()
2828
{
2929
#ifdef __amd64__
3030
uint64_t low, high;
@@ -34,13 +34,13 @@ u64 get_cycle()
3434
return 0;
3535
#endif
3636
}
37-
auto getns()
37+
static auto getns()
3838
{
3939
auto now = std::chrono::high_resolution_clock::now();
4040
auto nanos = std::chrono::duration_cast<std::chrono::nanoseconds>(now.time_since_epoch()).count();
4141
return nanos;
4242
}
43-
double gen_double_filter_NaN_Inf()
43+
static double gen_double_filter_NaN_Inf()
4444
{
4545
unsigned long long rnd,rnd_abs;
4646
do{
@@ -50,7 +50,7 @@ double gen_double_filter_NaN_Inf()
5050
while (rnd_abs >= (0x7ffull << 52)); // nan or inf
5151
return *(double *)&rnd;
5252
}
53-
double gen_double_filter_NaN_Inf_subnormal()
53+
static double gen_double_filter_NaN_Inf_subnormal()
5454
{
5555
unsigned long long rnd,rnd_abs;
5656
do{
@@ -60,7 +60,7 @@ double gen_double_filter_NaN_Inf_subnormal()
6060
while (rnd_abs >= (0x7ffull << 52) && rnd_abs < (1ull << 52) ); // nan or inf or subnormal
6161
return *(double *)&rnd;
6262
}
63-
float gen_float_filter_NaN_Inf()
63+
static float gen_float_filter_NaN_Inf()
6464
{
6565
unsigned int rnd,rnd_abs;
6666
do{
@@ -70,7 +70,7 @@ float gen_float_filter_NaN_Inf()
7070
while (rnd_abs >= (0xffu << 23)); // nan or inf
7171
return *(float *)&rnd;
7272
}
73-
float gen_float_filter_NaN_Inf_subnormal()
73+
static float gen_float_filter_NaN_Inf_subnormal()
7474
{
7575
unsigned int rnd,rnd_abs;
7676
do{
@@ -80,7 +80,7 @@ float gen_float_filter_NaN_Inf_subnormal()
8080
while (rnd_abs >= (0xffu << 23) && rnd_abs < (1u << 23) ); // nan or inf or subnormal
8181
return *(float *)&rnd;
8282
}
83-
void init_data()
83+
static void init_data()
8484
{
8585
#if PERF_DOUBLE_OR_FLOAT == FLOAT
8686
data = new float[N];

bench/xjb/perf/makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ cp:
4545
sudo perf stat -d ./main_c
4646
# /////////////////////////////
4747

48-
49-
50-
48+
mca: # machine code analysis
49+
clang++ -O3 -std=c++20 ../float_to_string/ftoa.cpp -S -o ftoa.s -march=native
50+
llvm-mca -march=aarch64 --all-stats ./ftoa.s > mca.txt --iterations=1000 --timeline --bottleneck-analysis
5151

5252
# generate assembly code
5353
# /////////////////////////////

src/ftoa.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
# define XJB_NO_MEMMOVE 0
105105
# elif XJB_USE_NEON
106106
// On other aarch64 implementations the performance characteristics of memmove may differ.
107-
# define XJB_NO_MEMMOVE 1
107+
# define XJB_NO_MEMMOVE 0
108108
# else
109109
# define XJB_NO_MEMMOVE 0
110110
# endif

0 commit comments

Comments
 (0)