summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-01-25 08:01:30 -0700
committerJens Axboe <axboe@kernel.dk>2023-01-25 08:01:30 -0700
commit1e8ec88fd5f3ab4b7bbd0119708d94fd64a4e7ad (patch)
tree90bd89e5110ee9f1d5c7bbd13d886ca82eec6559 /os
parent5ca54c1ba2db849dfaef5fe3aec60329b3df0bd1 (diff)
downloadfio-master.tar.gz
fio-master.tar.bz2
Enable crc32c accelleration for arm64 on OSXHEADmaster
Before: jensaxboe@Jenss-MacBook-Pro fio % ./fio --crctest=crc32c crc32c: 440.18 MiB/sec After: ensaxboe@Jenss-MacBook-Pro fio % ./fio --crctest=crc32c crc32c: 23923.00 MiB/sec We know we have it on osx on arm hardware, enabling it is pretty straightforward with that assumption. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'os')
-rw-r--r--os/os-mac.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/os/os-mac.h b/os/os-mac.h
index ec2cc1e5..c9103c45 100644
--- a/os/os-mac.h
+++ b/os/os-mac.h
@@ -14,12 +14,14 @@
#include <machine/endian.h>
#include <libkern/OSByteOrder.h>
+#include "../arch/arch.h"
#include "../file.h"
#define FIO_USE_GENERIC_INIT_RANDOM_STATE
#define FIO_HAVE_GETTID
#define FIO_HAVE_CHARDEV_SIZE
#define FIO_HAVE_NATIVE_FALLOCATE
+#define FIO_HAVE_CPU_HAS
#define OS_MAP_ANON MAP_ANON
@@ -106,4 +108,12 @@ static inline bool fio_fallocate(struct fio_file *f, uint64_t offset, uint64_t l
return false;
}
+static inline bool os_cpu_has(cpu_features feature)
+{
+ /* just check for arm on OSX for now, we know that has it */
+ if (feature != CPU_ARM64_CRC32C)
+ return false;
+ return FIO_ARCH == arch_aarch64;
+}
+
#endif