aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/latency
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-01-31 22:13:32 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-01-31 22:13:32 +0100
commitd0e215df105a305c5679ddb6d1a9236843637f14 (patch)
tree9153642ac3cca716f0cec917e2233b1b7d9d2ceb /test/monniaux/latency
parent4ba61956bec43ad004e37d1ad33c145daddf0ea2 (diff)
downloadcompcert-kvx-d0e215df105a305c5679ddb6d1a9236843637f14.tar.gz
compcert-kvx-d0e215df105a305c5679ddb6d1a9236843637f14.zip
show latencies
Diffstat (limited to 'test/monniaux/latency')
-rw-r--r--test/monniaux/latency/latency.s27
-rw-r--r--test/monniaux/latency/show_latency.c11
2 files changed, 38 insertions, 0 deletions
diff --git a/test/monniaux/latency/latency.s b/test/monniaux/latency/latency.s
new file mode 100644
index 00000000..494f9f77
--- /dev/null
+++ b/test/monniaux/latency/latency.s
@@ -0,0 +1,27 @@
+# File generated by CompCert 3.4
+# Command line: -S latency.c
+ .text
+ .balign 2
+ .globl latency
+latency:
+ make $r2 = 100
+;;
+ loopdo $r2, .exitloop
+;;
+ lws $r1 = 0[$r0]
+;;
+ addw $r0 = $r0, 0
+;;
+ addw $r0 = $r0, 0
+;;
+ addw $r0 = $r0, 0
+;;
+ addw $r1 = $r1, 1
+;;
+ sw 0[$r0] = $r1
+;;
+.exitloop:
+ ret
+;;
+ .type latency, @function
+ .size latency, . - latency
diff --git a/test/monniaux/latency/show_latency.c b/test/monniaux/latency/show_latency.c
new file mode 100644
index 00000000..3269450a
--- /dev/null
+++ b/test/monniaux/latency/show_latency.c
@@ -0,0 +1,11 @@
+#include "../clock.h"
+
+extern void latency(int *p);
+
+int main() {
+ int x;
+ clock_start();
+ latency(&x);
+ clock_stop();
+ print_total_clock();
+}