diff options
Diffstat (limited to 'benchmarks/common/util.h')
-rw-r--r-- | benchmarks/common/util.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/benchmarks/common/util.h b/benchmarks/common/util.h index 638f024..24a1cad 100644 --- a/benchmarks/common/util.h +++ b/benchmarks/common/util.h @@ -31,6 +31,8 @@ static void setStats(int enable) {} extern void setStats(int enable); #endif +#include <stdint.h> + extern int have_vec; #define static_assert(cond) switch(0) { case 0: case !!(long)(cond): ; } @@ -109,6 +111,12 @@ static void __attribute__((noinline)) barrier(int ncores) __sync_synchronize(); } +static uint64_t lfsr(uint64_t x) +{ + uint64_t bit = (x ^ (x >> 1)) & 1; + return (x >> 1) | (bit << 62); +} + #ifdef __riscv #include "encoding.h" #endif |