From 0d8f4f46407b1634fba4f6cd46ba4955a7859863 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Wed, 27 Mar 2019 07:53:34 +0100 Subject: match some 'and' --- test/monniaux/bitsliced-aes/bs.c | 7 +++---- test/monniaux/bitsliced-aes/notes.txt | 13 +++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'test/monniaux/bitsliced-aes') diff --git a/test/monniaux/bitsliced-aes/bs.c b/test/monniaux/bitsliced-aes/bs.c index 949d2a8a..5fd7450a 100644 --- a/test/monniaux/bitsliced-aes/bs.c +++ b/test/monniaux/bitsliced-aes/bs.c @@ -16,13 +16,12 @@ static inline word_t compcert_ternary(word_t x, word_t v0, word_t v1) { /* with bitmask #define TERNARY0(cmp,v1) (-(cmp != 0) & (v1)) */ -/* with function call to ternary */ +/* 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)))) */ +#define TERNARY0(x, v1) ((unsigned long) ((long) (-(((long) (x))!=0)) & (v1))) + #if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) ||\ defined(__amd64__) || defined(__amd32__)|| defined(__amd16__) #define bs2le(x) (x) diff --git a/test/monniaux/bitsliced-aes/notes.txt b/test/monniaux/bitsliced-aes/notes.txt index e9be8b42..815d5931 100644 --- a/test/monniaux/bitsliced-aes/notes.txt +++ b/test/monniaux/bitsliced-aes/notes.txt @@ -36,3 +36,16 @@ cycles: 2916854 ==> test.gcc.k1c.out <== cycles: 5646730 + +* cmove via match du and +==> test.ccomp.host.out <== +cycles: 2553732 + +==> test.ccomp.k1c.out <== +cycles: 7208629 + +==> test.gcc.host.out <== +cycles: 1849125 + +==> test.gcc.k1c.out <== +cycles: 5255763 -- cgit