diff options
| author | Mattias Andrée <maandree@kth.se> | 2016-05-07 03:17:44 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2016-05-07 03:17:44 +0200 |
| commit | 247dffb6c9a24894f094392ce62f2aa2e81a8acc (patch) | |
| tree | 2daabc69b193b7f79304998fb2bde4a39b5106e9 | |
| parent | Optimisations (diff) | |
| download | libzahl-247dffb6c9a24894f094392ce62f2aa2e81a8acc.tar.gz libzahl-247dffb6c9a24894f094392ce62f2aa2e81a8acc.tar.bz2 libzahl-247dffb6c9a24894f094392ce62f2aa2e81a8acc.tar.xz | |
Fix zsave translation for tomsfastmath and libtommath
Signed-off-by: Mattias Andrée <maandree@kth.se>
| -rw-r--r-- | STATUS | 8 | ||||
| -rw-r--r-- | bench/libtfm.h | 2 | ||||
| -rw-r--r-- | bench/libtommath.h | 2 |
3 files changed, 7 insertions, 5 deletions
@@ -1,11 +1,13 @@ Optimisation progress for libzahl. Benchmarks are done in the -range 1 to 4097 bits. So far all benchmarks are done with the -following combinations of cc and libc: +range 1 to 4097 bits. So far all benchmarks on libzahl are +done with the following combinations of cc and libc: gcc + glibc gcc + musl clang + glibc +Benchmarks on the other libraries are done with gcc and glibc. + All benchmarks are done on an x86-64 (specifically an Intel Core 2 Quad CPU Q9300), without any extensions turned on during compilation, and without any use of extensions in @@ -63,7 +65,7 @@ zand .................... fastest until ~900, alternating with gmp zor ..................... fastest until ~1750, alternating with gmp (gcc) and tomsfastmath (clang) zxor .................... fastest until ~700, alternating with gmp (gcc+glibc) znot .................... always fastest -zsave ................... fastest until ~300, then tomsfastmath; libtommath is suspicious +zsave ................... always fastest zload ................... always fastest diff --git a/bench/libtfm.h b/bench/libtfm.h index b87a288..07628c8 100644 --- a/bench/libtfm.h +++ b/bench/libtfm.h @@ -325,7 +325,7 @@ zxor(z_t r, z_t a, z_t b) static inline size_t zsave(z_t a, char *s) { - _tmp = s ? fp_signed_bin_size(a) : (fp_to_signed_bin(a, (unsigned char *)s), 0); + _tmp = !s ? fp_signed_bin_size(a) : (fp_to_signed_bin(a, (unsigned char *)s), 0); return _tmp; } diff --git a/bench/libtommath.h b/bench/libtommath.h index f502618..aebcc95 100644 --- a/bench/libtommath.h +++ b/bench/libtommath.h @@ -377,7 +377,7 @@ zptest(z_t w, z_t a, int t) static inline size_t zsave(z_t a, char *b) { - _tmp = b ? mp_signed_bin_size(a) : mp_to_signed_bin(a, (unsigned char *)b); + _tmp = !b ? mp_signed_bin_size(a) : mp_to_signed_bin(a, (unsigned char *)b); return _tmp; } |
