diff options
| author | Mattias Andrée <maandree@kth.se> | 2016-04-27 13:30:47 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2016-04-27 13:30:47 +0200 |
| commit | 8c2ad212d78184d59e4181993c195b35c4cde166 (patch) | |
| tree | d4cc9d6a6808ce55102666c727eeb51f8870457e /bench/benchmark.c | |
| parent | Fix const-correctness in libtommath translation and add error checking in hebimath translation (diff) | |
| download | libzahl-8c2ad212d78184d59e4181993c195b35c4cde166.tar.gz libzahl-8c2ad212d78184d59e4181993c195b35c4cde166.tar.bz2 libzahl-8c2ad212d78184d59e4181993c195b35c4cde166.tar.xz | |
Improve library translations
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
| -rw-r--r-- | bench/benchmark.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bench/benchmark.c b/bench/benchmark.c index 2c3f464..87e15ca 100644 --- a/bench/benchmark.c +++ b/bench/benchmark.c @@ -99,10 +99,13 @@ main(int argc, char *argv[]) BENCHMARK(zbset(c, a, 76, -1), 1); BENCHMARK(zbset(a, a, 76, -1), 1); BENCHMARK(zbtest(a, 76), 1); +#ifndef HEBIMATH BENCHMARK(zgcd(c, a, b), 0); +#endif BENCHMARK(zmul(c, a, b), 0); BENCHMARK(zmul(c, a, a), 0); BENCHMARK(zsqr(c, a), 0); +#ifndef HEBIMATH zsets(d, "1484298084218938358480511181388394862858002249"); BENCHMARK(zmodmul(c, a, b, d), 0); BENCHMARK(zmodmul(c, a, a, d), 0); @@ -111,10 +114,11 @@ main(int argc, char *argv[]) BENCHMARK(zmodmul(c, a, a, tiny), 0); BENCHMARK(zmodsqr(c, a, tiny), 0); zsets(d, "12"); - BENCHMARK(zpow(c, a, d), 0); - BENCHMARK(zpowu(c, a, 12), 0); + BENCHMARK(zpow(c, a, d), 0); /* Memory corruption when using hebimath */ + BENCHMARK(zpowu(c, a, 12), 0); /* Memory corruption when using hebimath */ BENCHMARK(zmodpow(c, a, d, b), 0); BENCHMARK(zmodpowu(c, a, 12, b), 0); +#endif BENCHMARK(zsets(c, "5495468234592964023447280368442884381000481887"), 0); BENCHMARK(zstr_length(a, 10), 0); BENCHMARK(zstr(a, buf, 0), 0); @@ -127,9 +131,11 @@ main(int argc, char *argv[]) BENCHMARK(zdiv(c, a, b), 1); BENCHMARK(zmod(c, a, b), 1); BENCHMARK(zdivmod(c, d, a, b), 1); +#ifndef HEBIMATH BENCHMARK(zdiv(c, a, tiny), 0); BENCHMARK(zmod(c, a, tiny), 0); BENCHMARK(zdivmod(c, d, a, tiny), 0); +#endif zfree(a); zfree(b); |
