From 6b0ff9e1259ab2957fc37b5fc868f7e612c945ac Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Fri, 9 Apr 2021 12:55:51 +0000 Subject: [PATCH] - fixed num iterations git-svn-id: http://moon:8086/svn/mips@171 a8ebac50-d88d-4704-bea3-6648445a41b3 --- src/asm/testbench.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/asm/testbench.c b/src/asm/testbench.c index d1ad81f..12d2af2 100644 --- a/src/asm/testbench.c +++ b/src/asm/testbench.c @@ -202,7 +202,7 @@ int Test10_LoadStore() #define NUM_ELEMENTS 20 -#define NUM_RUNS 3 +#define NUM_RUNS 1 int Test11_AddSub() { int buf[NUM_ELEMENTS], result, i, j, diff, fill, num_right_elements, num_right_runs; @@ -242,24 +242,21 @@ int Test12_MulDiv() div_t div_res; srand(0x19701031); - for (i=0; i < 100; i++) + for (i=0; i < NUM_RUNS; i++) { - for (j=1; j < 1000; j++) - { - mix = (int)rand(); - mix = (mix << 8) ^ (mix << 16); - s1 = (int)rand() ^ mix; - mix = (int)rand(); - mix = (mix << 8) ^ (mix << 16); - s2 = (int)rand() ^ mix; + mix = (int)rand(); + mix = (mix << 8) ^ (mix << 16); + s1 = (int)rand() ^ mix; + mix = (int)rand(); + mix = (mix << 8) ^ (mix << 16); + s2 = (int)rand() ^ mix; - div_res = div(s1, s2); + div_res = div(s1, s2); - sp = s2*div_res.quot; - st = div_res.rem + sp; - if (st != s1) - return TEST12_ERROR; - } + sp = s2*div_res.quot; + st = div_res.rem + sp; + if (st != s1) + return TEST12_ERROR; } return NO_ERROR; }