Lines Matching +full:1000 +full:base +full:- +full:x

4  * Copyright (c) 2016-2020, Arm Limited.
5 * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
35 #define ALIGN(x, y) (((x) + (y) - 1) & ~((y) - 1)) argument
37 /* Reference implementation - do not modify! */
42 uint64_t sum = 0;/* Need 64-bit accumulator when nbytes > 64K */ in checksum_simple()
45 for (uint32_t nhalfs = nbytes >> 1; nhalfs != 0; nhalfs--) in checksum_simple()
56 /* Fold 64-bit sum to 32 bits */ in checksum_simple()
61 /* Fold 32-bit sum to 16 bits */ in checksum_simple()
95 return -1; in find_impl()
110 "actual %04x expected %04x (valid)", in verify()
132 benchmark(const uint8_t *base, in benchmark() argument
144 uint32_t random = ((uint32_t *) base)[i % (poolsize / 4)]; in benchmark()
146 const void *data = &base[random % (poolsize - blksize)]; in benchmark()
152 uint64_t elapsed_ns = end - start; in benchmark()
154 uint32_t blks_per_s = (uint32_t) ((numops / elapsed_ms) * 1000); in benchmark()
156 printf("%11ju ", (uintmax_t) ((accbytes / elapsed_ms) * 1000) / MEGABYTE); in benchmark()
161 unsigned int cyc_per_byte = 1000 * cyc_per_blk / blksize; in benchmark()
163 cyc_per_byte / 1000, cyc_per_byte % 1000); in benchmark()
179 while ((c = getopt(argc, argv, "b:df:i:n:p:")) != -1) in main()
239 char c = optarg[strlen(optarg) - 1]; in main()
257 "-b <blksize> Block size\n" in main()
258 "-d Dump first 96 bytes of data\n" in main()
259 "-f <cpufreq> CPU frequency (Hz)\n" in main()
260 "-i <impl> Implementation\n" in main()
261 "-n <numops> Number of operations\n" in main()
262 "-p <poolsize> Pool size (K or M suffix)\n" in main()
280 uint8_t *base = mmap(0, POOLSIZE, PROT_READ|PROT_WRITE, in main() local
281 MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); in main()
282 if (base == MAP_FAILED) in main()
288 ((uint32_t *) base)[i] = rand(); in main()
318 printf(" %02x", base[i]); in main()
333 success &= verify(&base[offset], offset, size); in main()
335 uint8_t *p = base + POOLSIZE - (size + offset); in main()
342 success &= verify(base, 0, size); in main()
345 success &= verify(base, 0, POOLSIZE); in main()
362 benchmark(base, POOLSIZE, BLKSIZE, NUMOPS, CPUFREQ); in main()
371 benchmark(base, POOLSIZE, sizes[i], numops, CPUFREQ); in main()
375 if (munmap(base, POOLSIZE) != 0) in main()