fix ; test fp_addNC if enable

dev
MITSUNARI Shigeo 8 years ago
parent d3bfef9f81
commit 0a364db2fd
  1. 8
      sample/large.cpp
  2. 9
      sample/rawbench.cpp

@ -11,7 +11,7 @@ typedef mcl::FpT<> Fp;
typedef mcl::fp::Unit Unit; typedef mcl::fp::Unit Unit;
using namespace mcl::fp; using namespace mcl::fp;
#include "../src/low_gmp.hpp" //#include "../src/low_gmp.hpp"
const size_t N = 12; const size_t N = 12;
#if 0 #if 0
@ -110,8 +110,10 @@ void test(const std::string& pStr, mcl::fp::Mode mode)
CYBOZU_BENCH("sqrPre", op.fpDbl_sqrPre, ux, ux); CYBOZU_BENCH("sqrPre", op.fpDbl_sqrPre, ux, ux);
CYBOZU_BENCH("add", op.fpDbl_add, ux, ux, ux, op.p); CYBOZU_BENCH("add", op.fpDbl_add, ux, ux, ux, op.p);
CYBOZU_BENCH("sub", op.fpDbl_sub, ux, ux, ux, op.p); CYBOZU_BENCH("sub", op.fpDbl_sub, ux, ux, ux, op.p);
CYBOZU_BENCH("addNC", op.fpDbl_addNC, ux, ux, ux); if (op.fpDbl_addNC) {
CYBOZU_BENCH("subNC", op.fpDbl_subNC, ux, ux, ux); CYBOZU_BENCH("addNC", op.fpDbl_addNC, ux, ux, ux);
CYBOZU_BENCH("subNC", op.fpDbl_subNC, ux, ux, ux);
}
CYBOZU_BENCH("mont", op.fpDbl_mod, ux, ux, op.p); CYBOZU_BENCH("mont", op.fpDbl_mod, ux, ux, op.p);
CYBOZU_BENCH("mul", Fp::mul, x, x, x); CYBOZU_BENCH("mul", Fp::mul, x, x, x);
compareGmp(pStr); compareGmp(pStr);

@ -38,8 +38,13 @@ void benchRaw(const char *p, mcl::fp::Mode mode)
double fp2_sqrT, fp2_mulT; double fp2_sqrT, fp2_mulT;
CYBOZU_BENCH_T(fp_addT, op.fp_add, uz, ux, uy, op.p); CYBOZU_BENCH_T(fp_addT, op.fp_add, uz, ux, uy, op.p);
CYBOZU_BENCH_T(fp_subT, op.fp_sub, uz, uy, ux, op.p); CYBOZU_BENCH_T(fp_subT, op.fp_sub, uz, uy, ux, op.p);
CYBOZU_BENCH_T(fp_addNCT, op.fp_addNC, uz, ux, uy); if (op.fp_addNC) {
CYBOZU_BENCH_T(fp_subNCT, op.fp_subNC, uz, uy, ux); CYBOZU_BENCH_T(fp_addNCT, op.fp_addNC, uz, ux, uy);
CYBOZU_BENCH_T(fp_subNCT, op.fp_subNC, uz, uy, ux);
} else {
fp_addNCT = 0;
fp_subNCT = 0;
}
CYBOZU_BENCH_T(fp_sqrT, op.fp_sqr, uz, ux, op.p); CYBOZU_BENCH_T(fp_sqrT, op.fp_sqr, uz, ux, op.p);
CYBOZU_BENCH_T(fp_mulT, op.fp_mul, uz, ux, uy, op.p); CYBOZU_BENCH_T(fp_mulT, op.fp_mul, uz, ux, uy, op.p);
CYBOZU_BENCH_T(fp_mul_UnitT, op.fp_mul_Unit, uz, ux, 12345678, op.p); CYBOZU_BENCH_T(fp_mul_UnitT, op.fp_mul_Unit, uz, ux, 12345678, op.p);

Loading…
Cancel
Save