aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/bitsliced-aes/one_file/reduce
diff options
context:
space:
mode:
Diffstat (limited to 'test/monniaux/bitsliced-aes/one_file/reduce')
-rw-r--r--test/monniaux/bitsliced-aes/one_file/reduce/bitsliced-aes_compute.c32
-rw-r--r--test/monniaux/bitsliced-aes/one_file/reduce/bitsliced-aes_main.c20
-rwxr-xr-xtest/monniaux/bitsliced-aes/one_file/reduce/compare.sh16
3 files changed, 68 insertions, 0 deletions
diff --git a/test/monniaux/bitsliced-aes/one_file/reduce/bitsliced-aes_compute.c b/test/monniaux/bitsliced-aes/one_file/reduce/bitsliced-aes_compute.c
new file mode 100644
index 00000000..5294ff1d
--- /dev/null
+++ b/test/monniaux/bitsliced-aes/one_file/reduce/bitsliced-aes_compute.c
@@ -0,0 +1,32 @@
+#include <stdint.h>
+#include <string.h>
+int i[1];
+int j, bs_transpose_dst_k, k, s, o;
+void a(int (*)[], uint8_t *);
+void b(uint8_t c, uint8_t d, size_t e, uint8_t f, uint8_t g) {
+ int l[1];
+ a(l, f);
+}
+void a(int (*l)[], uint8_t *m) {
+ for (; o < 76; o += 8) {
+ {
+ int *n = i;
+ bs_transpose_dst_k = 0;
+ for (; bs_transpose_dst_k < 64; bs_transpose_dst_k++) {
+ j = 0;
+ for (; j < 64; j++) {
+ k = &s;
+ n[j] = k & 1;
+ }
+ }
+ }
+ }
+}
+void aes_ecb_test() {}
+void aes_ctr_test() {
+ uint8_t p = "";
+ uint8_t q = "";
+ uint8_t r = "";
+ uint8_t output[4];
+ b(output, r, 4, p, q);
+}
diff --git a/test/monniaux/bitsliced-aes/one_file/reduce/bitsliced-aes_main.c b/test/monniaux/bitsliced-aes/one_file/reduce/bitsliced-aes_main.c
new file mode 100644
index 00000000..0d48b3b8
--- /dev/null
+++ b/test/monniaux/bitsliced-aes/one_file/reduce/bitsliced-aes_main.c
@@ -0,0 +1,20 @@
+#include "/home/monniaux/work/Kalray/CompCert/test/monniaux/clock.h"
+
+void aes_ecb_test(void);
+void aes_ctr_test(void);
+
+int main(int argc, char * argv[])
+{
+ clock_prepare();
+
+ clock_start();
+
+ aes_ecb_test();
+ aes_ctr_test();
+
+
+ clock_stop();
+ print_total_clock();
+
+ return 0;
+}
diff --git a/test/monniaux/bitsliced-aes/one_file/reduce/compare.sh b/test/monniaux/bitsliced-aes/one_file/reduce/compare.sh
new file mode 100755
index 00000000..97939771
--- /dev/null
+++ b/test/monniaux/bitsliced-aes/one_file/reduce/compare.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+ROOT=/home/monniaux/work/Kalray/CompCert
+SRC=bitsliced-aes_compute.c
+MAIN=/home/monniaux/work/Kalray/CompCert/test/monniaux/bitsliced-aes/one_file/reduce/bitsliced-aes_main
+k1-cos-gcc -Werror=implicit -Werror=uninitialized -O3 $SRC $ROOT/test/monniaux/clock.gcc.k1c.o $MAIN.gcc.k1c.o -o bitsliced-aes.gcc.k1c &&
+$ROOT/ccomp -O3 -fno-unprototyped -O3 $SRC $ROOT/test/monniaux/clock.gcc.k1c.o $MAIN.gcc.k1c.o -o bitsliced-aes.ccomp.k1c &&
+gcc -Werror=implicit -Werror=uninitialized -O3 $SRC $ROOT/test/monniaux/clock.gcc.host.o $MAIN.c -o bitsliced-aes.gcc.host &&
+valgrind ./bitsliced-aes.gcc.host &&
+k1-cluster --cycle-based -- ./bitsliced-aes.gcc.k1c > ./bitsliced-aes.gcc.k1c.out &&
+k1-cluster --cycle-based -- ./bitsliced-aes.ccomp.k1c > ./bitsliced-aes.ccomp.k1c.out &&
+grep cycles ./bitsliced-aes.gcc.k1c.out > ./bitsliced-aes.gcc.k1c.cycles &&
+grep cycles ./bitsliced-aes.ccomp.k1c.out > ./bitsliced-aes.ccomp.k1c.cycles &&
+sed -i -e 's/cycles: //' ./bitsliced-aes.gcc.k1c.cycles &&
+sed -i -e 's/cycles: //' ./bitsliced-aes.ccomp.k1c.cycles &&
+test $(cat ./bitsliced-aes.gcc.k1c.cycles) -gt 100000 &&
+test $(cat ./bitsliced-aes.ccomp.k1c.cycles) -gt $(expr 2 '*' $(cat ./bitsliced-aes.gcc.k1c.cycles))