X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=benchmarks%2Fmm%2Fmm_main.c;h=133b5a2d73a17434e8aefef7d8e4ebf4ba8d402e;hb=6a64f119fbda35f415d0c8238909aba70acc1654;hp=8b6a0933f096eb8202efe48586c077726da38fb7;hpb=35cbc0eb62e016907152cd64657a16513a7fa658;p=riscv-tests.git diff --git a/benchmarks/mm/mm_main.c b/benchmarks/mm/mm_main.c index 8b6a093..133b5a2 100644 --- a/benchmarks/mm/mm_main.c +++ b/benchmarks/mm/mm_main.c @@ -6,6 +6,8 @@ #include #include "util.h" +#pragma GCC optimize ("unroll-loops") + void thread_entry(int cid, int nc) { const int R = 8; @@ -31,11 +33,11 @@ void thread_entry(int cid, int nc) size_t instret, cycles; for (int i = 0; i < R; i++) { - instret = -rdinstret(); - cycles = -rdcycle(); + instret = -read_csr(minstret); + cycles = -read_csr(mcycle); mm(m, n, p, a, p, b, n, c, n); - instret += rdinstret(); - cycles += rdcycle(); + instret += read_csr(minstret); + cycles += read_csr(mcycle); } asm volatile("fence");