Add arm64 hardware assisted crc32c support
[fio.git] / crc / test.c
index 05ea73e69e1abee7d15e7a17ec0cd75da7cd01b8..78f19ac5867d561b1eb9a9aa4a6cd9ff5aa7a18d 100644 (file)
@@ -68,7 +68,7 @@ static void t_crc64(struct test_type *t, void *buf, size_t size)
        int i;
 
        for (i = 0; i < NR_CHUNKS; i++)
-               fio_crc64(buf, size);
+               t->output += fio_crc64(buf, size);
 }
 
 static void t_crc32(struct test_type *t, void *buf, size_t size)
@@ -76,7 +76,7 @@ static void t_crc32(struct test_type *t, void *buf, size_t size)
        int i;
 
        for (i = 0; i < NR_CHUNKS; i++)
-               fio_crc32(buf, size);
+               t->output += fio_crc32(buf, size);
 }
 
 static void t_crc32c(struct test_type *t, void *buf, size_t size)
@@ -84,7 +84,7 @@ static void t_crc32c(struct test_type *t, void *buf, size_t size)
        int i;
 
        for (i = 0; i < NR_CHUNKS; i++)
-               fio_crc32c(buf, size);
+               t->output += fio_crc32c(buf, size);
 }
 
 static void t_crc16(struct test_type *t, void *buf, size_t size)
@@ -92,7 +92,7 @@ static void t_crc16(struct test_type *t, void *buf, size_t size)
        int i;
 
        for (i = 0; i < NR_CHUNKS; i++)
-               fio_crc16(buf, size);
+               t->output += fio_crc16(buf, size);
 }
 
 static void t_crc7(struct test_type *t, void *buf, size_t size)
@@ -100,7 +100,7 @@ static void t_crc7(struct test_type *t, void *buf, size_t size)
        int i;
 
        for (i = 0; i < NR_CHUNKS; i++)
-               fio_crc7(buf, size);
+               t->output += fio_crc7(buf, size);
 }
 
 static void t_sha1(struct test_type *t, void *buf, size_t size)
@@ -148,7 +148,7 @@ static void t_murmur3(struct test_type *t, void *buf, size_t size)
        int i;
 
        for (i = 0; i < NR_CHUNKS; i++)
-               murmurhash3(buf, size, 0x8989);
+               t->output += murmurhash3(buf, size, 0x8989);
 }
 
 static void t_jhash(struct test_type *t, void *buf, size_t size)
@@ -291,6 +291,7 @@ int fio_crctest(const char *type)
        int i, first = 1;
        void *buf;
 
+       crc32c_arm64_probe();
        crc32c_intel_probe();
 
        if (!type)
@@ -338,9 +339,9 @@ int fio_crctest(const char *type)
                                sprintf(pre, "\t");
                        else
                                sprintf(pre, "\t\t");
-                       printf("%s:%s%8.2f MB/sec\n", t[i].name, pre, mb_sec);
+                       printf("%s:%s%8.2f MiB/sec\n", t[i].name, pre, mb_sec);
                } else
-                       printf("%s:inf MB/sec\n", t[i].name);
+                       printf("%s:inf MiB/sec\n", t[i].name);
                first = 0;
        }