aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/bitsliced-aes
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-03-27 09:13:40 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-03-27 09:13:40 +0100
commit3c47d54d4cf89f4e29854ac5ef51d8b4c1ca086b (patch)
tree890b2bf86c701fed0071a5668898a7d02069dcdd /test/monniaux/bitsliced-aes
parent820c0fef3aa0715c15988800564612dcc86f81b4 (diff)
downloadcompcert-kvx-3c47d54d4cf89f4e29854ac5ef51d8b4c1ca086b.tar.gz
compcert-kvx-3c47d54d4cf89f4e29854ac5ef51d8b4c1ca086b.zip
work on ternary
Diffstat (limited to 'test/monniaux/bitsliced-aes')
-rw-r--r--test/monniaux/bitsliced-aes/bs.c14
-rw-r--r--test/monniaux/bitsliced-aes/notes.org (renamed from test/monniaux/bitsliced-aes/notes.txt)15
2 files changed, 21 insertions, 8 deletions
diff --git a/test/monniaux/bitsliced-aes/bs.c b/test/monniaux/bitsliced-aes/bs.c
index 5fd7450a..6c68e496 100644
--- a/test/monniaux/bitsliced-aes/bs.c
+++ b/test/monniaux/bitsliced-aes/bs.c
@@ -409,10 +409,14 @@ void bs_transpose_dst(word_t * transpose, word_t * blocks)
#ifndef UNROLL_TRANSPOSE
int j;
+ /* DM use autoincrement */
+ word_t *transptr = transpose+offset;
+ word_t bitmask = ONE;
for(j=0; j < WORD_SIZE; j++)
{
// TODO make const time
- transpose[offset + j] |= TERNARY0((w & (ONE << j)), bitpos);
+ *(transptr++) |= TERNARY0((w & bitmask), bitpos);
+ bitmask <<= 1;
}
#else
@@ -506,10 +510,14 @@ void bs_transpose_rev(word_t * blocks)
word_t offset = k / WORD_SIZE;
#ifndef UNROLL_TRANSPOSE
int j;
+ word_t *transptr = transpose + offset;
+ word_t bitmask = ONE;
for(j=0; j < WORD_SIZE; j++)
{
- word_t bit = (w & (ONE << j)) ? (ONE << (k % WORD_SIZE)) : 0;
- transpose[j * WORDS_PER_BLOCK + (offset)] |= bit;
+ word_t bit = TERNARY0(w & bitmask, bitpos);
+ *transptr |= bit;
+ transptr += WORDS_PER_BLOCK;
+ bitmask <<= 1;
}
#else
transpose[0 * WORDS_PER_BLOCK + (offset )] |= (w & (ONE << 0 )) ? bitpos : 0;
diff --git a/test/monniaux/bitsliced-aes/notes.txt b/test/monniaux/bitsliced-aes/notes.org
index 7ad2ff3c..6c2e27fa 100644
--- a/test/monniaux/bitsliced-aes/notes.txt
+++ b/test/monniaux/bitsliced-aes/notes.org
@@ -1,4 +1,5 @@
-* original
+* bs_transpose_dst only
+** original
==> test.ccomp.host.out <==
cycles: 3080223
@@ -11,7 +12,7 @@ cycles: 1485887
==> test.gcc.k1c.out <==
cycles: 4078535
-* neg and
+** neg and
==> test.ccomp.host.out <==
cycles: 2905049
@@ -24,7 +25,7 @@ cycles: 1858263
==> test.gcc.k1c.out <==
cycles: 5255763
-* cmove mais mauvais scheduling de registres
+** cmove mais mauvais scheduling de registres
==> test.ccomp.host.out <==
cycles: 4363682
@@ -37,7 +38,7 @@ cycles: 2916854
==> test.gcc.k1c.out <==
cycles: 5646730
-* cmove via match du and
+** cmove via match du and
==> test.ccomp.host.out <==
cycles: 2553732
@@ -50,5 +51,9 @@ cycles: 1849125
==> test.gcc.k1c.out <==
cycles: 5255763
-* hand optimized loads
+** hand optimized loads
cycles: 6027072
+
+* both bs_transpose_dst and bs_transpose_rev
+** with both cmove
+6890902