diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-03-03 08:17:40 +0100 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-03-03 08:17:40 +0100 |
commit | 1ab7b51c30e1b10ac45b0bd64cefdc01da0f7f68 (patch) | |
tree | 210ffc156c83f04fb0c61a40b4f9037d7ba8a7e1 /test/monniaux/bitsliced-aes/one_file/reduce | |
parent | 222c9047d61961db9c6b19fed5ca49829223fd33 (diff) | |
parent | 12be46d59a2483a10d77fa8ee67f7e0ca1bd702f (diff) | |
download | compcert-kvx-1ab7b51c30e1b10ac45b0bd64cefdc01da0f7f68.tar.gz compcert-kvx-1ab7b51c30e1b10ac45b0bd64cefdc01da0f7f68.zip |
Merge branch 'mppa-cse2' of gricad-gitlab.univ-grenoble-alpes.fr:sixcy/CompCert into mppa-work
Diffstat (limited to 'test/monniaux/bitsliced-aes/one_file/reduce')
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)) |