aboutsummaryrefslogtreecommitdiff
path: root/src/Specific/Framework
diff options
context:
space:
mode:
authorGravatar Andres Erbsen <andreser@google.com>2017-11-11 17:33:21 -0500
committerGravatar Andres Erbsen <andreser@google.com>2017-11-11 17:33:24 -0500
commit45df7488dfd35b400d30d4813f59081d3a55c3e2 (patch)
tree7fbb60dc9d24310d54037b11594a3cd06a6c79b3 /src/Specific/Framework
parent3086c91187b221a25fe72434047dd16e78a58d33 (diff)
benchmark montgomery32, gmpvar, and gmpsec on 32-bit android
Despite significant effort, I did not manage to compiler gmpxx in a way that would allow it to be dynamically linked with the c++ standard library on android, or statically link the library in a way that would result in a file executable on Android. Somebody who understands C and Android dynamic linking might be able to do better.
Diffstat (limited to 'src/Specific/Framework')
-rw-r--r--src/Specific/Framework/bench/fibe.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Specific/Framework/bench/fibe.c b/src/Specific/Framework/bench/fibe.c
index 323a6071b..670722e88 100644
--- a/src/Specific/Framework/bench/fibe.c
+++ b/src/Specific/Framework/bench/fibe.c
@@ -76,6 +76,11 @@ static uint32_t _subborrow_u32(uint8_t c, uint32_t a, uint32_t b, uint32_t *low)
return (uint8_t) (x>>63);
}
+static uint32_t cmovznz32(uint32_t t, uint32_t z, uint32_t nz) {
+ t = -!!t;
+ return (t&nz) | ((~t)&z);
+}
+
#if bitwidth >= 64
static uint64_t _mulx_u64(uint64_t a, uint64_t b, uint64_t *high) {
@@ -97,6 +102,11 @@ static uint64_t _subborrow_u64(uint8_t c, uint64_t a, uint64_t b, uint64_t *low)
return (uint8_t) (x>>127);
}
+static uint64_t cmovznz64(uint64_t t, uint64_t z, uint64_t nz) {
+ t = -!!t;
+ return (t&nz) | ((~t)&z);
+}
+
#endif
#endif
@@ -119,7 +129,6 @@ static uint64_t _mulx_u64_out_u8(uint64_t a, uint64_t b, uint8_t *high) {
-#include "liblow.h"
#include "feadd.c"
#include "femul.c"
#include "fesquare.c"