From ee49464e9745ed7da517b74791c7c85296184fd3 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Sun, 24 Mar 2019 12:34:59 +0100 Subject: mysteriously slow code --- test/monniaux/too_slow/Makefile | 27 ++++++++++++++ test/monniaux/too_slow/memset_from_bitsliced-aes.c | 43 ++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 test/monniaux/too_slow/Makefile create mode 100644 test/monniaux/too_slow/memset_from_bitsliced-aes.c (limited to 'test/monniaux/too_slow') 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 +#include +#include +#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; +} -- cgit From 24e97bd87918f2c487416744ba12a78aba35a9e5 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Fri, 26 Apr 2019 16:35:30 +0200 Subject: Changes to include a -O1 -fschedule-insns2 gcc run as well --- test/monniaux/too_slow/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/monniaux/too_slow') diff --git a/test/monniaux/too_slow/Makefile b/test/monniaux/too_slow/Makefile index bdc23def..fc612e2e 100644 --- a/test/monniaux/too_slow/Makefile +++ b/test/monniaux/too_slow/Makefile @@ -1,7 +1,7 @@ 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.o1.k1c.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) @@ -17,6 +17,9 @@ memset_from_bitsliced-aes.gcc.host: memset_from_bitsliced-aes.gcc.host.o ../cloc 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.gcc.o1.k1c: memset_from_bitsliced-aes.gcc.o1.k1c.o ../clock.gcc.k1c.o + $(K1C_CC) $(K1C_CFLAGS_O1) $+ -o $@ + memset_from_bitsliced-aes.ccomp.k1c: memset_from_bitsliced-aes.ccomp.k1c.o ../clock.gcc.k1c.o $(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@ -- cgit From 76abb605749d1b8ddcc842cecb258fa755d63ccf Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Tue, 14 May 2019 18:01:28 +0200 Subject: Avancement sur la génération de Makefile des benchmarks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/monniaux/too_slow/Makefile | 30 ------------------------------ test/monniaux/too_slow/make.proto | 1 + 2 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 test/monniaux/too_slow/Makefile create mode 100644 test/monniaux/too_slow/make.proto (limited to 'test/monniaux/too_slow') diff --git a/test/monniaux/too_slow/Makefile b/test/monniaux/too_slow/Makefile deleted file mode 100644 index fc612e2e..00000000 --- a/test/monniaux/too_slow/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -include ../rules.mk - -PRODUCTS=memset_from_bitsliced-aes.gcc.host.out memset_from_bitsliced-aes.ccomp.host.out \ - memset_from_bitsliced-aes.gcc.o1.k1c.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.gcc.o1.k1c: memset_from_bitsliced-aes.gcc.o1.k1c.o ../clock.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS_O1) $+ -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/make.proto b/test/monniaux/too_slow/make.proto new file mode 100644 index 00000000..a7b0b37d --- /dev/null +++ b/test/monniaux/too_slow/make.proto @@ -0,0 +1 @@ +target: memset_from_bitsliced-aes -- cgit From 76c41fd907a3f7e7d574da4c075f30656e3ede9f Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Fri, 17 May 2019 14:14:38 +0200 Subject: Measures to CSV done --- test/monniaux/too_slow/make.proto | 1 + 1 file changed, 1 insertion(+) (limited to 'test/monniaux/too_slow') diff --git a/test/monniaux/too_slow/make.proto b/test/monniaux/too_slow/make.proto index a7b0b37d..0635cdd9 100644 --- a/test/monniaux/too_slow/make.proto +++ b/test/monniaux/too_slow/make.proto @@ -1 +1,2 @@ target: memset_from_bitsliced-aes +measures: [cycles] -- cgit From 9f58c4419596fbab69c8fe25c3d51e66acb613d0 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Fri, 17 May 2019 16:19:04 +0200 Subject: Premier jet de graphes de mesures (à améliorer) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/monniaux/too_slow/make.proto | 1 + 1 file changed, 1 insertion(+) (limited to 'test/monniaux/too_slow') diff --git a/test/monniaux/too_slow/make.proto b/test/monniaux/too_slow/make.proto index 0635cdd9..852971fc 100644 --- a/test/monniaux/too_slow/make.proto +++ b/test/monniaux/too_slow/make.proto @@ -1,2 +1,3 @@ target: memset_from_bitsliced-aes measures: [cycles] +name: memset-aes -- cgit From b288b587378984c3c419d26a13dcf93686d1b779 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Wed, 17 Jul 2019 12:03:39 +0200 Subject: All working benches ported --- test/monniaux/too_slow/Makefile | 3 +++ test/monniaux/too_slow/make.proto | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 test/monniaux/too_slow/Makefile delete mode 100644 test/monniaux/too_slow/make.proto (limited to 'test/monniaux/too_slow') diff --git a/test/monniaux/too_slow/Makefile b/test/monniaux/too_slow/Makefile new file mode 100644 index 00000000..a1466d1d --- /dev/null +++ b/test/monniaux/too_slow/Makefile @@ -0,0 +1,3 @@ +TARGET=memset_from_bitslices-aes + +include ../rules.mk diff --git a/test/monniaux/too_slow/make.proto b/test/monniaux/too_slow/make.proto deleted file mode 100644 index 852971fc..00000000 --- a/test/monniaux/too_slow/make.proto +++ /dev/null @@ -1,3 +0,0 @@ -target: memset_from_bitsliced-aes -measures: [cycles] -name: memset-aes -- cgit