diff --git a/cmake/ConfigureCompiler.cmake b/cmake/ConfigureCompiler.cmake index 5be685b34f..1c37e8930f 100644 --- a/cmake/ConfigureCompiler.cmake +++ b/cmake/ConfigureCompiler.cmake @@ -255,6 +255,7 @@ else() if (GCC) add_compile_options(-Wno-pragmas) add_compile_options(-mavx) +# add_compile_options(-fno-builtin-memcpy) # Otherwise `state [[maybe_unused]] int x;` will issue a warning. # https://stackoverflow.com/questions/50646334/maybe-unused-on-member-variable-gcc-warns-incorrectly-that-attribute-is add_compile_options(-Wno-attributes) diff --git a/flow/CMakeLists.txt b/flow/CMakeLists.txt index 080d483edd..61ce9ed17b 100644 --- a/flow/CMakeLists.txt +++ b/flow/CMakeLists.txt @@ -75,6 +75,7 @@ set(FLOW_SRCS flat_buffers.h flow.cpp flow.h + folly_memcpy.S genericactors.actor.cpp genericactors.actor.h network.cpp diff --git a/flow/folly_memcpy.S b/flow/folly_memcpy.S index e6e95371eb..66361a774a 100644 --- a/flow/folly_memcpy.S +++ b/flow/folly_memcpy.S @@ -79,9 +79,9 @@ _memcpy_short: * */ .align 16 - .globl memcpy - .type memcpy, @function -memcpy: + .globl folly_memcpy + .type folly_memcpy, @function +folly_memcpy: .cfi_startproc mov %rdx, %rcx @@ -173,6 +173,6 @@ memcpy: ret .cfi_endproc - .size memcpy, .-memcpy + .size folly_memcpy, .-folly_memcpy #endif diff --git a/flow/test_memcpy_perf.cpp b/flow/test_memcpy_perf.cpp index b2750b3585..c54f70aacf 100644 --- a/flow/test_memcpy_perf.cpp +++ b/flow/test_memcpy_perf.cpp @@ -12,6 +12,10 @@ #include "flow/IRandom.h" #include "flow/UnitTest.h" +extern "C" { + void* folly_memcpy(void* dst, void* src, uint32_t length); +} + /* * Set this to the maximum buffer size you want to test. If it is 0, then the * values in the buf_sizes[] array below will be used. @@ -46,13 +50,13 @@ static size_t buf_sizes[TEST_VALUE_RANGE]; #define TEST_BATCH_SIZE 100 /* Data is aligned on this many bytes (power of 2) */ -#ifdef RTE_MACHINE_CPUFLAG_AVX512F +// #ifdef RTE_MACHINE_CPUFLAG_AVX512F #define ALIGNMENT_UNIT 64 -#elif defined RTE_MACHINE_CPUFLAG_AVX2 -#define ALIGNMENT_UNIT 32 -#else /* RTE_MACHINE_CPUFLAG */ -#define ALIGNMENT_UNIT 16 -#endif /* RTE_MACHINE_CPUFLAG */ +// #elif defined RTE_MACHINE_CPUFLAG_AVX2 +// #define ALIGNMENT_UNIT 32 +// #else /* RTE_MACHINE_CPUFLAG */ +// #define ALIGNMENT_UNIT 16 +// #endif /* RTE_MACHINE_CPUFLAG */ /* * Pointers used in performance tests. The two large buffers are for uncached