aboutsummaryrefslogtreecommitdiffstats
path: root/dhrystone/dhry_1.c
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2015-06-07 07:29:13 +0200
committerClifford Wolf <clifford@clifford.at>2015-06-07 07:29:13 +0200
commit491cd5e15dc3f96d177493d2e23edc356dcc648e (patch)
treed307b076ad53fa189cc015ff3f80e7dbba2e909b /dhrystone/dhry_1.c
parent44ea992fed0d66730d6bdeba740bda53c9e7349f (diff)
downloadpicorv32-491cd5e15dc3f96d177493d2e23edc356dcc648e.tar.gz
picorv32-491cd5e15dc3f96d177493d2e23edc356dcc648e.zip
Using libc assembler code in dhrystone stdlib.c
Diffstat (limited to 'dhrystone/dhry_1.c')
-rw-r--r--dhrystone/dhry_1.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/dhrystone/dhry_1.c b/dhrystone/dhry_1.c
index f2fd95c..849cea8 100644
--- a/dhrystone/dhry_1.c
+++ b/dhrystone/dhry_1.c
@@ -52,7 +52,9 @@ extern int times ();
#endif
#ifdef TIME
extern long time();
+#ifdef RISCV
extern long insn();
+#endif
/* see library function "time" */
#define Too_Small_Time 2
/* Measurements should last at least 2 seconds */
@@ -61,9 +63,11 @@ extern long insn();
long Begin_Time,
End_Time,
User_Time;
+#ifdef RISCV
long Begin_Insn,
End_Insn,
User_Insn;
+#endif
float Microseconds,
Dhrystones_Per_Second;
@@ -138,8 +142,10 @@ main ()
#endif
#ifdef TIME
Begin_Time = time ( (long *) 0);
+#ifdef RISCV
Begin_Insn = insn ( (long *) 0);
#endif
+#endif
for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index)
{
@@ -197,8 +203,10 @@ main ()
#endif
#ifdef TIME
End_Time = time ( (long *) 0);
+#ifdef RISCV
End_Insn = insn ( (long *) 0);
#endif
+#endif
printf ("Execution ends\n");
printf ("\n");
@@ -254,9 +262,10 @@ main ()
printf ("\n");
User_Time = End_Time - Begin_Time;
+
+#ifdef RISCV
User_Insn = End_Insn - Begin_Insn;
-#if 1
printf("Number_Of_Runs: %d\n", Number_Of_Runs);
printf("User_Time: %d cycles, %d insn\n", User_Time, User_Insn);