diff options
| author | Nathan Moinvaziri <nathan@nathanm.com> | 2022-01-08 13:28:41 -0800 |
|---|---|---|
| committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2022-01-17 09:10:02 +0100 |
| commit | 6f179fd3014b61e77bc22245026f6630b05a863d (patch) | |
| tree | b0ad6f67918f01c9d5da5ef33c4aef35603b6bcb /cpu_features.c | |
| parent | b001d0917e7ec96ad36f626eb3e610555c5b3e43 (diff) | |
| download | Project-Tick-6f179fd3014b61e77bc22245026f6630b05a863d.tar.gz Project-Tick-6f179fd3014b61e77bc22245026f6630b05a863d.zip | |
Added adler32, compare256, crc32, and slide_hash benchmarks using Google Benchmark.
Co-authored-by: Adam Stylinski <kungfujesus06@gmail.com>
Diffstat (limited to 'cpu_features.c')
| -rw-r--r-- | cpu_features.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cpu_features.c b/cpu_features.c new file mode 100644 index 0000000000..70bfcb698c --- /dev/null +++ b/cpu_features.c @@ -0,0 +1,23 @@ +/* cpu_features.c -- CPU architecture feature check + * Copyright (C) 2017 Hans Kristian Rosbach + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zbuild.h" +#include "zutil.h" + +Z_INTERNAL void cpu_check_features(void) { + static int features_checked = 0; + if (features_checked) + return; +#if defined(X86_FEATURES) + x86_check_features(); +#elif defined(ARM_FEATURES) + arm_check_features(); +#elif defined(PPC_FEATURES) || defined(POWER_FEATURES) + power_check_features(); +#elif defined(S390_FEATURES) + s390_check_features(); +#endif + features_checked = 1; +} |
