diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-26 15:52:11 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-26 15:52:42 +0100 |
commit | 22d602b81fe3315007075f7807bb9d944a72cb94 (patch) | |
tree | 1841992bbb7f8457d8c2b07ad2cb6ab57facc523 /CMakeLists.txt | |
parent | b08a65087f4ec74b6076038d26bf084bb485973c (diff) | |
download | rspamd-22d602b81fe3315007075f7807bb9d944a72cb94.tar.gz rspamd-22d602b81fe3315007075f7807bb9d944a72cb94.zip |
[Feature] Use rdtsc where possible
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2deefa15f..0acfefb75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1120,6 +1120,23 @@ ELSE() MESSAGE(STATUS "atomic builtins are supported") ENDIF() +CHECK_C_SOURCE_RUNS(" +#include <x86intrin.h> +int main(int argc, char **argv) { + unsigned l; + if (__builtin_ia32_rdtscp(&l)) { + return 0; + } + return -1; +} +" HAVE_RDTSCP) + +IF(NOT HAVE_RDTSCP) + MESSAGE(STATUS "rdtscp intrinsic is -NOT- supported") +ELSE() + MESSAGE(STATUS "rdtscp intrinsic is supported") +ENDIF() + IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") # In linux, we need to mount /run/shm to test which could be unavailable # on a build system. On the other hand, we know that linux has stupid |