X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=benchmarks%2Fcommon%2Futil.h;h=081cfd634526d875bcde36eb0c0ce61346677a1a;hb=3f1859129af6d26a3357cc1120c75e89d2aa8aaf;hp=a3e2e8cfa29c54a30c2505221a688203a09e772c;hpb=9fbc573597c8087ab0aa8e20d8835cfc2c5097a4;p=riscv-tests.git diff --git a/benchmarks/common/util.h b/benchmarks/common/util.h index a3e2e8c..081cfd6 100644 --- a/benchmarks/common/util.h +++ b/benchmarks/common/util.h @@ -67,6 +67,11 @@ static uint64_t lfsr(uint64_t x) return (x >> 1) | (bit << 62); } +static uintptr_t insn_len(uintptr_t pc) +{ + return (*(unsigned short*)pc & 3) ? 4 : 2; +} + #ifdef __riscv #include "encoding.h" #endif