diff options
-rw-r--r-- | test/monniaux/bitsliced-aes/bs.c | 16 | ||||
-rw-r--r-- | test/monniaux/bitsliced-aes/notes.txt | 13 | ||||
-rw-r--r-- | test/monniaux/ternary_builtin/ternary_builtin.c | 4 |
3 files changed, 30 insertions, 3 deletions
diff --git a/test/monniaux/bitsliced-aes/bs.c b/test/monniaux/bitsliced-aes/bs.c index 3fc2ff8f..949d2a8a 100644 --- a/test/monniaux/bitsliced-aes/bs.c +++ b/test/monniaux/bitsliced-aes/bs.c @@ -2,15 +2,25 @@ #include <string.h> #include "bs.h" -word_t compcert_ternary(word_t x, word_t v0, word_t v1) { - return (((-(x==0)) & v0) | ((-(x!=0)) & v1)); + +static inline long compcert_ternary_signedl(long x, long v0, long v1) { + return ((-(x==0)) & v0) | ((-(x!=0)) & v1); +} + +static inline word_t compcert_ternary(word_t x, word_t v0, word_t v1) { + return compcert_ternary_signedl(x, v0, v1); } /* Original #define TERNARY0(cmp,v1) ((cmp) ? (v1) : 0) */ +/* with bitmask #define TERNARY0(cmp,v1) (-(cmp != 0) & (v1)) -/* +*/ +/* with function call to ternary */ #define TERNARY0(cmp,v1) compcert_ternary(cmp, 0, v1) + +/* +#define TERNARY0(x, v1) ((unsigned long) (((-(((long) (x))==0)) & (0)) | ((-(((long) (x))!=0)) & (v1)))) */ #if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) ||\ diff --git a/test/monniaux/bitsliced-aes/notes.txt b/test/monniaux/bitsliced-aes/notes.txt index 954809cc..e9be8b42 100644 --- a/test/monniaux/bitsliced-aes/notes.txt +++ b/test/monniaux/bitsliced-aes/notes.txt @@ -23,3 +23,16 @@ cycles: 1858263 ==> test.gcc.k1c.out <== cycles: 5255763 + +* cmove mais mauvais scheduling de registres +==> test.ccomp.host.out <== +cycles: 4363682 + +==> test.ccomp.k1c.out <== +cycles: 7208629 + +==> test.gcc.host.out <== +cycles: 2916854 + +==> test.gcc.k1c.out <== +cycles: 5646730 diff --git a/test/monniaux/ternary_builtin/ternary_builtin.c b/test/monniaux/ternary_builtin/ternary_builtin.c index 0267fea5..caa1c4c7 100644 --- a/test/monniaux/ternary_builtin/ternary_builtin.c +++ b/test/monniaux/ternary_builtin/ternary_builtin.c @@ -5,3 +5,7 @@ int ternary_signed(int x, int v0, int v1) { int ternary_unsigned(unsigned x, int v0, int v1) { return ((-(x==0)) & v0) | ((-(x!=0)) & v1); } + +long ternary_signedl(long x, long v0, long v1) { + return ((-(x==0)) & v0) | ((-(x!=0)) & v1); +} |