aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-03-28 23:13:56 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-03-28 23:13:56 +0100
commit522d7e88ef611de8edde6ae49cb985da58b8963c (patch)
tree2b22ea2bd749e4bd26c594a75f235ff25d69f050
parentb42d24cb2e1472da5859516511238a0771f137d8 (diff)
downloadcompcert-kvx-522d7e88ef611de8edde6ae49cb985da58b8963c.tar.gz
compcert-kvx-522d7e88ef611de8edde6ae49cb985da58b8963c.zip
ocaml benchmark
-rw-r--r--test/monniaux/ocaml/Makefile8
-rw-r--r--test/monniaux/ocaml/byterun/main.c13
-rw-r--r--test/monniaux/rules.mk9
3 files changed, 22 insertions, 8 deletions
diff --git a/test/monniaux/ocaml/Makefile b/test/monniaux/ocaml/Makefile
index fc72d6ab..0ae7c22f 100644
--- a/test/monniaux/ocaml/Makefile
+++ b/test/monniaux/ocaml/Makefile
@@ -16,14 +16,14 @@ GCC_HOST_S=$(patsubst %.c,%.gcc.host.s,$(CFILES))
all: $(CCOMP_K1C_S) $(GCC_K1C_S) ocamlrun.ccomp.k1c.out ocamlrun.gcc.k1c.out
-ocamlrun.ccomp.k1c : $(CCOMP_K1C_S)
+ocamlrun.ccomp.k1c : $(CCOMP_K1C_S) ../clock.gcc.k1c.o
$(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@ $(LDLIBS)
-ocamlrun.ccomp.host : $(CCOMP_HOST_S)
+ocamlrun.ccomp.host : $(CCOMP_HOST_S) ../clock.gcc.host.o
$(CCOMP) $(CCOMPFLAGS) $+ -o $@ $(LDLIBS)
-ocamlrun.gcc.k1c : $(GCC_K1C_S)
+ocamlrun.gcc.k1c : $(GCC_K1C_S) ../clock.gcc.k1c.o
$(K1C_CC) $(K1C_CFLAGS) $+ -o $@ $(LDLIBS)
-ocamlrun.gcc.host : $(GCC_HOST_S)
+ocamlrun.gcc.host : $(GCC_HOST_S) ../clock.gcc.host.o
$(CC) $(CFLAGS) $+ -o $@ $(LDLIBS)
diff --git a/test/monniaux/ocaml/byterun/main.c b/test/monniaux/ocaml/byterun/main.c
index 5e5839ff..498f3d18 100644
--- a/test/monniaux/ocaml/byterun/main.c
+++ b/test/monniaux/ocaml/byterun/main.c
@@ -13,6 +13,7 @@
/* */
/**************************************************************************/
+#define VERIMAG_MEASUREMENTS
#define CAML_INTERNALS
/* Main entry point (can be overridden by a user-provided main()
@@ -26,6 +27,10 @@
#include <windows.h>
#endif
+#ifdef VERIMAG_MEASUREMENTS
+#include "../../clock.h"
+#endif
+
CAMLextern void caml_main (char_os **);
#ifdef _WIN32
@@ -41,7 +46,15 @@ int main(int argc, char **argv)
caml_expand_command_line(&argc, &argv);
#endif
+#ifdef VERIMAG_MEASUREMENTS
+ clock_prepare();
+ clock_start();
+#endif
caml_main(argv);
+#ifdef VERIMAG_MEASUREMENTS
+ clock_stop();
+ print_total_clock();
+#endif
caml_sys_exit(Val_int(0));
return 0; /* not reached */
}
diff --git a/test/monniaux/rules.mk b/test/monniaux/rules.mk
index fcd6ed0a..f1f26fe2 100644
--- a/test/monniaux/rules.mk
+++ b/test/monniaux/rules.mk
@@ -1,13 +1,14 @@
+ALL_CCOMPFLAGS=-fno-unprototyped
CCOMP=ccomp
-CCOMPFLAGS=-g -O3 -Wall -fno-unprototyped
+CCOMPFLAGS=-g -O3 -Wall $(ALL_CCOMPFLAGS) $(ALL_CFLAGS)
-CFLAGS=-g -std=c99 -O3 -Wall -Wextra -Werror=implicit
+CFLAGS=-g -std=c99 -O3 -Wall -Wextra -Werror=implicit $(ALL_CFLAGS)
K1C_CC=k1-mbr-gcc
-K1C_CFLAGS =-g -std=c99 -O2 -Wall -Wextra -Werror=implicit
+K1C_CFLAGS =-g -std=c99 -O2 -Wall -Wextra -Werror=implicit $(ALL_CFLAGS)
K1C_CCOMP = ../../../ccomp
-K1C_CCOMPFLAGS=-O3 -Wall -Wno-c11-extensions -fno-unprototyped # -fpostpass-ilp
+K1C_CCOMPFLAGS=-O3 -Wall -Wno-c11-extensions $(ALL_CCOMPFLAGS) $(ALL_CFLAGS) # -fpostpass-ilp
EXECUTE=k1-cluster --syscall=libstd_scalls.so --
EXECUTE_CYCLES=k1-cluster --syscall=libstd_scalls.so --cycle-based --