aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/too_slow
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-03-24 12:34:59 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-03-24 12:34:59 +0100
commitee49464e9745ed7da517b74791c7c85296184fd3 (patch)
tree817fe5b596c0bd81afb22e3414079b346f596776 /test/monniaux/too_slow
parent2e3983682ac5159c846c8eb6bcc18fcc7a86922f (diff)
downloadcompcert-kvx-ee49464e9745ed7da517b74791c7c85296184fd3.tar.gz
compcert-kvx-ee49464e9745ed7da517b74791c7c85296184fd3.zip
mysteriously slow code
Diffstat (limited to 'test/monniaux/too_slow')
-rw-r--r--test/monniaux/too_slow/Makefile27
-rw-r--r--test/monniaux/too_slow/memset_from_bitsliced-aes.c43
2 files changed, 70 insertions, 0 deletions
diff --git a/test/monniaux/too_slow/Makefile b/test/monniaux/too_slow/Makefile
new file mode 100644
index 00000000..bdc23def
--- /dev/null
+++ b/test/monniaux/too_slow/Makefile
@@ -0,0 +1,27 @@
+include ../rules.mk
+
+PRODUCTS=memset_from_bitsliced-aes.gcc.host.out memset_from_bitsliced-aes.ccomp.host.out \
+ memset_from_bitsliced-aes.gcc.k1c.out memset_from_bitsliced-aes.ccomp.k1c.out \
+ memset_from_bitsliced-aes.gcc.k1c.s memset_from_bitsliced-aes.ccomp.k1c.s
+
+all: $(PRODUCTS)
+
+memset_from_bitsliced-aes.gcc.host.s memset_from_bitsliced-aes.ccomp.host.s memset_from_bitsliced-aes.gcc.k1c.s memset_from_bitsliced-aes.ccomp.k1c.s : ../clock.h
+
+memset_from_bitsliced-aes.ccomp.host: memset_from_bitsliced-aes.ccomp.host.o ../clock.gcc.host.o
+ $(CCOMP) $(CCOMPFLAGS) $+ -o $@
+
+memset_from_bitsliced-aes.gcc.host: memset_from_bitsliced-aes.gcc.host.o ../clock.gcc.host.o
+ $(CC) $(CFLAGS) $+ -o $@
+
+memset_from_bitsliced-aes.gcc.k1c: memset_from_bitsliced-aes.gcc.k1c.o ../clock.gcc.k1c.o
+ $(K1C_CC) $(K1C_CFLAGS) $+ -o $@
+
+memset_from_bitsliced-aes.ccomp.k1c: memset_from_bitsliced-aes.ccomp.k1c.o ../clock.gcc.k1c.o
+ $(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@
+
+clean:
+ -rm -f *.o *.s *.k1c
+
+.PHONY: clean
+
diff --git a/test/monniaux/too_slow/memset_from_bitsliced-aes.c b/test/monniaux/too_slow/memset_from_bitsliced-aes.c
new file mode 100644
index 00000000..32137b55
--- /dev/null
+++ b/test/monniaux/too_slow/memset_from_bitsliced-aes.c
@@ -0,0 +1,43 @@
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include "../clock.h"
+
+typedef uint64_t a;
+a n[128];
+int o, bs_expand_key_k;
+void b(a (*)[], uint8_t *);
+void c(uint8_t d, uint8_t e, size_t f, uint8_t g, uint8_t iv) {
+ a i[1];
+ b(i, g);
+}
+
+void b(a (*i)[], uint8_t *j) {
+ for (; o < 176; o += 8) {
+ bs_expand_key_k = 4;
+ for (; bs_expand_key_k < 128; bs_expand_key_k += 128 / 64)
+ ;
+ memset(n, 0, sizeof(n));
+ }
+}
+
+void aes_ctr_test() {
+ uint8_t k = "";
+ uint8_t l = "";
+ uint8_t m = "";
+ uint8_t output[4];
+ c(output, m, 4, k, l);
+}
+
+int main(int argc, char * argv[])
+{
+ clock_prepare();
+
+ clock_start();
+
+ aes_ctr_test();
+ clock_stop();
+ print_total_clock();
+
+ return 0;
+}